[ODE] More newbie questions

Nolan J. Darilek nolan at thewordnerd.info
Wed Nov 10 19:23:06 MST 2004


So I'm continuing to hammer at the problems I posted about here
yesterday, and have more elementary ODE questions.

As a brief explanation of what I'm trying to do, I'm tracking
collisions between two types of objects. "Real" objects are things
like ships, powerups, asteroids, missiles, tangible things. Virtual
objects are things like a box or cylinder extending along the path of
an asteroid which, when it collides with a ship, only sounds a
collision warning alert but doesn't attach joints.

The way I'd been doing this is with a single spherical/cylindrical
body for the asteroid or ship, and geoms extending off of that. So,
for instance, a spherical asteroid might have a cylindrical geometry
extending off of its front.

I think I found a fairly large problem with this approach, though, so
I wanted to ping the list to see if I was on the right
track. Initially I created the body, the body geom, then a "path"
geom, setting its position to a bit in front of the body and,
hopefully, orienting it along the body's direction of motion. I
notice, though, that setting the geom's position sets it equal to the
body's position as soon as I attach it to the body. Initially I
thought that the geom's position was relative to that of the body, but
that doesn't seem to be accurate. Instead of extending a cylinder or
box in front of the asteroids, I seem to be creating geometries that
extend both ahead of and behind the asteroid.

So, am I on the right track? Is a geom's position always equal to its
body and, if I want to form an extension off of the main body, I have
to instead create a second body, position it apropriately, attach it
to the main body and associate my virtual collision geom with that?


More information about the ODE mailing list