[ODE] Bypassing customized Geoms

Terence Lewis slyterence at yahoo.com
Thu Feb 19 11:07:26 MST 2004


Hi...

I'm working on a game, which, naturally, has a number
of different objects which collide.

The problem I'm having is that I don't know how to
determine what GameObject type o1 and o2 are in the
collision nearCallback function.

I'd like to use this function to determine different
collision response based on the types of GameObjects
that are colliding.

Currently, I'm just using Boxes for the Geom's for all
my objects, as I've already computed bounding boxes
for the objects. This works well, except that
obviously o1 and o2 are dBoxClass, which doesn't help
me.

Now, rather than define a whole bunch of new Geom's
(one for every GameObject in my game), I was wondering
if it's possible, and how difficult it would be, to
inherit all the collision code from dBoxClass and just
change the class number for each new object I need.

This would allow me to check which of my objects o1
and o2 are. And, this way, I won't have to copy/paste
the dBoxClass collision code, and figure out how to
add custom geoms when the functionality I need is
already there.

So basically : Is there an easy way to inherit all the
properties of dBoxClass in a new sub-class, with the
only change being a new Class number?

Thanks

=====
We scratch, our eternal itch
A twentieth century bitch
And we are grateful for
Our Iron Lung

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools


More information about the ODE mailing list