nphysics icon indicating copy to clipboard operation
nphysics copied to clipboard

parent_shift and body_shift seem to have no effect on MultiBodies with a FreeJoint

Open Kritzefitz opened this issue 5 years ago • 0 comments

Consider this program:

let mut world = World::new();

let shape = ShapeHandle::new(Cuboid::new(Vector3::repeat(0.5)));
let collider = ColliderDesc::new(shape)
    .density(1.0);

let top_joint = FreeJoint::new(Isometry3::identity());
let body_desc = MultibodyDesc::new(top_joint)
    .collider(&collider)
    .parent_shift(Vector3::repeat(1000.0))
    .build(&mut world);

Testbed::new(world).run()

When running this program I notice that the cube is still suspiciously close to the global origin. Considering that the parent_shift should shift it by 1000 units on each axis, I would expect the cube to be visibly moved or probably even completely out of sight, but no such thing happens and the cube seems to remain comfortably seated at the coordinate origin.

When I use a PrismaticJoint instead of a FreeJoint, the cube is nowhere to be found, as expected. So this seems to be some kind of special behaviour that only affects FreeJoints, but I didn't see such behaviour mentioned anywhere in the documentation, so I guess this is a bug.

Kritzefitz avatar Jun 29 '19 17:06 Kritzefitz