motionstates and needBroadphaseCollision

Please don't post Bullet support questions here, use the above forums instead.
digi12345
Posts: 13
Joined: Mon Aug 15, 2011 5:43 pm

motionstates and needBroadphaseCollision

Post by digi12345 »

Hi,

Is there a difference between setting the transform for the motionstate when creating the rigidbody and setting the motionstate after creating the rigidbody by doing the following:

rigidBody->setLinearVelocity( btVector3( 0, 0, 0 ) );
rigidBody->setAngularVelocity( btVector3( 0, 0, 0 ) );
rigidBody->setCenterOfMassTransform( startTransform );
btMotionState* motionState = rigidBody->getMotionState();
motionState->setWorldTransform( startTransform );

I found that if I set the motionstate transform after creating the rigidbody my "needBroadphaseCollision" callback method sometimes give me false positives.
Any thoughts or advice?

Thanks.