[ODE] Bypassing customized Geoms

Andrew Aye AndrewA at terminalreality.com
Thu Feb 19 13:41:40 MST 2004


Why not just set the geom user data to a pointer to the owning object?

I think this may be a better approach if all you're looking for is to get
back a pointer to your own object type.  You can then query the object as to
what it is and base your physical response on the information you get back. 

- Andrew Aye

-----Original Message-----
From: Terence Lewis [mailto:slyterence at yahoo.com]
Sent: Thursday, February 19, 2004 1:07 PM
To: ode at q12.org
Subject: [ODE] Bypassing customized Geoms


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
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode


More information about the ODE mailing list