[ODE] problem with dBodyAddRelForce. help, I'm desperate
Troy Chard
troy.chard at shaw.ca
Sun Jul 27 08:17:01 2003
Hi all,
I'm having a problem with moving a box across a surface using dBodyAddRelForce.
I've been up and down the surface settings for the contact joints and
nothing seems to correct
the problem.
It's a little involved, but I'm pretty desperate for a solution.... I've
been working on this for about a week now and nothing seems to work.
I'm trying to use a rigidbody with a box geom to simulate an entity in my
world.
http://www.members.shaw.ca/troy.chard/images/spriteproblem/_horse_and_tri_axis_with_box_showing_collider.jpg
(semi-transparent box shows location of geom in ode - horse is just pretty
picture which moves with box. When horse is animated galloping and box is
moving, the illusion is pretty good :)
I am trying to move the box forward by applying a relative force to it
along its local z axis.
To help diagnose the problem I have 3d engine stamp out a copy of the box
every time i apply a force to it.
This leads to some pretty interesting images.
http://www.members.shaw.ca/troy.chard/images/spriteproblem/a_common_problem.jpg
Here is a picture of the problem that is driving me crazy. (stark raving -
call men in white coats)
http://www.members.shaw.ca/troy.chard/images/spriteproblem/rotations.jpg
Each image shows the box/rigidbody starting at a different y axis rotation,
and the result of applying
a local force to the box (applied to the local z axis of horse.... shoving
it from behind).
(full size versions of images available in same directory). During these
tests, i press a key to
apply force... copy of box image is stamped out, box moves... then comes to
complete rest. I press
key again.
Along global x and z axis and at 45 degrees to these, the box moves correctly.
But at any other angle the box moves askew to the direction it's pointing in.
It's as though the local force is picking up an X axis component depending
on which direction it points in.
(really it should only have Z component for motion and -y component for
gravity).
As another test I tried this with the box floating with 0 gravity
(initially zeroing forces so box hovered
in one place). When floating, none of the skew appears, so this suggests
that the skewing is
a byproduct of the collision detection.
If anyone has any ideas at all, or is otherwise curious about this problem
and would like more
information, I'd really (really really) appreciate any feedback whatsoever.
Troy