This project has moved. For the latest updates, please go here.

Get Collision Side

Feb 6, 2010 at 3:01 AM

I may be thinking about this problem all wrong, because I can't seem to find anything by searching even though it must be a common problem.

Let's say I'm making a platformer. I want the player to only be able to jump if his bottom face (he's a rectangle body) is touching another surface. How can I determine this in Farseer? I'm assuming I would do it in the OnCollision event listener, but I'm not sure what to do with the contact information.


Feb 6, 2010 at 3:59 PM

I believe I've got it working. I'm just looking at the contact normals to see whether they're negative or positive in the X and Y axis and that seems to be working. Is this the appropriate way?

Feb 6, 2010 at 5:40 PM

Yes, but remember that the normal points from geometry A to geometry B - where geometry A is the one first created.