When I write the following code, the smulation runs as it should. Like this: http://waldeback.se/public/bulletproble ... ullet1.jpg
Code: Select all
...
btVector3 btinertia(inertia.x, inertia.y, inertia.z );
if( this->m_bDynamic ) { this->m_pCollisionShape->calculateLocalInertia(this->m_initialMass, btinertia); }
btRigidBody::btRigidBodyConstructionInfo rbInfo(this->m_initialMass, this->m_pMotionState, this->m_pCollisionShape, btinertia );
...
But if I change the code to the following, the objects refuses to rotate. Like this: http://waldeback.se/public/bulletproble ... ullet2.jpg
Code: Select all
...
btVector3 btinertia(inertia.x, inertia.y, inertia.z );
btVector3 btinertia2(inertia.x, inertia.y, inertia.z );
if( this->m_bDynamic ) { this->m_pCollisionShape->calculateLocalInertia(this->m_initialMass, btinertia); }
btRigidBody::btRigidBodyConstructionInfo rbInfo(this->m_initialMass, this->m_pMotionState, this->m_pCollisionShape, btinertia2 );
...
Best Regards
Johan
EDIT: I'm using bullet version 2.73