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:
@@ -81,8 +81,19 @@ class MyColladaConverter : public ColladaConverter
|
||||
btCollisionShape* shape)
|
||||
{
|
||||
|
||||
btRigidBody* body = m_demoApp->localCreateRigidBody(isDynamic, mass, startTransform,shape);
|
||||
m_demoApp->getDynamicsWorld()->addCollisionObject(body);
|
||||
if (!isDynamic && (mass != 0.f))
|
||||
{
|
||||
printf("Warning: non-dynamic objects needs to have zero mass!\n");
|
||||
mass = 0.f;
|
||||
}
|
||||
|
||||
if (isDynamic && (mass == 0.f))
|
||||
{
|
||||
printf("Warning: dynamic rigidbodies needs nonzero mass!\n");
|
||||
mass = 1.f;
|
||||
}
|
||||
|
||||
btRigidBody* body = m_demoApp->localCreateRigidBody(mass, startTransform,shape);
|
||||
return body;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user