See this video for reference
Although both Sinbad and Ninja have:
CollisionShape modelShape = CollisionShapeFactory.createDynamicMeshShape(model);
Same mass = 80kg
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?
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.
Can I control this center of mass location? do I need to modify the model or do something with the RigidBodyControl?
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 wrapper = new Node();
Then use ‘wrapper’ as your model instead of ‘model’ when setting up the control, collision shape, etc.