[ODE] How to constrain an object in two axes

Tim Rightnour root at garbled.net
Tue Nov 9 16:51:48 MST 2004


I'm trying to build the code that will control my NPC's and my player
characters. My basic design is a box or ccylinder.

I've read the archives regarding player handling, and they usually talk about
using an AMotor to keep my character upright.  I've been attempting to do this,
but I'm having a hard time understanding how the AMotor works exactly.

>From reading the documentation, it seems that the amotor will allow me to place
rotational torque on a body, relative to another body.  What I really want, is
a way to lock a body in the vertical position.  I tried attaching an amotor to
the body, and then contstraining the joint in both the X and Z axes, but it
had no effect that I could see on the simulation.

I'm wondering if AMotors just don't work like this, and if so, is there another
way I can do this?  All I want is an object that is free to move around, rotate
on it's Y axis, but never on the Z or X axis.  I don't want my NPC's
weeble-wobbling around, or constantly righting themselevs.  They need to just
remain upright unless I specifically place them in another position.

---
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


More information about the ODE mailing list