[ODE] Simple character control

Megan Fox shalinor at circustent.us
Mon Mar 29 19:32:00 MST 2004


And an addenum... what about animation?  Assuming you're not representing
your character as one big box, you're going to need to set the positions of
each geom on a frame-by-frame basis based on the animation frames currently
being played.  You can't apply a force and hope it gets to "about the right
position"... it needs to be in position, exactly where it should be, exactly
when the graphic gets there, or you risk your body's collision volume
lagging behind or getting ahead of where the body visually is (leading to
much whining and screaming from your player base, especially if what you
have is an FPS with competitive play).

And so if you're already setposition'ing and setorientation'ing the body
parts into position on a frame by frame basis, why not do the same with the
entity position, deciding manually what to do with the contact joints
generated yourself? (maybe stop motion, maybe apply a greater contact joint
to the colliding object to "push" it out of the way, maybe enable fall mode
if there's a large force applied (at which point the entity becomes a rigid
body until righting him or herself), etc.

-Megan fox

> 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+
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>



More information about the ODE mailing list