- Added btRigidBodyConstructionInfo, to make it easier to set individual setting (and leave other untouched) during rigid body construction.
This was harder using default arguments. Thanks Vangelis Kokkevis for pointing this out. - Fixed memoryleak in the ConstraintDemo and Raytracer demo. - fixed issue with clearing forces/gravity at the end of the stepSimulation, instead of during internalSingleStepSimulation. Thanks chunky for pointing this out: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1780 - Disabled additional damping in rigid body by default, but enable it in most demos. Set btRigidBodyConstructionInfo m_additionalDamping to true to enable this. - Removed obsolete QUICKPROF BEGIN/END_PROFILE, and enabled BT_PROFILE. Profiling is enabled by default (see Bullet/Demos/OpenGL/DemoApplication.cpp how to use this). User can switch off profiling by enabling define BT_NO_PROFILE in Bullet/src/btQuickprof.h.
This commit is contained in:
@@ -114,7 +114,6 @@ void ConstraintDemo::initPhysics()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//create a slider, using the generic D6 constraint
|
||||
{
|
||||
mass = 1.f;
|
||||
@@ -130,6 +129,7 @@ void ConstraintDemo::initPhysics()
|
||||
d6body0 = localCreateRigidBody( mass,trans,shape);
|
||||
d6body0->setActivationState(DISABLE_DEACTIVATION);
|
||||
btRigidBody* fixedBody1 = localCreateRigidBody(0,trans,0);
|
||||
m_dynamicsWorld->addRigidBody(fixedBody1);
|
||||
|
||||
btTransform frameInA, frameInB;
|
||||
frameInA = btTransform::getIdentity();
|
||||
@@ -154,8 +154,17 @@ ConstraintDemo::~ConstraintDemo()
|
||||
{
|
||||
//cleanup in the reverse order of creation/initialization
|
||||
|
||||
//remove the rigidbodies from the dynamics world and delete them
|
||||
int i;
|
||||
|
||||
//removed/delete constraints
|
||||
for (i=m_dynamicsWorld->getNumConstraints()-1; i>=0 ;i--)
|
||||
{
|
||||
btTypedConstraint* constraint = m_dynamicsWorld->getConstraint(i);
|
||||
m_dynamicsWorld->removeConstraint(constraint);
|
||||
delete constraint;
|
||||
}
|
||||
|
||||
//remove the rigidbodies from the dynamics world and delete them
|
||||
for (i=m_dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--)
|
||||
{
|
||||
btCollisionObject* obj = m_dynamicsWorld->getCollisionObjectArray()[i];
|
||||
@@ -168,6 +177,9 @@ ConstraintDemo::~ConstraintDemo()
|
||||
delete obj;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//delete collision shapes
|
||||
for (int j=0;j<m_collisionShapes.size();j++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user