[Solved] RigidBodyControl walking

Hi everyone!



I want to try to make a skelton walk (no animations).

But before I can do that, it must have a RigidBody to make it:


  1. Not sink into the ground
  2. Not fly



    The model should, when it falls down, always land AND STAY on its feet.

    But of course it doesn’t work when I add a simply RigidBody this way:



    [java]

    addControl(new RigidBodyControl(new BoxCollisionShape(new Vector3f(3, 4, 3)), 1));

    [/java]

    http://www.youtube.com/watch?v=YbCram88ciU&feature=plcp

So how do I do that?

Setting the rotation around the x- and z Axe every frame update?

Or is there a more “elegant” solution?

try this every frame:

rigidBodyControl.setAngularVelocity(new Vector3f(0f,0f,0f));



Also use a CapsuleCollisionShape instead of a box

Thanks for answering.

try this every frame: rigidBodyControl.setAngularVelocity(new Vector3f(0f,0f,0f));

Didn't change anything.
Also use a CapsuleCollisionShape instead of a box

Yep, doing that now.

All in all the problem is solved by using a CapsuleCollisionShape and doing:
[java]rigid.setPhysicsRotation(new Quaternion(0, rigid.getPhysicsRotation().getY(), 0, rigid.getPhysicsRotation().getW()));[/java]
every frame.
@benkibitzer said:
every frame.

Better do it with a physicsTickListener in every postTick() call.