Collision detection without physical collision

syedhs

21-09-2006 16:51:57

I have been trying to search for such information, not to avail. Basically I am implementing a trigger system which get triggered when a vehicle collide with certain collision geometry. But I dont want the vehicle to actually 'collide' with the geometry (therefore get stopped, bounced back or whatever), just need for notification and let the vehicle pass thru. Any idea?

Indie

21-09-2006 17:18:10

Ass far as i understand you are trying to make a Checkpoint :)
Try placeing a object on same level with gorund, and when your car runs over it you get the coallision...

syedhs

21-09-2006 17:24:38

Indie,

Yeah you got me right.. I am implementing checkpoint.

Your suggestion is actually making sense, but I believe there are times when the vehicle doesnt really touch the mesh. It could be nice for a perfectly plain terrain whereas mine is for offroad vehicle. My collision mesh is a very thin box with normal levelling the terrain surface. So there is no way vehicle cant pass it, unless the vehicle tries to cheat the checkpoint.

However I just solve it .. it is quite easy. Just disable the geometry in collision callback function. Simple but works.

Indie

21-09-2006 17:38:06

Then you could try disamble the coallision of the checkpoint cube when the vihecle get's to tuch it.
Or you could try having a invisible cube-node infront of the vechicule wich would test coallision of the checkpoin then make the required event, and disamble the coallision of the checkpoint, an set it's default position relative to the car).

syedhs

21-09-2006 17:51:18

Yes that is what I have done.. disable the geometry as soon as the vehicle touches it

publicENEMY

01-11-2006 07:01:22

not sure about ode, but physx already got fairly good trigger system.

the easiest way to do it is to perform aabb collision detection(which is extremely simple) provided that you have very small number of object for collision testing.

nikki

01-11-2006 13:00:57

I think the best way is to change the parameters of the contact joint created when there is such a collision. I do it all the time. Contact joint parameter setting is very useful, as it allows you to set the friction, bounciness, ERP, CFM etc. for each collision.

What I do is that each object in the game is a GameObject (derives from GameObject class). That is what I think you're doing. There is a GameObjectManager (which is a collision listener). When an object creates a Geometry, it tells the GameObjectManager and gives it a this pointer. The GameObjectManager sets the userObject pointer to the GameObject. When the 'collision' function is called (because the GameObjectManager is a collision listener), it gets the Geometries and retreives the GameObject they represent. Then it calls the GameObject's 'collide' function, passing the GameObject collided with, the Geometry collided with (in the case of an unrepresented Geometry) and the contact joint. Then, the GameObject is free to do whatever it wants with the joint.

You can get more information about contacts in the Ode manual. :)

nikki

29-11-2006 09:54:01

You can also return false in the collision() function of the CollisionListener.

nikki

30-11-2006 07:31:15

Ok, checked it. Returning false works. :)