[ODE] Simple character control

Megan Fox shalinor at circustent.us
Mon Mar 29 19:16:17 MST 2004


This results in a character that can be knocked around like a ragdoll,
though, doesn't it?  A human, when pushed, shouldn't slide away like an
ice-skate - they should remain where they are up until a specific force
point, where they would fall over.

Or do you suggest that the entity should react to the force, supply a
counter-force?

... but in that case, the entity would still be pushed back by slight forces
only to rebound back to position the next frame.  That doesn't seem
particularly ideal at all?


In a typical game, you don't want the player getting knocked back when a
barrel (slowly) rolls into them.  In fact, the players and entities should
typically be fairly assertive over rigid bodies, only reacting (assumedly
with a ragdoll or canned "fall back" animation) when the forces attempting
to be applied to the entities reach a certain critical mass... rigid bodies
should impede motion, but not knock the entities around like hockey pucks,
or in fact have much influence on the entity's movement at all (so long as
the forces applied remain below the critical point).


Forgive the confusion, but it seems like your solution treats players like
any other rigid body (that can be moved and knocked about just like any
other rigid body)?

-Megan Fox

> Add a force, not a velocity, each frame. Make the force equal to
> some constant times the difference of the velocity you want to
> run at, and the velocity you're currently running at, possibly
> clamped to some maximum force (if you don't allow infinite leg
> strength :-)
>
> You may also want to add a force that's a negative small constant
> times the velocity, to simulate air drag and/or ground friction.
> If you have sufficient air drag, you don't need to keep a target
> velocity, just apply the force when running, and air drag will
> make it stop at some top speed based on what the force and air drag is.
>
> Cheers,
>
> 			/ h+



More information about the ODE mailing list