[ODE] Avatar control vs gravity

Geoff Carlton gcarlton at iinet.net.au
Wed Nov 17 09:35:17 MST 2004


I've got the same issues, and while I haven't got around to fixing it 
yet, I have thought about it.

Having to push the avatar more to get it to walk uphills is actually ok, 
and sliding downhill can be addressed by either providing minor forces, 
or adding some friction if the unit wants to stop.

The main issue is applying the forces properly.  Instead of applying a 
huge force constantly, you instead want to apply a force to get the 
necessary acceleration.  For instance, on a frictionless plain, you want 
the forward command to speed up the avatar to a certain speed, and then 
provide no further force (and thus no more acceleration).  This will 
then work out fine for hills, where the avatar will walk up slower, or 
not at.  You can even decouple it even more, and have the max velocity, 
acceleration rate, and max force, so that the object has a slow 
acceleration but huge max force - it can climb up any slope and push 
through any obstacle, but doesn't instantly zoom off the map when you move.

Ideally this would simply be applied using a LMotor, and controlling the 
desired horizontal Vel.  Although LMotors have been discussed, nobody 
has got around to making one up yet, so I've instead approximated it 
with manual forces.  When I get around to polishing the avatar movement 
I may indeed make up a LMotor just for this purpose, depending how easy 
it is.  I'll get back to you on that one!

Geoff


Tim Rightnour wrote:

>I'm still working on moving avatars and NPCs around, and now I've run into an
>interesting problem.
>
>If I set a frictionless contact between the avatar and the ground, motion seems
>to work very well. However, when the object begins to head downhill, gravity
>kicks in, and the object starts sliding down the hill.  Conversely, when going
>uphill, the object has trouble going any speed at all.
>
>Is there an easy way around all this, or am I going to have to counteract
>gravity at every step?  If I set a high friction contact, the gravity isn't a
>problem, but I can't accelerate the NPC enough to make it usable.
>
>---
>Tim Rightnour <root at garbled.net>
>NetBSD: Free multi-architecture OS http://www.netbsd.org/
>NetBSD supported hardware database: http://mail-index.netbsd.org/cgi-bin/hw.cgi
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>
>  
>



More information about the ODE mailing list