Sinbad vs Ninja Physics Question

Hello,
See this video for reference

Although both Sinbad and Ninja have:
CollisionShape modelShape = CollisionShapeFactory.createDynamicMeshShape(model);
And
Same mass = 80kg
And
RigidBodyControl modelCtl = new RigidBodyControl(modelShape, mass);

They behave differently when colliding with the ground - Ninja always tries to stand up while Sinbad is laying on the ground…
Why is that?

1 Like

I believe this has to do with where their respective centers-of-mass are located.

The model origin of the Sinbad model is located in his belly, so that’s where Bullet puts his center of mass.

The model origin of the Ninja model is located between his feet, so that’s where Bullet puts his center of mass.

1 Like

Can I control this center of mass location? do I need to modify the model or do something with the RigidBodyControl?

1 Like

The easiest way to change the center-of-mass is to attach the model to a com.jme3.scene.Node that has setLocalTranslation() and then add your PhysicsControl to that Node.

1 Like

Something like:

Node wrapper = new Node();
wrapper.attachChild(model);
model.center();

Then use ‘wrapper’ as your model instead of ‘model’ when setting up the control, collision shape, etc.

1 Like