I created a btTriangleMeshShape and created a ridgidBody with it. When I simulate it, gravity seems to affect it, but when it hits the ground, it just sits there, it doesnt react to the collision in any way, even if if should fall over, it just sits there motionless. Other objects created with default CollisionShapes such as cube interact with the btTriangleShape, but not viceversa. The same code also works when exchanging the btTriangleMeshShape with a BoxCollisionShape or any other default one.
The code:
Code: Select all
btCollisionShape* trimeshShape = new btBvhTriangleMeshShape(trimesh, useQuantizedBvhTree);
btDefaultMotionState* MotionState =
new btDefaultMotionState(btTransform(btQuaternion(0.76018, 0.29322, 0.56229, 0.14134), btVector3(0, 60, 0)));
btScalar mass = 1;
btVector3 fallInertia(0, 0, 0);
trimeshShape->calculateLocalInertia(mass, fallInertia);
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(mass, MotionState, trimeshShape, fallInertia);
fallRigidBodyCI.m_linearDamping = 0.2f;
fallRigidBodyCI.m_angularDamping = 0.1f;
PhysicsBody = new btRigidBody(fallRigidBodyCI);