I'm looking for the point of impact so i can add a graphic there.
im using beginContact.
the contact is between a sensor-dynamic bullet and a static wall.
the wall is listening for the bullet.
if i use the x and y of the bullet it is not exact, and is often off the wall a little ways, i would like it to be precisely where the bullet contacts the wall.
i appreciate that the variable i used is specifically labeled local point.
i am looking for a global point
i am not sure what this point is local to (perhaps one of the two bodies, perhaps something else) it seems to return 0.
i've also tried
but that seems to return null.
im using beginContact.
the contact is between a sensor-dynamic bullet and a static wall.
the wall is listening for the bullet.
Code:
public function handleBeginContact(e:ContactEvent):void {
var b:BodyShape = e.relatedObject as BodyShape;
if(!b)return;
if(b is shot){
e.contact.
doExplode(new Point(e.contact.GetManifold().localPoint.x, e.contact.GetManifold().localPoint.y));
b.remove();
}
}
var b:BodyShape = e.relatedObject as BodyShape;
if(!b)return;
if(b is shot){
e.contact.
doExplode(new Point(e.contact.GetManifold().localPoint.x, e.contact.GetManifold().localPoint.y));
b.remove();
}
}
if i use the x and y of the bullet it is not exact, and is often off the wall a little ways, i would like it to be precisely where the bullet contacts the wall.
i appreciate that the variable i used is specifically labeled local point.
i am looking for a global point
i am not sure what this point is local to (perhaps one of the two bodies, perhaps something else) it seems to return 0.
i've also tried
Code:
e.worldManifold.GetPoint()
but that seems to return null.