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

OnCollision in FP3

Topics: Developer Forum
May 31, 2010 at 10:30 AM

Hi, I just realized that in the OnCollision method against a circle shape (haven't tested with other shapes, so maybe is only related to the circle) the manifold has no contact points, no normal, no data. Is this normal or is it a bug?

May 31, 2010 at 2:55 PM

Use PostSolve to hook where the collision data is available.

May 31, 2010 at 3:06 PM

Thanks for the info McAwesome :) , but I need the contact point just to tell if I fire or not the collision. With PostSolve, the collision has already happened.

May 31, 2010 at 3:50 PM

I believe you'll have to hook into the world's ContactManager's PreSolve delegate. There you can set a contact to be enabled or not, before it happens. I'm not sure if that's what you want or if that's the best way to go, though!

May 31, 2010 at 4:38 PM

Yes, I also thought on that approach, but I wasn't sure if it was the best way to do it, as the PreSolve delegate is for all the world's objects, and I'm not sure if it could affect on the overall performance. I'll take a look to it anyway, thanks!