1
Vote

How can I rotate a BoxSphape so that a SphereShape can roll down from it?

description

Hi,
 
Here's how I update RigidBody's world transform matrix:
 
Matrix rotationTransform = Matrix.CreateFromQuaternion(e.Orientation);
Matrix translateTransform = Matrix.CreateTranslation(e.Position);
 
// for some reason BulletX doesnt take into consideration scale transform
// empirically found that setting CollisionShape.LocalScaling works
body.CollisionShape.LocalScaling = e.Scale;
body.WorldTransform = rotationTransform * translateTransform;
 
It works for the scale and position, but doesn't work for orientation. I would like to pitch the box by 45 degrees, so that falling spheres can roll down from it. Is it possible?

comments