[ODE] First person shooter - falling over
shalinor at gmail.com
Sat Sep 17 10:01:47 MST 2005
You can SetQuaternion the body to upright every frame, as well as
zero'ing out any angular velocities or torques, and it will work
fairly well. You also SetQuaternion() the body to the desired
rotation, based on user input/etc (all upright, but probably rotating
around the Y axis or similar).
This method will cause problems if 1.) your body is not rotationally
symetrical about the "up" axis (that is, you have a limb poking out
instead of a smooth surface), or 2.) you have limbs attached to the
But, for most games, neither of these are a problem.
On 9/17/05, Dan <danfrith at gmail.com> wrote:
> I would like to simulate the player in a FPS. At the moment, I have a
> sphere, but this of course rolls around which is undesirable! Now I
> have tried simply setting the angular velocities of the sphere at each
> step to zero, and this almost works however the sphere still rolls
> very slowly. Also I think the ODE manual says something against
> setting velocites directly.
> However I have seen in this message
> ...a method is to attach an AMotor joint from the body to the static world (0).
> I have tried creating the amotor then attaching to the sphere body. I
> know there are angle/axis setting functions but I don't know how to
> setup the joint to prevent rotations.
> ode_joints = dJointGroupCreate(0);
> dJointID joint = dJointCreateAMotor(ode_world, ode_joints);
> dJointAttach(joint, ode_body, 0);
> That's all I have so far... Any help would be much appreciated!
> ODE mailing list
> ODE at q12.org
Lead Developer, Elium Project
More information about the ODE