本文整理汇总了C++中GetOrientation函数的典型用法代码示例。如果您正苦于以下问题:C++ GetOrientation函数的具体用法?C++ GetOrientation怎么用?C++ GetOrientation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetOrientation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxT
bool LIB_TEXT::Save( OUTPUTFORMATTER& aFormatter )
{
wxString text = m_Text;
if( text.Contains( wxT( "~" ) ) || text.Contains( wxT( "\"" ) ) )
{
// convert double quote to similar-looking two apostrophes
text.Replace( wxT( "\"" ), wxT( "''" ) );
text = wxT( "\"" ) + text + wxT( "\"" );
}
else
{
// Spaces are not allowed in text because it is not double quoted:
// changed to '~'
text.Replace( wxT( " " ), wxT( "~" ) );
}
aFormatter.Print( 0, "T %g %d %d %d %d %d %d %s ", GetOrientation(), m_Pos.x, m_Pos.y,
m_Size.x, m_Attributs, m_Unit, m_Convert, TO_UTF8( text ) );
aFormatter.Print( 0, " %s %d", m_Italic ? "Italic" : "Normal", ( m_Bold > 0 ) ? 1 : 0 );
char hjustify = 'C';
if( m_HJustify == GR_TEXT_HJUSTIFY_LEFT )
hjustify = 'L';
else if( m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
hjustify = 'R';
char vjustify = 'C';
if( m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
vjustify = 'B';
else if( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
vjustify = 'T';
aFormatter.Print( 0, " %c %c\n", hjustify, vjustify );
return true;
}
示例2: GetMap
void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
Map const* oldMap = GetMap();
Relocate(x, y, z);
// we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
// player far teleport would try to create same instance, but we need it NOW for transport...
RemoveFromWorld();
ResetMap();
Map* newMap = sMapMgr->CreateBaseMap(newMapid);
SetMap(newMap);
ASSERT(GetMap());
AddToWorld();
for (UnitSet::iterator itr = _passengers.begin(); itr != _passengers.end();)
{
Unit* passenger = *itr;
++itr;
switch (passenger->GetTypeId())
{
case TYPEID_UNIT:
passenger->ToCreature()->FarTeleportTo(newMap, x, y, z, passenger->GetOrientation());
break;
case TYPEID_PLAYER:
if (passenger->isDead() && !passenger->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
passenger->ToPlayer()->ResurrectPlayer(1.0f);
passenger->ToPlayer()->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
break;
}
}
if (oldMap != newMap)
{
UpdateForMap(oldMap);
UpdateForMap(newMap);
}
MoveToNextWayPoint();
}
示例3: GetMap
void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
Map const* oldMap = GetMap();
SetMapId(newMapid);
Relocate(x, y, z);
for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
{
PlayerSet::iterator it2 = itr;
++itr;
Player *plr = *it2;
if (!plr)
{
m_passengers.erase(it2);
continue;
}
if (plr->isDead() && !plr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
{
plr->ResurrectPlayer(1.0);
}
plr->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
//WorldPacket data(SMSG_811, 4);
//data << uint32(0);
//plr->BroadcastPacketToSelf(&data);
}
Map* newMap = sMapMgr.CreateMap(newMapid, this);
SetMap(newMap);
if (oldMap != newMap)
{
UpdateForMap(oldMap);
UpdateForMap(newMap);
}
}
示例4: GetMap
void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
Map const* oldMap = GetMap();
Relocate(x, y, z);
for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
{
PlayerSet::iterator it2 = itr;
++itr;
Player* plr = *it2;
if (!plr)
{
m_passengers.erase(it2);
continue;
}
if (plr->isDead() && !plr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
{
plr->ResurrectPlayer(1.0);
}
plr->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
// WorldPacket data(SMSG_811, 4);
// data << uint32(0);
// plr->GetSession()->SendPacket(&data);
}
// we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
// player far teleport would try to create same instance, but we need it NOW for transport...
// correct me if I'm wrong O.o
Map* newMap = sMapMgr.CreateMap(newMapid, this);
SetMap(newMap);
if (oldMap != newMap)
{
UpdateForMap(oldMap);
UpdateForMap(newMap);
}
}
示例5: switch
void SCH_TEXT::MirrorX( int aXaxis_position )
{
// Text is NOT really mirrored; it is moved to a suitable position
// which is the closest position for a true mirrored text
// The center position is mirrored and the text is moved for half
// horizontal len
int py = m_Pos.y;
int dy;
switch( GetOrientation() )
{
case 0: /* horizontal text */
dy = -m_Size.y / 2;
break;
case 1: /* Vert Orientation UP */
dy = -LenSize( m_Text ) / 2;
break;
case 2: /* invert horizontal text*/
dy = m_Size.y / 2; // how to calculate text height?
break;
case 3: /* Vert Orientation BOTTOM */
dy = LenSize( m_Text ) / 2;
break;
default:
dy = 0;
break;
}
py += dy;
py -= aXaxis_position;
NEGATE( py );
py += aXaxis_position;
py -= dy;
m_Pos.y = py;
}
示例6: elemrect
void ProgressBar::OnRender(suic::DrawingContext * drawing)
{
// 先绘制背景
suic::Rect elemrect(0, 0, RenderSize().cx, RenderSize().cy);
suic::TriggerPtr trg(suic::UIRender::GetTriggerByStatus(this, GetStyle()));
suic::UIRender::DrawBackground(drawing, trg, &elemrect);
//
// 绘制进度条状态
//
suic::ImageBrushPtr bkgnd(trg->GetValue(_T("Thumb")));
if (bkgnd)
{
suic::Rect rcdraw(elemrect);
// 水平
if (GetOrientation() == CoreFlags::Horizontal)
{
LONG iOff = (LONG)((GetValue() - Minimum()) * (double)(rcdraw.right - rcdraw.left) / (Maximum() - Minimum()));
rcdraw.right = rcdraw.left + iOff;
}
else
{
LONG iOff = (LONG)((double)(rcdraw.bottom - rcdraw.top) * (GetValue() - Minimum()) / (Maximum() - Minimum()));
rcdraw.top = rcdraw.bottom - iOff;
}
if (!rcdraw.Empty())
{
bkgnd->Draw(drawing, &rcdraw);
}
}
suic::UIRender::DrawText(drawing, GetText(), trg, &elemrect
, GetHorizontalContentAlignment(), GetVerticalContentAlignment());
}
示例7: orderVertices
void
AngularlyOrderedGraph::Initialize(vector<Vertex<FragmentInfo>*>& v,
vector<ContourEQW>& contours,
FragmentInfo& start,
FragmentInfo& end)
{
for(int i=0; i<vertices.size(); ++i)
{
delete vertices[i];
}
vertices.clear();
for(int i=0; i<v.size(); ++i)
{
Vertex<FragmentInfo>* u = new Vertex<FragmentInfo>(v[i]->key);
*u = *(v[i]);
vertices.push_back(u);
}
vertices = orderVertices(vertices, contours, click);
source = findVertex(vertices, start);
assert(source);
dest = findVertex(vertices, end);
assert(dest);
if(GetOrientation(start, end, click, contours)==false)
{
swap(source, dest);
}
vertices = arrangeVertices(vertices, source);
for(int i=0; i<vertices.size(); ++i)
{
vertices[i]->Reset();
}
source->d = 0;
iter = 1;
}
示例8: GetOrientation
void AreaTrigger::UpdatePolygonOrientation()
{
float newOrientation = GetOrientation();
// No need to recalculate, orientation didn't change
if (G3D::fuzzyEq(_previousCheckOrientation, newOrientation))
return;
_polygonVertices.assign(GetTemplate()->PolygonVertices.begin(), GetTemplate()->PolygonVertices.end());
float angleSin = std::sin(newOrientation);
float angleCos = std::cos(newOrientation);
// This is needed to rotate the vertices, following orientation
for (Position& vertice : _polygonVertices)
{
float x = vertice.GetPositionX() * angleCos - vertice.GetPositionY() * angleSin;
float y = vertice.GetPositionY() * angleCos + vertice.GetPositionX() * angleSin;
vertice.Relocate(x, y);
}
_previousCheckOrientation = newOrientation;
}
示例9: InternalInit
void ScrollBar::InternalInit()
{
if (GetOrientation() == CoreFlags::Horizontal)
{
if (GetHeight() > 0)
{
_decreaseBtn.SetWidth(GetHeight());
_decreaseBtn.SetHeight(GetHeight());
_increaseBtn.SetWidth(GetHeight());
_increaseBtn.SetHeight(GetHeight());
}
}
else
{
if (GetWidth() > 0)
{
_decreaseBtn.SetWidth(GetWidth());
_decreaseBtn.SetHeight(GetWidth());
_increaseBtn.SetWidth(GetWidth());
_increaseBtn.SetHeight(GetWidth());
}
}
}
示例10: VALUES
void GameObject::SaveToDB()
{
std::stringstream ss;
ss << "REPLACE INTO gameobject_spawns VALUES("
<< ((m_spawn == NULL) ? 0 : m_spawn->id) << ","
<< GetEntry() << ","
<< GetMapId() << ","
<< GetPositionX() << ","
<< GetPositionY() << ","
<< GetPositionZ() << ","
<< GetOrientation() << ","
<< GetUInt64Value(GAMEOBJECT_ROTATION) << ","
<< GetFloatValue(GAMEOBJECT_PARENTROTATION) << ","
<< GetFloatValue(GAMEOBJECT_PARENTROTATION + 2) << ","
<< GetFloatValue(GAMEOBJECT_PARENTROTATION + 3) << ","
<< ( GetByte(GAMEOBJECT_BYTES_1, 0)? 1 : 0 ) << ","
<< GetUInt32Value(GAMEOBJECT_FLAGS) << ","
<< GetUInt32Value(GAMEOBJECT_FACTION) << ","
<< GetFloatValue(OBJECT_FIELD_SCALE_X) << ","
<< m_phaseMode << ","
<< m_phaseMode << ")";
WorldDatabase.Execute(ss.str().c_str());
}
示例11: GetPosition
void D_PAD::Flip( const wxPoint& aCentre )
{
int y = GetPosition().y;
MIRROR( y, aCentre.y ); // invert about x axis.
SetY( y );
MIRROR( m_Pos0.y, 0 );
MIRROR( m_Offset.y, 0 );
MIRROR( m_DeltaSize.y, 0 );
SetOrientation( -GetOrientation() );
// flip pads layers
// PADS items are currently on all copper layers, or
// currently, only on Front or Back layers.
// So the copper layers count is not taken in account
SetLayerSet( FlipLayerMask( m_layerMask ) );
// Flip the basic shapes, in custom pads
FlipPrimitives();
// m_boundingRadius = -1; the shape has not been changed
}
示例12: size
suic::Size ScrollBar::MeasureOverride(const suic::Size& availableSize)
{
suic::Size size(availableSize);
//InternalInit();
_decreaseBtn.Measure(size);
_increaseBtn.Measure(size);
_thumb.Measure(size);
_decreasePage.Measure(size);
_increasePage.Measure(size);
if (GetOrientation() == CoreFlags::Horizontal)
{
size.cy = _decreaseBtn.GetDesiredSize().cy;
}
else
{
size.cx = _decreaseBtn.GetDesiredSize().cx;
}
return size;
}
示例13: switch
void Node::Translate(const Vector3& delta, TransformSpace space)
{
switch (space)
{
case TS_LOCAL:
// Note: local space translation disregards local scale for scale-independent movement speed
position_ += GetOrientation() * delta;
break;
case TS_PARENT:
position_ += delta;
break;
case TS_WORLD:
{
PNode parent = parent_.lock();
position_ += (parent == scene_.lock() || !parent) ? delta : Vector3(parent->GetGlobalModelInvMatrix() * Vector4(delta, 0.0f));
break;
}
}
MarkAsDirty();
}
示例14: OnKeyDown
void Slider::OnKeyDown(suic::KeyEventArg& e)
{
if (GetOrientation() == CoreFlags::Horizontal)
{
if (e.IsLeftArrow())
{
if (GetValue() > Minimum())
{
SetValue((int)GetValue() - 1);
}
}
else if (e.IsRightArrow())
{
if (GetValue() < Maximum())
{
SetValue((int)GetValue() + 1);
}
}
}
else
{
if (e.IsUpArrow())
{
if (GetValue() > Minimum())
{
SetValue((int)GetValue() - 1);
}
}
else if (e.IsDownArrow())
{
if (GetValue() < Maximum())
{
SetValue((int)GetValue() + 1);
}
}
}
}
示例15: RemoveFromWorld
void Transporter::TeleportTransport(uint32 newMapid, uint32 oldmap, float x, float y, float z)
{
//sEventMgr.RemoveEvents(this, EVENT_TRANSPORTER_NEXT_WAYPOINT);
RemoveFromWorld(false);
SetMapId(newMapid);
SetPosition(x, y, z, m_position.o, false);
AddToWorld();
WorldPacket packet(SMSG_TRANSFER_PENDING, 12);
packet << newMapid;
packet << getEntry();
packet << oldmap;
for (auto passengerGuid : m_passengers)
{
auto passenger = objmgr.GetPlayer(passengerGuid);
if (passenger == nullptr)
continue;
passenger->GetSession()->SendPacket(&packet);
bool teleport_successful = passenger->Teleport(LocationVector(x, y, z, passenger->GetOrientation()), this->GetMapMgr());
if (!teleport_successful)
{
passenger->RepopAtGraveyard(passenger->GetPositionX(), passenger->GetPositionY(), passenger->GetPositionZ(), passenger->GetMapId());
}
else
{
if (!passenger->HasUnitMovementFlag(MOVEFLAG_TRANSPORT))
{
passenger->AddUnitMovementFlag(MOVEFLAG_TRANSPORT);
}
}
}
this->RespawnCreaturePassengers();
}