本文整理汇总了C++中Physics::removePhysicsObject方法的典型用法代码示例。如果您正苦于以下问题:C++ Physics::removePhysicsObject方法的具体用法?C++ Physics::removePhysicsObject怎么用?C++ Physics::removePhysicsObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Physics
的用法示例。
在下文中一共展示了Physics::removePhysicsObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
ArticulatedPhysicsEntity::~ArticulatedPhysicsEntity()
{
SimplePhysicsEntity* entity;
unsigned entityId;
unsigned rigidBodyIndex, entityIndex;
std::map<unsigned, unsigned>::iterator it;
Physics* physics = (Physics*)SystemCore::getModuleByName("Physics");
if (physics && articulatedBody->isAddedToSimulation())
physics->removePhysicsObject(this);
// Clear rigidBody-Pointer in SimplePhysicsEntity
for (it = rigidBodyMapping.begin(); it != rigidBodyMapping.end(); ++it)
{
rigidBodyIndex = (*it).first;
entityIndex = (*it).second;
entityId = this->environmentBasedId + entityIndex;
entity = (SimplePhysicsEntity*)WorldDatabase::getEntityWithEnvironmentId(entityId);
if (entity)
entity->rigidBody = NULL;
} // for
delete articulatedBody;
} // ~ArticulatedPhysicsEntity
示例2:
CursorSpringConnector::~CursorSpringConnector()
{
Physics* physicsModule;
physicsModule = (Physics*)SystemCore::getModuleByName("Physics");
if (physicsModule) {
physicsModule->removePhysicsObject(this);
physicsModule->removeSimulationStepListener(this);
physicsModule->removeSystemThreadListener(this);
} // if
} // ~CursorSpringConnector