g_rigidBody = new btRigidBody( 1.0f, g_motionState, box, btVector3(0,0,0), btScalar(0), btScalar(0), btScalar(0.5), btScalar(1.0) );
You should provide a proper local inertia tensor, instead of btVector3(0,0,0) as 4th argument in btRigidBody constructor.
The sample code in Bullet uses the shape and mass to calculate the localInertia:
Code:
btRigidBody* DemoApplication::localCreateRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape)
{
//rigidbody is dynamic if and only if mass is non zero, otherwise static
bool isDynamic = (mass != 0.f);
btVector3 localInertia(0,0,0);
if (isDynamic)
shape->calculateLocalInertia(mass,localInertia);
//using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
#define USE_MOTIONSTATE 1
#ifdef USE_MOTIONSTATE
btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
btRigidBody* body = new btRigidBody(mass,myMotionState,shape,localInertia);
#else
btRigidBody* body = new btRigidBody(mass,startTransform,shape,localInertia);
#endif//
m_dynamicsWorld->addRigidBody(body);
return body;
}
Hope this helps,
Erwin