Body.IsSensor and Contact.Manifold.LocalNormal issue ?

Topics: Developer Forum, User Forum
Jul 26, 2013 at 2:25 PM
Hello, im search information but can't find;
I need detection face of collision so i get normal normal contact and check collision direction :
if(normal.X > 0) IsLeft;
else if(normal.X < 0) IsRight;

if(normal.Y > 0) IsDown
else if(if(normal.Y < 0) IsUp
It's works for normal body states but for body.IsSensor = true it's not working. Maybe you met with similar issue.
Thanks for help :)
Coordinator
Jul 30, 2013 at 10:43 PM
The normal is only calculated once it is needed, and since sensors does not need any kind of feedback (collision), it does not calculate the normal.
You do however have the position and rotation of the object relative to the sensor. You could do the calculations yourself, or use the lower levels of the engine. Take a look at Polygon Collision test inside the Testbed project for more information.