Collision detect?

realtiger

28-11-2006 08:51:48

Hi all

I have tried Demo_GranTurismOgre. It's so great!
My problem is how can I check what the car is collided with?
If put a box into the scene, and drive the car toward the box. If the car collide with the box, how can I know that?
Thank you very much.

nikki

28-11-2006 13:57:08

Use a CollisionListener. You can set UserData for the box. Then, when two Geometies collide, check of one of them is the box (check the UserData). If it is, then check of the other is the car (using UserData). If so, then they have collided.

realtiger

28-11-2006 16:18:50

thank u :wink:

nikki

28-11-2006 19:49:48

Don't mention it. :)

syedhs

29-11-2006 10:00:22

Actually it could be a bit tricky because when say.. car A collides with Box A.. the collision callback will be called more than once. If the car touches the box for more than one second for example.. the callback is called for more than maybe 100 times.

realtiger

29-11-2006 10:18:50

Actually it could be a bit tricky because when say.. car A collides with Box A.. the collision callback will be called more than once. If the car touches the box for more than one second for example.. the callback is called for more than maybe 100 times.
Do you have any solution :?:

tuan kuranes

29-11-2006 14:09:39

Do you have any solution
you have to reset collision state each frame in your code, so that ode callback setting it true all frame collision is happening in.