Determining if an object is crushed/under stress

Dec 18, 2011 at 2:12 PM

Hey,

does Farseer support some sort of stress detection, so I could check to see if a specific body is being "crushed" by one or more bodies?

Basically I'd just need to check if a large body is colliding with my player body, but only if the body doing the crushing is above the player.

 

If not, I guess I could just check to see if there's a collision between the large bodys bottom and player bodys top, but that doesn't seem like good way of doing it, since the player could jump and hit his "head" on the large body, thus colliding.

Dec 19, 2011 at 10:53 AM

Check the applied impulse during a collision. I don't have the code right here, but you can check the contacts section in the Box2D manual:

http://www.box2d.org/manual.html#_Toc258082975