这篇教程C++ GetPositionZ函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetPositionZ函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPositionZ函数的具体用法?C++ GetPositionZ怎么用?C++ GetPositionZ使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetPositionZ函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SummonVehiclevoid Vehicle::InstallAccessory(uint32 entry, int8 seatId){ if(Unit *passenger = GetPassenger(seatId)) { // already installed if(passenger->GetEntry() == entry) return; passenger->ExitVehicle(); // this should not happen } const CreatureInfo *cInfo = objmgr.GetCreatureTemplate(entry); if(!cInfo) return; Creature *accessory; if(cInfo->VehicleId) accessory = SummonVehicle(entry, GetPositionX(), GetPositionY(), GetPositionZ()); else accessory = SummonCreature(entry, GetPositionX(), GetPositionY(), GetPositionZ()); if(!accessory) return; accessory->EnterVehicle(this, seatId); // This is not good, we have to send update twice accessory->SendMovementFlagUpdate();}
开发者ID:MilchBuby,项目名称:riboncore,代码行数:27,
示例2: GetOrientationvoid Transport::UpdateNPCPositions(){ for(CreatureSet::iterator itr = m_NPCPassengerSet.begin(); itr != m_NPCPassengerSet.end(); ++itr) { Creature* npc = *itr; float x, y, z, o; o = GetOrientation() + npc->m_movementInfo.t_pos.m_orientation; MapManager::NormalizeOrientation(o); x = GetPositionX() + (npc->m_movementInfo.t_pos.m_positionX * cos(GetOrientation()) + npc->m_movementInfo.t_pos.m_positionY * sin(GetOrientation() + M_PI)); y = GetPositionY() + (npc->m_movementInfo.t_pos.m_positionY * cos(GetOrientation()) + npc->m_movementInfo.t_pos.m_positionX * sin(GetOrientation())); z = GetPositionZ() + npc->m_movementInfo.t_pos.m_positionZ; npc->SetHomePosition(x, y, z, o); GetMap()->CreatureRelocation(npc, x, y, z, o, false); } for(PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end(); ++itr) { Player* plr = *itr; float x, y, z, o; o = GetOrientation() + plr->m_movementInfo.t_pos.m_orientation; MapManager::NormalizeOrientation(o); x = GetPositionX() + (plr->m_movementInfo.t_pos.m_positionX * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionY * sin(GetOrientation() + M_PI)); y = GetPositionY() + (plr->m_movementInfo.t_pos.m_positionY * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionX * sin(GetOrientation())); z = GetPositionZ() + plr->m_movementInfo.t_pos.m_positionZ; plr->Relocate(x, y, z, o); UpdateData transData; WorldPacket packet; transData.BuildPacket(&packet); plr->SendDirectMessage(&packet); }}
开发者ID:ahuraa,项目名称:ServerMythCore,代码行数:33,
示例3: GetPositionYvoid Enemy::Die(){ Plane::Die(); Effect* boom = Effect::Create("boom1"); boom->SetPosition(GetPositionX(), GetPositionY(), GetPositionZ()); boom->SetOrder(LAYER_ENEMY_BOOM); GetScene()->Add(boom); Effect* cool = Effect::Create("cool"); cool->SetColorRGB(rand() % 128 + 128, rand() % 128 + 128, rand() % 128 + 128); cool->ResetVertex(); cool->SetPosition(GetPositionX() + rand() % 21 - 10, GetPositionY() + rand() % 21 - 10, GetPositionZ()); cool->RunAction(Frame2D::Move::Create(2.5, GetPositionX() + 50, GetPositionY())); cool->SetOrder(LAYER_UI_1); GetScene()->Add(cool); // 如果有道具那么掉落道具 if (_itemID != 0) { Item* item = Item::Create(_itemID); item->SetPosition(GetPositionX(), GetPositionY(), GetPositionZ()); item->SetOrder(LAYER_ITEM); GetScene()->Add(item); _itemID = 0; }}
开发者ID:Jenovez,项目名称:Frame2D-old,代码行数:27,
示例4: GetTemplatevoid AreaTrigger::SearchUnitInBox(std::list<Unit*>& targetList){ float extentsX = GetTemplate()->BoxDatas.Extents[0]; float extentsY = GetTemplate()->BoxDatas.Extents[1]; float extentsZ = GetTemplate()->BoxDatas.Extents[2]; Trinity::AnyUnitInObjectRangeCheck check(this, GetTemplate()->MaxSearchRadius, false); Trinity::UnitListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(this, targetList, check); Cell::VisitAllObjects(this, searcher, GetTemplate()->MaxSearchRadius); float halfExtentsX = extentsX / 2.0f; float halfExtentsY = extentsY / 2.0f; float halfExtentsZ = extentsZ / 2.0f; float minX = GetPositionX() - halfExtentsX; float maxX = GetPositionX() + halfExtentsX; float minY = GetPositionY() - halfExtentsY; float maxY = GetPositionY() + halfExtentsY; float minZ = GetPositionZ() - halfExtentsZ; float maxZ = GetPositionZ() + halfExtentsZ; G3D::AABox const box({ minX, minY, minZ }, { maxX, maxY, maxZ }); targetList.remove_if([&box](Unit* unit) -> bool { return !box.contains({ unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ() }); });}
开发者ID:Rochet2,项目名称:TrinityCore,代码行数:30,
示例5: VALUESvoid GameObject::SaveToFile(std::stringstream & name){ std::stringstream ss; ss << "REPLACE INTO gameobject_spawns VALUES(" << ((m_spawn == NULL) ? 0 : m_spawn->id) << "," << GetEntry() << "," << GetMapId() << "," << GetPositionX() << "," << GetPositionY() << "," << GetPositionZ() << "," << GetOrientation() << "," << GetFloatValue(GAMEOBJECT_ROTATION) << "," << GetFloatValue(GAMEOBJECT_ROTATION_01) << "," << GetFloatValue(GAMEOBJECT_ROTATION_02) << "," << GetFloatValue(GAMEOBJECT_ROTATION_03) << "," << GetUInt32Value(GAMEOBJECT_STATE) << "," << GetUInt32Value(GAMEOBJECT_FLAGS) << "," << GetUInt32Value(GAMEOBJECT_FACTION) << "," << GetFloatValue(OBJECT_FIELD_SCALE_X) << "," << "0)"; FILE * OutFile; OutFile = fopen(name.str().c_str(), "wb"); if (!OutFile) return; fwrite(ss.str().c_str(),1,ss.str().size(),OutFile); fclose(OutFile);}
开发者ID:miklasiak,项目名称:projekt,代码行数:31,
示例6: DeleteFromDBvoid Corpse::SaveToDB(){ // prevent DB data inconsistence problems and duplicates SQLTransaction trans = CharacterDatabase.BeginTransaction(); DeleteFromDB(trans); uint16 index = 0; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE); stmt->setUInt32(index++, GetGUIDLow()); // corpseGuid stmt->setUInt32(index++, GUID_LOPART(GetOwnerGUID())); // guid stmt->setFloat (index++, GetPositionX()); // posX stmt->setFloat (index++, GetPositionY()); // posY stmt->setFloat (index++, GetPositionZ()); // posZ stmt->setFloat (index++, GetOrientation()); // orientation stmt->setUInt16(index++, GetMapId()); // mapId stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_DISPLAY_ID)); // displayId stmt->setString(index++, _ConcatFields(CORPSE_FIELD_ITEMS, EQUIPMENT_SLOT_END)); // itemCache stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_SKIN_ID)); // bytes1 stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_FACIAL_HAIR_STYLE_ID)); // bytes2 stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_FLAGS)); // flags stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS)); // dynFlags stmt->setUInt32(index++, uint32(m_time)); // time stmt->setUInt8 (index++, GetType()); // corpseType stmt->setUInt32(index++, GetInstanceId()); // instanceId stmt->setUInt32(index++, GetPhaseMask()); // phaseMask trans->Append(stmt); CharacterDatabase.CommitTransaction(trans);}
开发者ID:Ayik0,项目名称:DeathCore_5.4.8,代码行数:29,
示例7: SetInstanceIdbool Corpse::Create(uint32 guidlow, Player *owner){ SetInstanceId(owner->GetInstanceId()); WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetMapId()); Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation()); if (!IsPositionValid()) { sLog.outLog(LOG_DEFAULT, "ERROR: Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow,owner->GetName(),owner->GetPositionX(), owner->GetPositionY()); return false; } SetFloatValue(OBJECT_FIELD_SCALE_X, 1); SetFloatValue(CORPSE_FIELD_POS_X, GetPositionX()); SetFloatValue(CORPSE_FIELD_POS_Y, GetPositionY()); SetFloatValue(CORPSE_FIELD_POS_Z, GetPositionZ()); SetFloatValue(CORPSE_FIELD_FACING, GetOrientation()); SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID()); m_grid = Hellground::ComputeGridPair(GetPositionX(), GetPositionY()); return true;}
开发者ID:Blumfield,项目名称:ptc2,代码行数:26,
示例8: DeleteFromDBvoid Corpse::SaveToDB(){ // prevent DB data inconsistence problems and duplicates RealmDataDatabase.BeginTransaction(); DeleteFromDB(); static SqlStatementID saveCorpse; SqlStatement stmt = RealmDataDatabase.CreateStatement(saveCorpse, "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,data,time,corpse_type,instance) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); stmt.addUInt64(GetGUIDLow()); stmt.addUInt64(GUID_LOPART(GetOwnerGUID())); stmt.addFloat(GetPositionX()); stmt.addFloat(GetPositionY()); stmt.addFloat(GetPositionZ()); stmt.addFloat(GetOrientation()); stmt.addUInt32(GetZoneId()); stmt.addUInt32(GetMapId()); stmt.addString(GetUInt32ValuesString()); stmt.addUInt64(m_time); stmt.addUInt32(GetType()); stmt.addInt32(GetInstanceId()); stmt.Execute(); RealmDataDatabase.CommitTransaction();}
开发者ID:Blumfield,项目名称:ptc2,代码行数:25,
示例9: MANGOS_ASSERTvoid Corpse::SaveToDB(){ // bones should not be saved to DB (would be deleted on startup anyway) MANGOS_ASSERT(GetType() != CORPSE_BONES); // prevent DB data inconsistence problems and duplicates CharacterDatabase.BeginTransaction(); DeleteFromDB(); std::ostringstream ss; ss << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,data,time,corpse_type,instance) VALUES (" << GetGUIDLow() << ", " << GUID_LOPART(GetOwnerGUID()) << ", " << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", " << GetOrientation() << ", " << GetZoneId() << ", " << GetMapId() << ", '"; for(uint16 i = 0; i < m_valuesCount; ++i) ss << GetUInt32Value(i) << " "; ss << "'," << uint64(m_time) <<", " << uint32(GetType()) << ", " << int(GetInstanceId()) << ")"; CharacterDatabase.Execute( ss.str().c_str() ); CharacterDatabase.CommitTransaction();}
开发者ID:Scergo,项目名称:zero,代码行数:28,
示例10: DeleteFromDBvoid Corpse::SaveToDB(){ // prevent DB data inconsistence problems and duplicates CharacterDatabase.BeginTransaction(); DeleteFromDB(); std::ostringstream ss; ss << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,data,time,corpse_type,instance,phaseMask) VALUES (" << GetGUIDLow() << ", " << GUID_LOPART(GetOwnerGUID()) << ", " << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", " << GetOrientation() << ", " << GetZoneId() << ", " << GetMapId() << ", '"; for (uint16 i = 0; i < m_valuesCount; ++i) ss << GetUInt32Value(i) << " "; ss << "'," << uint64(m_time) <<", " << uint32(GetType()) << ", " << int(GetInstanceId()) << ", " << uint16(GetPhaseMask()) << ")"; // prevent out of range error CharacterDatabase.Execute(ss.str().c_str()); CharacterDatabase.CommitTransaction();}
开发者ID:Elevim,项目名称:RG-332,代码行数:26,
示例11: GetPositionXvoid Position::RelocateOffset(const Position & offset){ m_positionX = GetPositionX() + (offset.GetPositionX() * std::cos(GetOrientation()) + offset.GetPositionY() * std::sin(GetOrientation() + float(M_PI))); m_positionY = GetPositionY() + (offset.GetPositionY() * std::cos(GetOrientation()) + offset.GetPositionX() * std::sin(GetOrientation())); m_positionZ = GetPositionZ() + offset.GetPositionZ(); SetOrientation(GetOrientation() + offset.GetOrientation());}
开发者ID:beyourself,项目名称:DeathCore_6.x,代码行数:7,
示例12: GetPositionXbool Position::IsWithinBox(const Position& center, float xradius, float yradius, float zradius) const{ // rotate the WorldObject position instead of rotating the whole cube, that way we can make a simplified // is-in-cube check and we have to calculate only one point instead of 4 // 2PI = 360*, keep in mind that ingame orientation is counter-clockwise double rotation = 2 * M_PI - center.GetOrientation(); double sinVal = std::sin(rotation); double cosVal = std::cos(rotation); float BoxDistX = GetPositionX() - center.GetPositionX(); float BoxDistY = GetPositionY() - center.GetPositionY(); float rotX = float(center.GetPositionX() + BoxDistX * cosVal - BoxDistY*sinVal); float rotY = float(center.GetPositionY() + BoxDistY * cosVal + BoxDistX*sinVal); // box edges are parallel to coordiante axis, so we can treat every dimension independently :D float dz = GetPositionZ() - center.GetPositionZ(); float dx = rotX - center.GetPositionX(); float dy = rotY - center.GetPositionY(); if ((std::fabs(dx) > xradius) || (std::fabs(dy) > yradius) || (std::fabs(dz) > zradius)) return false; return true;}
开发者ID:Declipe,项目名称:ElunaTrinityWotlk,代码行数:27,
示例13: GetPositionXvoid Creature::GetRespawnPosition(float &x, float &y, float &z, float* ori, float* dist) const{ if (m_DBTableGuid) { if (CreatureData const* data = sObjectMgr->GetCreatureData(GetDBTableGUIDLow())) { x = data->posX; y = data->posY; z = data->posZ; if (ori) *ori = data->orientation; if (dist) *dist = data->spawndist; return; } } x = GetPositionX(); y = GetPositionY(); z = GetPositionZ(); if (ori) *ori = GetOrientation(); if (dist) *dist = 0;}
开发者ID:Expery,项目名称:Core,代码行数:28,
示例14: GetPositionXvoid Transport::UpdatePassengerPositions(){ for (UnitSet::iterator itr = _passengers.begin(); itr != _passengers.end(); ++itr) { Unit* passenger = *itr; // transport teleported but passenger not yet (can happen for players) if (passenger->GetMap() != GetMap()) continue; float x = GetPositionX() + (passenger->m_movementInfo.t_pos.m_positionX * cos(GetOrientation()) + passenger->m_movementInfo.t_pos.m_positionY * sin(GetOrientation() + M_PI)); float y = GetPositionY() + (passenger->m_movementInfo.t_pos.m_positionY * cos(GetOrientation()) + passenger->m_movementInfo.t_pos.m_positionX * sin(GetOrientation())); float z = GetPositionZ() + passenger->m_movementInfo.t_pos.m_positionZ; float o = GetOrientation() + passenger->m_movementInfo.t_pos.m_orientation; MapManager::NormalizeOrientation(o); switch (passenger->GetTypeId()) { case TYPEID_UNIT: passenger->ToCreature()->SetHomePosition(x, y, z, o); GetMap()->CreatureRelocation(passenger->ToCreature(), x, y, z, o, false); break; case TYPEID_PLAYER: GetMap()->PlayerRelocation(passenger->ToPlayer(), x, y, z, o); break; } if (passenger->IsVehicle()) passenger->GetVehicleKit()->RelocatePassengers(x, y, z, o); }}
开发者ID:Devilcleave,项目名称:TrilliumEMU,代码行数:28,
示例15: GetPositionXvoid SpriteGroup::Render(){ Element::Render(); for (int i = 0; i < m_sprite_list.size(); ++i) { Sprite* sprite = m_sprite_list.at(i); sprite->Render(); sprite->SetPosition( sprite->GetPositionX() - GetPositionX(), sprite->GetPositionY() - GetPositionY(), sprite->GetPositionZ() - GetPositionZ()); sprite->SetAngle( sprite->GetAngleX() - GetAngleX(), sprite->GetAngleY() - GetAngleY(), sprite->GetAngleZ() - GetAngleZ()); sprite->SetAnchor( sprite->GetAnchorX() * 2.0f - GetAnchorX(), sprite->GetAnchorY() * 2.0f - GetAnchorY()); if (GetScaleX() != 0) { sprite->SetScaleX(sprite->GetScaleX() / GetScaleX()); } if (GetScaleY() != 0) { sprite->SetScaleY(sprite->GetScaleY() / GetScaleY()); } }}
开发者ID:Jenovez,项目名称:Frame2D-old,代码行数:33,
示例16: DeleteFromDBvoid Corpse::SaveToDB(){ // prevent DB data inconsistence problems and duplicates SQLTransaction trans = CharacterDatabase.BeginTransaction(); DeleteFromDB(trans); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE); stmt->setUInt32(0, GetGUIDLow()); // corpseGuid stmt->setUInt32(1, GUID_LOPART(GetOwnerGUID())); // guid stmt->setFloat (2, GetPositionX()); // posX stmt->setFloat (3, GetPositionY()); // posY stmt->setFloat (4, GetPositionZ()); // posZ stmt->setFloat (5, GetOrientation()); // orientation stmt->setUInt16(6, GetMapId()); // mapId stmt->setUInt32(7, GetUInt32Value(CORPSE_FIELD_DISPLAY_ID)); // displayId stmt->setString(8, _ConcatFields(CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END)); // itemCache stmt->setUInt32(9, GetUInt32Value(CORPSE_FIELD_BYTES_1)); // bytes1 stmt->setUInt32(10, GetUInt32Value(CORPSE_FIELD_BYTES_2)); // bytes2 stmt->setUInt32(11, GetUInt32Value(CORPSE_FIELD_GUILD)); // guildId stmt->setUInt8 (12, GetUInt32Value(CORPSE_FIELD_FLAGS)); // flags stmt->setUInt8 (13, GetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS)); // dynFlags stmt->setUInt32(14, uint32(m_time)); // time stmt->setUInt8 (15, GetType()); // corpseType stmt->setUInt32(16, GetInstanceId()); // instanceId stmt->setUInt16(17, GetPhaseMask()); // phaseMask trans->Append(stmt); CharacterDatabase.CommitTransaction(trans);}
开发者ID:kmN666,项目名称:Leroy,代码行数:29,
示例17: MANGOS_ASSERTvoid Corpse::SaveToDB(){ // bones should not be saved to DB (would be deleted on startup anyway) MANGOS_ASSERT(GetType() != CORPSE_BONES); // prevent DB data inconsistence problems and duplicates CharacterDatabase.BeginTransaction(); DeleteFromDB(); std::ostringstream ss; ss << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,map,time,corpse_type,instance,phaseMask) VALUES (" << GetGUIDLow() << ", " << GetOwnerGuid().GetCounter() << ", " << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", " << GetOrientation() << ", " << GetMapId() << ", " << uint64(m_time) << ", " << uint32(GetType()) << ", " << int(GetInstanceId()) << ", " << uint16(GetPhaseMask()) << ")"; // prevent out of range error CharacterDatabase.Execute(ss.str().c_str()); CharacterDatabase.CommitTransaction();}
开发者ID:krullgor,项目名称:mangos-wotlk,代码行数:25,
示例18: checkvoid AreaTrigger::SearchUnitInCylinder(std::list<Unit*>& targetList){ Trinity::AnyUnitInObjectRangeCheck check(this, GetTemplate()->MaxSearchRadius, false); Trinity::UnitListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(this, targetList, check); Cell::VisitAllObjects(this, searcher, GetTemplate()->MaxSearchRadius); float height = GetTemplate()->CylinderDatas.Height; float minZ = GetPositionZ() - height; float maxZ = GetPositionZ() + height; targetList.remove_if([minZ, maxZ](Unit* unit) -> bool { return unit->GetPositionZ() < minZ || unit->GetPositionZ() > maxZ; });}
开发者ID:Rochet2,项目名称:TrinityCore,代码行数:16,
示例19: DeleteFromDBvoid Corpse::SaveToDB(){ // prevent DB data inconsistence problems and duplicates SQLTransaction trans = CharacterDatabase.BeginTransaction(); DeleteFromDB(trans); std::ostringstream ss; ss << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,displayId,itemCache,bytes1,bytes2,guild,flags,dynFlags,time,corpse_type,instance,phaseMask) VALUES (" << GetGUIDLow() << ", " << GUID_LOPART(GetOwnerGUID()) << ", " << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", " << GetOrientation() << ", " << GetZoneId() << ", " << GetMapId() << ", " << GetUInt32Value(CORPSE_FIELD_DISPLAY_ID) << ", '"; for (uint16 i = 0; i < EQUIPMENT_SLOT_END; ++i) ss << GetUInt32Value(CORPSE_FIELD_ITEM+i) << " "; ss << "', " << GetUInt32Value(CORPSE_FIELD_BYTES_1) << ", " << GetUInt32Value(CORPSE_FIELD_BYTES_2) << ", " << GetUInt32Value(CORPSE_FIELD_GUILD) << ", " << GetUInt32Value(CORPSE_FIELD_FLAGS) << ", " << GetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS) << ", " << uint64(m_time) << ", " << uint32(GetType()) << ", " << int(GetInstanceId()) << ", " << uint16(GetPhaseMask()) << ")"; // prevent out of range error trans->Append(ss.str().c_str()); CharacterDatabase.CommitTransaction(trans);}
开发者ID:ice74,项目名称:blizzwow,代码行数:32,
示例20: GetPositionYvoid DynamicObject::DealWithSpellDamage(Player &caster){ uint32 runtimes=1; if(deleteThis) runtimes=m_DamageMaxTimes-m_DamageCurTimes; for(int i=0; i<runtimes; i++) { UnitList.clear(); MapManager::Instance().GetMap(m_mapId)->GetUnitList(GetPositionX(), GetPositionY(),UnitList); for(std::list<Unit*>::iterator iter=UnitList.begin(); iter!=UnitList.end(); iter++) { if((*iter)) { if( (*iter)->isAlive() ) { if(_CalcDistance(GetPositionX(),GetPositionY(),GetPositionZ(),(*iter)->GetPositionX(),(*iter)->GetPositionY(),(*iter)->GetPositionZ()) < m_PeriodicDamageRadius && (*iter)->GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE) != caster.GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE)) { caster.PeriodicAuraLog((*iter),m_spell->Id,m_PeriodicDamage,m_spell->School); } } } } m_DamageCurTimes++; }}
开发者ID:Artea,项目名称:mangos-svn,代码行数:26,
示例21: GetOrientation//! This method transforms supplied transport offsets into global coordinatesvoid Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o){ float inx = x, iny = y, inz = z, ino = o; o = GetOrientation() + ino; x = GetPositionX() + (inx * cos(GetOrientation()) + iny * sin(GetOrientation() + M_PI)); y = GetPositionY() + (iny * cos(GetOrientation()) + inx * sin(GetOrientation())); z = GetPositionZ() + inz;}
开发者ID:CashCZ,项目名称:TrinityCore,代码行数:9,
示例22: GetOrientationvoid Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o) const{ float inx = x, iny = y, inz = z, ino = o; o = GetOrientation() + ino; x = GetPositionX() + inx * std::cos(GetOrientation()) - iny * std::sin(GetOrientation()); y = GetPositionY() + iny * std::cos(GetOrientation()) + inx * std::sin(GetOrientation()); z = GetPositionZ() + inz;}
开发者ID:Exodius,项目名称:chuspi,代码行数:8,
示例23: GetCreatureAddonvoid Vehicle::InstallAllAccessories(){ if(!GetMap()) return; CreatureDataAddon const *cainfo = GetCreatureAddon(); if(!cainfo || !cainfo->passengers) return; for (CreatureDataAddonPassengers const* cPassanger = cainfo->passengers; cPassanger->seat_idx != -1; ++cPassanger) { // Continue if seat already taken if(GetPassenger(cPassanger->seat_idx)) continue; uint32 guid = 0; bool isVehicle = false; // Set guid and check whatever it is if(cPassanger->guid != 0) guid = cPassanger->guid; else { CreatureDataAddon const* passAddon; passAddon = ObjectMgr::GetCreatureTemplateAddon(cPassanger->entry); if(passAddon && passAddon->vehicle_id != 0) isVehicle = true; else guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT); } // Create it Creature *pPassenger = new Creature; if(!isVehicle) { uint32 entry = cPassanger->entry; if(entry == 0) { CreatureData const* data = sObjectMgr.GetCreatureData(guid); if(!data) continue; entry = data->id; } if(!pPassenger->Create(guid, GetMap(), GetPhaseMask(), entry, 0)) continue; pPassenger->LoadFromDB(guid, GetMap()); pPassenger->Relocate(GetPositionX(), GetPositionY(), GetPositionZ()); GetMap()->Add(pPassenger); pPassenger->AIM_Initialize(); } else pPassenger = (Creature*)SummonVehicle(cPassanger->entry, GetPositionX(), GetPositionY(), GetPositionZ(), 0); // Enter vehicle... pPassenger->EnterVehicle(this, cPassanger->seat_idx, true); // ...and send update. Without this, client wont show this new creature/vehicle... WorldPacket data; pPassenger->BuildHeartBeatMsg(&data); pPassenger->SendMessageToSet(&data, false); }}
开发者ID:sc0rpio0o,项目名称:diamondcore,代码行数:58,
示例24: GetMapuint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim){ Map* map = GetMap(); CreatureInfo const *ci = sObjectMgr.GetCreatureTemplate(entry); if (!ci) return 0; Creature* pCreature = NULL; if(ci->ScriptID) pCreature = sScriptMgr.GetCreatureScriptedClass(ci->ScriptID); if(pCreature == NULL) pCreature = new Creature(); if (!pCreature->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0)) { delete pCreature; return 0; } pCreature->SetTransport(this); pCreature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); pCreature->m_movementInfo.guid = GetGUID(); pCreature->m_movementInfo.t_pos.Relocate(x, y, z, o); if (anim) pCreature->SetUInt32Value(UNIT_NPC_EMOTESTATE, anim); pCreature->Relocate( GetPositionX() + (x * cos(GetOrientation()) + y * sin(GetOrientation() + float(M_PI))), GetPositionY() + (y * cos(GetOrientation()) + x * sin(GetOrientation())), z + GetPositionZ() , o + GetOrientation()); pCreature->SetHomePosition(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ(), pCreature->GetOrientation()); if(!pCreature->IsPositionValid()) { sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); delete pCreature; return 0; } map->Add(pCreature); m_NPCPassengerSet.insert(pCreature); if (tguid == 0) { ++currenttguid; tguid = currenttguid; } else currenttguid = std::max(tguid, currenttguid); pCreature->SetGUIDTransport(tguid); sScriptMgr.OnAddCreaturePassenger(this, pCreature); return tguid;}
开发者ID:BuloZB,项目名称:SkyFireEMU,代码行数:58,
示例25: assertvoid Vehicle::RellocatePassengers(Map *map){ if (m_Seats.empty()) return; for(SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) { if(itr->second.flags & SEAT_FULL) { // passenger cant be NULL here Unit *passengers = itr->second.passenger; assert(passengers); float xx = GetPositionX() + passengers->m_movementInfo.GetTransportPos()->x; float yy = GetPositionY() + passengers->m_movementInfo.GetTransportPos()->y; float zz = GetPositionZ() + passengers->m_movementInfo.GetTransportPos()->z; //float oo = passengers->m_SeatData.Orientation; // this is not correct, we should recalculate // actual rotation depending on vehicle float oo = passengers->GetOrientation(); if(passengers->GetTypeId() == TYPEID_PLAYER) ((Player*)passengers)->SetPosition(xx, yy, zz, oo); else map->CreatureRelocation((Creature*)passengers, xx, yy, zz, oo); } else if(itr->second.flags & (SEAT_VEHICLE_FULL | SEAT_VEHICLE_FREE)) { // passenger cant be NULL here Unit *passengers = itr->second.passenger; assert(passengers); float xx = GetPositionX() + passengers->m_movementInfo.GetTransportPos()->x; float yy = GetPositionY() + passengers->m_movementInfo.GetTransportPos()->y; float zz = GetPositionZ() + passengers->m_movementInfo.GetTransportPos()->z; //float oo = passengers->m_SeatData.Orientation; // this is not correct, we should recalculate // actual rotation depending on vehicle float oo = passengers->GetOrientation(); map->CreatureRelocation((Creature*)passengers, xx, yy, zz, oo); } }}
开发者ID:marx123,项目名称:core,代码行数:44,
示例26: GetPositionXvoid Transport::CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const{ float inx = x, iny = y, inz = z; if (o) *o = Position::NormalizeOrientation(GetOrientation() + *o); x = GetPositionX() + inx * std::cos(GetOrientation()) - iny * std::sin(GetOrientation()); y = GetPositionY() + iny * std::cos(GetOrientation()) + inx * std::sin(GetOrientation()); z = GetPositionZ() + inz;}
开发者ID:mynew2,项目名称:Gunship,代码行数:10,
注:本文中的GetPositionZ函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetPrim函数代码示例 C++ GetPositionY函数代码示例 |