How do you know if 2 physics bodies have collided?

Topics: Developer Forum, User Forum
Mar 28, 2007 at 10:39 PM

I am very new to games programming and discovered farseer physics about a month ago, which has helped me immensely. I have been working on my current game for about a month now and ive got a problem. I need to find out if two of my circle rigid bodies have collided so that i can change some boolean values at the time of impact.

I know that i could use pyphagoras pheorum (sorry about the spelling) and the distance between the two midpoints of the circle to see if they collide, but it would be handier if i could use the engine.

So i was wondering if something like this is possible:

if(rigidBody1 has collided with rigidBody2){
set bool to true;

Sorry if this is very simple but as i said i am a beginner. And any help would be appreciated.

Thank you
Mar 29, 2007 at 6:40 PM
There is a collision event that you can hook into. I'm pretty sure I do it in the demo with the truck.