When using either:
Code: Select all
rigidBody->setAngularFactor( btVector3( 0.0f, 1.0f, 0.0f ) );
Code: Select all
btVector3 tensor = rigidBody->getInvInertiaDiagLocal();
tensor.setX( 0.0f );
tensor.setZ( 0.0f );
rigidBody->setInvInertiaDiagLocal( tensor );
rigidBody->updateInertiaTensor();
Code: Select all
btVector3 position = it->rigidBody->getWorldTransform().getOrigin();
target.setY( position.getY() );
btVector3 localDir = ( target - position ).normalized();
btVector3 force = btVector3( localDir.getX() * 40.0f, 0.0f, localDir.getZ() * 40.0f );
it->rigidBody->applyCentralForce( force );
A video of the problem: http://www.youtube.com/watch?v=z7Y4NOktCfE
And without limiting to Y-axis rotation: http://www.youtube.com/watch?v=kJfXJKMYAR0
Just noticed I inadvertently added a soundtrack, lol. Let me know if more code helps, the setup is basically mimicking the helloworld example. The friction on the plane and box shapes is 1.0.