Hello,
I’m trying to make a simple game that involves letting the player control the legs of a character. “Control” in this case means more than W-A-S-D controls. I would like to let the player articulate each joint of the character’s legs individually. The object of the game is to learn to make the character walk. The character and bone hierarchy can be seen here.
The character needs to interact with the environment (just a heightmap, at this stage) through the physics engine, so that it can fall over, hop, collide with things, etc. I don’t know how to go about making this character part of the physics space, and also getting control of the skeleton so that I can change the joint angles inside the update loop.
Things like,
[java]walkChar_phy = new RigidBodyControl(5f);
walkChar.addControl(walkChar_phy);
bulletAppState.getPhysicsSpace().add(walkChar_phy);
SkeletonControl skeletonControl = walkChar.getControl(SkeletonControl.class);
skeletonControl.setEnabled(true);[/java]
Return a null skeletonControl, as does trying to grab AnimControl in the same manner. Am I going about this in the right way? Should I be trying to build something closer to an articulated ragdoll?
Thanks for any help.
Few games have this advanced characters, its a waste of CPU. Just do what the character control does and simulate a few “kicks” or whatever with kinematic limbs.
Have you tried using the ragdoll? It integrates a bone character with physics, see the KinematicRagdollControl class.
Just found a bullet demo that might help you. Although the character seems to be locked in an upright position the joints are motor controlled and it can walk and climb up stairs.
http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=17&t=7855