コード例 #1
0
ファイル: triMeshApp.cpp プロジェクト: jdduke/Cinder
	virtual ~RigidObject() 
	{
		if(body->getMotionState())
			delete body->getMotionState();
		world->removeRigidBody(body);
		delete body;
	}
コード例 #2
0
ファイル: winBodiesApp.cpp プロジェクト: jdduke/Cinder
	virtual ~RigidObject() 
	{
		if(body)
		{
			if(body->getMotionState() != NULL)
				delete body->getMotionState();
	//		if(body->getCollisionShape() != NULL)
	//			delete body->getCollisionShape();
			world->removeRigidBody(body);
			delete body;
		}
	}
コード例 #3
0
ファイル: fracturebody.cpp プロジェクト: Anth5/vdrift
void FractureBody::clear(btDynamicsWorld& world)
{
	for (int i = 0; i < m_connections.size(); ++i)
	{
		btRigidBody* cb = m_connections[i].m_body;
		btAssert(!cb->getCollisionShape()->isCompound());
		if (cb->isInWorld())
		{
			world.removeRigidBody(cb);
		}
		delete cb->getCollisionShape();
		delete cb;
	}
	m_connections.clear();
}
コード例 #4
0
	virtual	~RagDoll ()
	{
		int i;

		// Remove all constraints
		for ( i = 0; i < JOINT_COUNT; ++i)
		{
			m_ownerWorld->removeConstraint(m_joints[i]);
			delete m_joints[i]; m_joints[i] = 0;
		}

		// Remove all bodies and shapes
		for ( i = 0; i < BODYPART_COUNT; ++i)
		{
			m_ownerWorld->removeRigidBody(m_bodies[i]);
			
			delete m_bodies[i]->getMotionState();

			delete m_bodies[i]; m_bodies[i] = 0;
			delete m_shapes[i]; m_shapes[i] = 0;
		}
	}