[ODE] Specific Collision Handling...

Julian Spillane julian at entermail.net
Wed Oct 8 16:44:07 MST 2003


Hey all,

I have a problem that I suppose is more logic 
related than ODE related. I have decided to use 
the Get and SetData functions in the collision 
routine to handle specific collisions in my game, 
but I'm not sure how I should go about it. So 
far, I have a CBaseObject class which is the base 
class for the CItem, CPlayer and CObstacle 
derived classes. Now, in my collision routine, I 
want to check if one object is a player and has 
collided with another object which is an item, a 
player and a player, an item and an item, etc. 
Now, the first thing that came to mind was to use 
an enumerated integer in a ColInfo structure to 
pass to the geom's data and then do checks on 
that, but then I realized that I would need 
instances of those specific classes to handle any 
collisions with them. Now, since it passes back a 
void pointer, I can't pass a 'this' pointer to 
the geom in the class without knowing the type of 
class that has been passed to the geom, so I am 
at a fix. ...any ideas? Sorry if I've been 
confusing.

Thanks a lot!

-Julian Spillane


More information about the ODE mailing list