This project has moved and is read-only. For the latest updates, please go here.

[FP3.0] Collision's Local point

Aug 10, 2010 at 6:52 PM

Hey all,

I ported my game over to FP3.0 as i wanted to test it out and see if it preforms better for me :). So far i managed to get everything working (a bit) like it should, but i get into trouble with the Collision handler.

If im correct, you can use Manifold.Localpoint to determine the collision position. But the question is how do it use it to determine thje world's position of ther collision impact? I tried it several ways, but i get some really weird behaviours...

In FP2.1 i didn't really have this problem as this position was given by contact's position, which was really accurate for me even for fast moving objects.

Image 1:

In this image you can see that the collision impact of the bullet is exactly on the wall (blue circle). Note this is FP2.1

Image 2:

Here you can see that the bullet has hitted the wall, but my effect triggers above it... I have seen weirder places that the effect is suppose to trigger. This is FP3.0.


Am i missing something here?

Thanks in advance!

Aug 10, 2010 at 10:30 PM

I've changed the latest FPE 3.0 source code checkin to send the whole contact in the OnCollision delegate.

You simply do this to get the world coordinates:

WorldManifold worldManifold;
contact.GetWorldManifold(out worldManifold);

then you can get the points from the worldManifold.

Aug 11, 2010 at 2:49 AM
Edited Aug 11, 2010 at 2:50 AM
This is exactly the issue I was having in my thread that hasn't gotten any responses yet :P (other than RobertDodd saying he'd look). Getting the proper coordinates from the collision is nigh unto impossible. I'll get the latest and give that a try. Thanks genbox.
Aug 11, 2010 at 7:00 AM

Cheers for the help genbox, i'll check it out tonight when i get home :).

Awesome work!