i want a collison respons and yet dont!

Mar 1, 2010 at 8:13 AM
Hi im making a racing game and was planing on having the track and dirt as farseer objects. Therefore i want to know what im colliding with ie the racetrack or the grass but i dont want to stop dead when i hit grass. Is there anyway to do this. Thank you.
Mar 26, 2010 at 3:29 PM

Every OnCollision call gives you 2 colliding geometries.  These geometries have indexes within the engine.   If during initialization you associated each geometry you created with what type of game object it is (e.g. Geometry 3 is a grass object, Geometry 4 is a dirt object), you could poll your objects and see which type of object the geometry index is associated with and handle your response appropriately.  Overriding geom with another class that stores your game object information as well would allow you to cast to them in the OnCollision call.

If you're trying to figure out how to slow the car when driving over specific objects, you may not even need a collision response.  Instead, you may want to raise the coefficient of friction with grass to make it harder to push an object along it (Though this wouldn't give realistic wheel-on-ground physics, I'm not sure if you're using friction at all).