Cleaned up/simplified construction of a btRigidBody

Fixed memoryleak in btOptimizedBvh (delete []m_contiguousNodes;)
Changed DemoApplication::localCreateRigidBody, so it adds the rigidbody to the btDynamicsWorld.
Added check for duplicate objects in world when adding.
Added assert to prevent setLinearVelocity on static rigidbodies
Added btCollisionFilterGroups to btBroadphaseProxy
removed duplicate 'btBroadphaseProxy*	m_broadphaseProxy;' in btRigidBody
This commit is contained in:
ejcoumans
2006-10-04 23:46:27 +00:00
parent d85ecfe5c2
commit 323a1046fd
18 changed files with 96 additions and 59 deletions

View File

@@ -91,7 +91,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
startTransform.setIdentity();
startTransform.setOrigin(btVector3(0,-4,0));
localCreateRigidBody(false,0,startTransform,new btBoxShape(btVector3(30,2,30)));
localCreateRigidBody(0.f,startTransform,new btBoxShape(btVector3(30,2,30)));
class MyConvexDecomposition : public ConvexDecomposition::ConvexDecompInterface
{
@@ -192,8 +192,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
btTransform trans;
trans.setIdentity();
trans.setOrigin(centroid);
btRigidBody* body = m_convexDemo->localCreateRigidBody(isDynamic, mass, trans,convexShape);
m_convexDemo->getDynamicsWorld()->addCollisionObject(body);
btRigidBody* body = m_convexDemo->localCreateRigidBody( mass, trans,convexShape);
mBaseCount+=result.mHullVcount; // advance the 'base index' counter.
@@ -237,7 +236,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
startTransform.setIdentity();
startTransform.setOrigin(btVector3(20,2,0));
localCreateRigidBody(isDynamic, mass, startTransform,convexShape);
localCreateRigidBody(mass, startTransform,convexShape);
}