I have big difficulties in making a good physics walking character.
My problem is the following one:
If i use the AwayPhysics “default” walk character : the AWPGhostObject, i don’t like the sollution for the collision event with environement mobile bodies:
private function characterCollisionAdded(event : AWPEvent) : void {
if (!(event.collisionObject.collisionFlags & AWPCollisionFlags.CF_STATIC_OBJECT)) {
var body : AWPRigidBody = AWPRigidBody(event.collisionObject);
var force : Vector3D = event.manifoldPoint.normalWorldOnB.clone();
force.scaleBy(-30);
body.applyForce(force, event.manifoldPoint.localPointB);
}
}
..in other words , here is writed that if my ghost object collide an external moving object, this one wil be moved with some force ADDED IN EXACT THE CONTACT MOMENT. This wil cause a fragmented interaction with all externals bodies from scene. (...and REALLY it is so !!)
On the other side
It is possible to make my own walk character, a simple
capsule shape like this:
var shape : AWPCapsuleShape = new AWPCapsuleShape(200, 400);
//------------------------------------------------------------------------------------------------
var egoGeom:CapsuleGeometry = new CapsuleGeometry(200, 400)
var testMesh : Mesh = new Mesh(egoGeom, emptyMat2);
scene.addChild(testMesh);
//------------------------------------------------------------------------------------------------
egoCaps = new AWPRigidBody(shape, testMesh, 10);
scenaPhysics.addRigidBody(egoCaps);
with a simple vertical restrictions
egoCaps.angularFactor = new Vector3D(0, 0, 0 );
and wich will move with
egoCaps.applyCentralImpulse(new Vector3D(...some params....))
and THIS ONE will interact VERRY SMOOTH with all externals bodies, but has it own big problem:
DON’T HAVE A CONSTANT , LINEAR VELOCITY….
So:
Does anyone found a sollution for a GOOD walk character, with both this characteristics:
1. Have a constant speed
2. Have a smooth interaction with environment movable bodies