Allright, I improved the character controller myself a bit. I use an elipsoid like the Newton demo does. When hitting stairsteps (detected via contact callback) it will lift himself by adding an upward force for a short while.
Now the movement itself is still... like driving a truck. I set (not add) force while walking:
- Code: Select all
...Force/Torque callback
if (moving)
NewtonBodySetForce( body, moveDirection * speed );
... Contact Processing
if (moving)
{
NewtonMaterialSetContactFrictionState( material, 0,0 ); // disable friction
NewtonMaterialSetContactFrictionState( material, 0,1 );
} else
{
// High friction
NewtonMaterialSetContactFrictionState( material, 1, 0 ); // enable
NewtonMaterialSetContactFrictionState( material, 1, 1 ); // enable
NewtonMaterialSetContactStaticFrictionCoef( material, 2, 0);
NewtonMaterialSetContactKineticFrictionCoef( material, 2, 0);
NewtonMaterialSetContactStaticFrictionCoef( material, 2, 1);
NewtonMaterialSetContactKineticFrictionCoef( material, 2, 1);
}
While moving the friction is 0, otherwise 2. It helps, but it still takes a while before the player is accelerated to his maximum speed, and worse, it also takes a while before the player has stopped moving. When I release the move button it should (almost) directly stop, but it doesn't. Because of that, steering while walking gets very difficult.
Another thing I noticed is that the body elipsoid keeps rotating after hitting something. I stop the rotation by setting omega on zero each frame, but I guess this is not normal behavior... When the body rotates it gets even more difficult to steer the player. He walks as if he was drunk

BTW, any idea when Newton 2 gets an official release or at least Delphi headers? I heard it has quite some improvements, including with terrains. But I can't use it for my Delphi program for now.