btCompoundShape and COM

jiversen
Posts: 7
Joined: Tue Nov 04, 2008 4:27 pm

btCompoundShape and COM

Post by jiversen »

Hi there,

I'm a little confused by the behaviour of btCompoundShape. If I add a single ChildShape with the COM at identity, should I get the same behaviour as any other shape (eg, btGImpactShape).


ie, I expected the same results from both of these code snippets:

Code: Select all

fallShape = new btSphereShape( 1.0f );
btCompoundShape* compoundShape = new btCompoundShape();
btTransform btCom;
btCom.setIdentity();
compoundShape->addChildShape( btCom, fallShape );
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(
	mass,fallMotionState,
	compoundShape,
	fallInertia);
...and...

Code: Select all

fallShape = new btSphereShape( 1.0f );
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(
	mass,fallMotionState,
	fallShapecompoundShape,
	fallInertia);
-obviously I'm doing something wrong:) Any hints?