[ODE] Manually setting rotation
acidfloppy at gmail.com
Tue Aug 14 06:14:35 MST 2007
Hi ODEers I'm new to ode and guess what I need some help.
Ok I'm not totally new I used ODE 0.5 (I think) a couple of years ago but I
only did some box pyramid demo and
hover craft game.
My problem is the following: I have this cylinder, actually its more like a
disc as its not very thick.
Lets think of it as a coin standing on its side, rolling inside a labyrinth
(or any other environment). Everything is
colliding just fine but I don't really know how to make it move the way I
want it to.
I can get it to rotate around it local z-axis, and therefore roll but I want
to directly set the rotation around the
y-axis (global up).
Everything is viewed from a top-down perspective and the "coin" is supposed
to always face (or whatever a
coin does) the mouse pointer.
This is obviously not very physically correct and I suppose that's part of
Calculating the angle to rotate the "coin" is not a problem but how do I set
I use an AMotor to get it to rotate around its local z-axis and thought that
maybe I could use that to set the
global y-rotation too but that didn't work very well. (using the
dsetmotorangle or whatever the function is called)
The motor I use is anchored to the coin and the static environment (I think
that's what it's called), it has 3 axes,
and I'm using the usermode. X and z axes are relative the coin and y the
global frame/static environment.
And the problem is as simple as I cant set the rotation around the Y-axis.
Probably because I don't really
understand the amotor, yet…
How should I do to be able to control the rotation manually? Is it even
possible to do it using an amotor or should
I do it difrently?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ODE