本文整理汇总了C++中IEntitySystem::RemoveEntity方法的典型用法代码示例。如果您正苦于以下问题:C++ IEntitySystem::RemoveEntity方法的具体用法?C++ IEntitySystem::RemoveEntity怎么用?C++ IEntitySystem::RemoveEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntitySystem
的用法示例。
在下文中一共展示了IEntitySystem::RemoveEntity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Reset
//------------------------------------------------------------------------
void CVehicleDamageBehaviorDetachPart::Reset()
{
if (m_detachedEntityId)
{
for(TDetachedStatObjs::iterator ite = m_detachedStatObjs.begin(), end = m_detachedStatObjs.end(); ite != end; ++ite)
{
CVehiclePartBase *pPartBase = ite->first;
if(IStatObj *pStatObj = ite->second)
{
if(pPartBase)
{
pPartBase->SetStatObj(pStatObj);
}
pStatObj->Release();
}
}
m_detachedStatObjs.clear();
if(GetISystem()->IsSerializingFile() != 1)
{
IEntitySystem* pEntitySystem = gEnv->pEntitySystem;
pEntitySystem->RemoveEntity(m_detachedEntityId, true);
}
m_detachedEntityId = 0;
}
}
示例2: Destroy
//------------------------------------------------------------------------
void CInventory::Destroy()
{
//
//CryLog("%s::CInventory::Destroy()",GetEntity()->GetName());
//
if(!GetISystem()->IsSerializingFile())
{
IEntitySystem *pEntitySystem = gEnv->pEntitySystem;
IItemSystem *pItemSystem = gEnv->pGame->GetIGameFramework()->GetIItemSystem();
TInventoryVector deleteList = m_stats.slots;
for (TInventoryIt it = deleteList.begin(); it != deleteList.end(); ++it)
{
EntityId entityId = *it;
IItem *pItem = pItemSystem->GetItem(entityId);
if (pItem)
{
RemoveItemFromCategorySlot(pItem->GetEntityId());
pItem->RemoveOwnerAttachedAccessories();
pItem->AttachToHand(false);
pItem->AttachToBack(false);
pItem->SetOwnerId(0);
}
pEntitySystem->RemoveEntity(entityId);
}
}
Clear();
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:32,代码来源:Inventory.cpp
示例3: DeleteDynamicEntities
void CCheckpointSystem::DeleteDynamicEntities()
{
IEntitySystem *pEntitySystem = gEnv->pEntitySystem;
IEntityItPtr pIt = pEntitySystem->GetEntityIterator();
//////////////////////////////////////////////////////////////////////////
pIt->MoveFirst();
while (!pIt->IsEnd())
{
IEntity * pEntity = pIt->Next();
uint32 nEntityFlags = pEntity->GetFlags();
// Local player must not be deleted.
if (nEntityFlags & ENTITY_FLAG_LOCAL_PLAYER)
continue;
if (nEntityFlags & ENTITY_FLAG_SPAWNED)
pEntitySystem->RemoveEntity( pEntity->GetId() );
}
// Force deletion of removed entities.
pEntitySystem->DeletePendingEntities();
//////////////////////////////////////////////////////////////////////////
// Reset entity pools
pEntitySystem->GetIEntityPoolManager()->ResetPools(false);
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:25,代码来源:CheckPointSystem.cpp
示例4:
//------------------------------------------------------------------------
CVehicleActionEntityAttachment::~CVehicleActionEntityAttachment()
{
if(m_entityId)
{
IEntitySystem *pEntitySystem = gEnv->pEntitySystem;
assert(pEntitySystem);
pEntitySystem->RemoveEntity(m_entityId);
}
}
示例5: Reset
//------------------------------------------------------------------------
void CVehicleActionEntityAttachment::Reset()
{
if(m_entityId)
{
IEntitySystem *pEntitySystem = gEnv->pEntitySystem;
assert(pEntitySystem);
pEntitySystem->RemoveEntity(m_entityId);
}
SpawnEntity();
if(m_timer > 0.0f)
m_pVehicle->SetObjectUpdate(this, IVehicle::eVOU_NoUpdate);
m_timer = 0.0f;
}
示例6: CreateRope
//------------------------------------------------------------------------
EntityId CVehicleActionDeployRope::CreateRope(IPhysicalEntity* pLinkedEntity, const Vec3& highPos, const Vec3& lowPos)
{
IEntitySystem* pEntitySystem = gEnv->pEntitySystem;
assert(pEntitySystem);
char pRopeName[256];
_snprintf(pRopeName, 256, "%s_rope_%d", m_pVehicle->GetEntity()->GetName(), m_seatId);
pRopeName[sizeof(pRopeName)-1] = '\0';
SEntitySpawnParams params;
params.sName = pRopeName;
params.nFlags = ENTITY_FLAG_CLIENT_ONLY;
params.pClass = pEntitySystem->GetClassRegistry()->FindClass("RopeEntity");
IEntity* pRopeEntity = pEntitySystem->SpawnEntity(params, true);
if (!pRopeEntity)
return 0;
pRopeEntity->SetFlags(pRopeEntity->GetFlags() | ENTITY_FLAG_CASTSHADOW );
pRopeEntity->CreateProxy(ENTITY_PROXY_ROPE);
IEntityRopeProxy* pEntityRopeProxy = (IEntityRopeProxy*) pRopeEntity->GetProxy(ENTITY_PROXY_ROPE);
if (!pEntityRopeProxy)
{
pEntitySystem->RemoveEntity(pRopeEntity->GetId());
return 0;
}
IRopeRenderNode* pRopeNode = pEntityRopeProxy->GetRopeRendeNode();
assert(pRopeNode);
Vec3 ropePoints[2];
ropePoints[0] = highPos;
ropePoints[1] = lowPos;
IRopeRenderNode::SRopeParams m_ropeParams;
m_ropeParams.nFlags = IRopeRenderNode::eRope_CheckCollisinos | IRopeRenderNode::eRope_Smooth;
m_ropeParams.fThickness = 0.05f;
m_ropeParams.fAnchorRadius = 0.1f;
m_ropeParams.nNumSegments = 8;
m_ropeParams.nNumSides = 4;
m_ropeParams.nMaxSubVtx = 3;
m_ropeParams.nPhysSegments = 8;
m_ropeParams.mass = 1.0f;
m_ropeParams.friction = 2;
m_ropeParams.frictionPull = 2;
m_ropeParams.wind.Set(0,0,0);
m_ropeParams.windVariance = 0;
m_ropeParams.waterResistance = 0;
m_ropeParams.jointLimit = 0;
m_ropeParams.maxForce = 0;
m_ropeParams.airResistance = 0;
m_ropeParams.fTextureTileU = 1.0f;
m_ropeParams.fTextureTileV = 10.0f;
pRopeNode->SetParams(m_ropeParams);
pRopeNode->SetPoints(ropePoints, 2);
pRopeNode->SetEntityOwner(m_pVehicle->GetEntity()->GetId());
pRopeNode->LinkEndEntities(m_pVehicle->GetEntity()->GetPhysics(), NULL);
return pRopeEntity->GetId();
}