这篇教程C++ GetZ函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetZ函数的典型用法代码示例。如果您正苦于以下问题:C++ GetZ函数的具体用法?C++ GetZ怎么用?C++ GetZ使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetZ函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ASSERTvoid CUser::MoveProcess(Packet & pkt){ ASSERT(GetMap() != nullptr); if (m_bWarp || isDead()) return; uint16 will_x, will_z, will_y; int16 speed=0; float real_x, real_z, real_y; uint8 echo; pkt >> will_x >> will_z >> will_y >> speed >> echo; real_x = will_x/10.0f; real_z = will_z/10.0f; real_y = will_y/10.0f; if (!isGM()) { // TO-DO: Handle proper speed checks against server-side amounts. // We should also avoid relying on what the client has sent us. if (speed > 200) // What is the signifance of this number? Considering 90 is light feet... // We shouldn't be using magic numbers at all here. { Disconnect(); return; } } if (!GetMap()->IsValidPosition(real_x, real_z, real_y)) return; if (m_oldx != GetX() || m_oldz != GetZ()) { m_oldx = GetX(); m_oldy = GetY(); m_oldz = GetZ(); } // TO-DO: Ensure this is checked properly to prevent speedhacking SetPosition(real_x, real_y, real_z); if (RegisterRegion()) { g_pMain->RegionNpcInfoForMe(this); g_pMain->RegionUserInOutForMe(this); g_pMain->MerchantUserInOutForMe(this); } if (m_bInvisibilityType == INVIS_DISPEL_ON_MOVE) CMagicProcess::RemoveStealth(this, INVIS_DISPEL_ON_MOVE); Packet result(WIZ_MOVE); result << GetSocketID() << will_x << will_z << will_y << speed << echo; SendToRegion(&result); GetMap()->CheckEvent(real_x, real_z, this); result.Initialize(AG_USER_MOVE); result << GetSocketID() << m_curx << m_curz << m_cury << speed; Send_AIServer(&result);}
开发者ID:asis21,项目名称:koserver,代码行数:60,
示例2: GetZ//o--------------------------------------------------------------------------o//| Function - Cleanup( void )//| Date - 26th September, 2001//| Programmer - Abaddon//| Modified -//o--------------------------------------------------------------------------o//| Purpose - Makes sure that any items and chars inside the multi//| are removed//o--------------------------------------------------------------------------ovoid CMultiObj::Cleanup( void ){ for( CItem *iRemove = itemInMulti.First(); !itemInMulti.Finished(); iRemove = itemInMulti.Next() ) { if( ValidateObject( iRemove ) ) { ItemTypes iType = iRemove->GetType(); if( iType == IT_DOOR || iType == IT_LOCKEDDOOR || iType == IT_HOUSESIGN ) iRemove->Delete(); else { if( iRemove->IsLockedDown() ) iRemove->SetMovable( 1 ); iRemove->SetMulti( INVALIDSERIAL ); iRemove->SetZ( GetZ() ); } } } for( CChar *cRemove = charInMulti.First(); !charInMulti.Finished(); cRemove = charInMulti.Next() ) { if( ValidateObject( cRemove ) ) { cRemove->SetMulti( INVALIDSERIAL ); cRemove->SetZ( GetZ() ); } } CItem::Cleanup();}
开发者ID:bholtsclaw,项目名称:uox3,代码行数:37,
示例3: NaGeVector3D NaGeVector3D::operator * (const NaGeMatrix33 &M){ NaGeVector3D V; V.SetX(M(0,0)*GetX()+M(0,1)*GetY()+M(0,2)*GetZ()); V.SetY(M(1,0)*GetX()+M(1,1)*GetY()+M(1,2)*GetZ()); V.SetZ(M(2,0)*GetX()+M(2,1)*GetY()+M(2,2)*GetZ()); return V;}
开发者ID:cybaj,项目名称:NAK,代码行数:8,
示例4: GetZ bool BoundingBox::CollidesWith (const ICollidable& other) const { if (GetZ () >= other.GetZ () + other.GetH () || GetZ () + GetH () <= other.GetZ ()) return false; return spatial3Info_.GetRectangle ().intersects (other.GetRectangle ()); }
开发者ID:Noxalus,项目名称:YAPOG,代码行数:8,
示例5: CurrentPositionvoid Mob::CalculateNewFearpoint(){ if(RuleB(Pathing, Fear) && zone->pathing) { int Node = zone->pathing->GetRandomPathNode(); VERTEX Loc = zone->pathing->GetPathNodeCoordinates(Node); ++Loc.z; VERTEX CurrentPosition(GetX(), GetY(), GetZ()); list<int> Route = zone->pathing->FindRoute(CurrentPosition, Loc); if(Route.size() > 0) { fear_walkto_x = Loc.x; fear_walkto_y = Loc.y; fear_walkto_z = Loc.z; curfp = true; mlog(PATHING__DEBUG, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); return; } mlog(PATHING__DEBUG, "No path found to selected node. Falling through to old fear point selection."); } int loop = 0; float ranx, rany, ranz; curfp = false; while (loop < 100) //Max 100 tries { int ran = 250 - (loop*2); loop++; ranx = GetX()+MakeRandomInt(0, ran-1)-MakeRandomInt(0, ran-1); rany = GetY()+MakeRandomInt(0, ran-1)-MakeRandomInt(0, ran-1); ranz = FindGroundZ(ranx,rany); if (ranz == -999999) continue; float fdist = ranz - GetZ(); if (fdist >= -12 && fdist <= 12 && CheckCoordLosNoZLeaps(GetX(),GetY(),GetZ(),ranx,rany,ranz)) { curfp = true; break; } } if (curfp) { fear_walkto_x = ranx; fear_walkto_y = rany; fear_walkto_z = ranz; } else //Break fear { BuffFadeByEffect(SE_Fear); }}
开发者ID:Vaion,项目名称:Server,代码行数:58,
|