[ODE] Simple character control
Jon Watte
hplus-ode at mindcontrol.org
Mon Mar 29 18:02:12 MST 2004
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+
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Colin
Bonstead
Sent: Monday, March 29, 2004 3:57 PM
To: ode at q12.org
Subject: Re: [ODE] Simple character control
After reading through the docs a few more times I figured out that you can use
motor functions on pretty much any joint. I was just skipping over that stuff
because I was assuming it was part of the angular motor API. Whoops.
Anyway, it looks like a motor on a slider joint could provide linear velocity
for me. I'm trying that out right now. It seems like that would restrict
motion in the other 2 axis though, if I'm understanding the slider concept
correctly. The way we were doing this in our previous physics engine was by
just setting the velocity every frame, but it seems like this isn't the best
idea from reading the ODE docs.
I'll play around with these joints some more and see if I can figure this out
myself, but if anyone has any suggestions I'd certainly be interested in
hearing them.
Colin
-----Original Message-----
From: Colin Bonstead <colin at cyan.com>
Sent: Mon, 29 Mar 2004 08:51:36 -0800
To: <ode at q12.org>
Subject: [ODE] Simple character control
I'm trying to add movement control for my avatar. Right now, it's just a
sphere, and I'd like it to scoot around the environment (not roll, because I'd
like the pivot to keep it's vertical orientation). The velocity of the avatar
is derived from animation data each frame.
>From reading the docs and looking through the archives, it seems like a motor
joint is the way to go. The only one I see is the the angular motor. That
seems like it could be handy for keeping the avatar upright (restrict motion
in two of the axis), and turning (around the vertical axis). But how can I do
linear motion? Unless I'm missing something, you could only do that with a
motor if you were rolling the object.
Colin
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list