Sinbad vs Ninja Physics Question


#1

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?


#2

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.


#3

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


#4

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.


#5

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.