Detect Open Space in Farseer

Posted by Tom G on Game Development See other posts from Game Development or by Tom G
Published on 2011-08-02T21:33:54Z Indexed on 2012/06/20 9:25 UTC
Read the original article Hit count: 253

Filed under:
|

I'm working on a 2D platformer using XNA and Farseer. I would like the player's character to be able to grab and climb up ledges. Detecting a collision between the player and the side of a wall is simple enough with the OnCollision delegate, but I have to admit I'm a bit stumped on how to detect that there's enough clearance for the PC to mount the ledge.

Essentially, I want to ensure there's an appropriately sized rectangle above and to the left or right of the PC (depending on their direction) and I'm not sure how I would check for such a space.

Any suggestions on how to determine there is nothing in the simulated world within some bounding rectangle?

© Game Development or respective owner

Related posts about XNA

Related posts about farseer-physics-engine