Hello,
I have a bullet entering a body at position (X,Y) of a body. Is there a way to immediately return (without actually rendering) what the exit position will be of the bullet? Thank you
I've been trying this for the last 10 days or so, so I guess there's no way of doing this.
Can anyone recommend an alternative method for such a thing? I'd essentially like to get the position of the bullet at the point it would leave the body. I'd fire a raycast, but I don't know the distance to fire at.
Thank you.
Yes, fire a ray cast in the reverse direction. You can use an estimate of the shape size to build the ray.
Thanks for the reply Erin. The only problem is, it's quite difficult to estimate because there could be two bodies close together and I'd only like to get the first one.
I'm guessing you are talking about the b2World RayCast function? If you already know which body you are interested in, you can confine the raycast to only the fixtures of that body by using the b2Shape RayCast function. Check the manual for "Shape Ray Cast".