Sign in to follow this  
GMaker0507

Moving Point and Moving Rectangle Intersection

Recommended Posts

Just a simple question can someone hook me up with a thread/web site link or something , showing how to sweep test against a moving point and a moving rectangle, and find where the point intersects the rectangle, if it does at all.

Share this post


Link to post
Share on other sites
Quote:
Original post by GMaker0507
Just a simple question

can someone hook me up with a thread/web site link or something , showing how to sweep test against a moving point and a moving rectangle, and find where the point intersects the rectangle, if it does at all.
In general, when testing for intersection between two moving objects you can express the problem so that one of the objects is moving and the other is static (to do this, subtract the velocity of the object that you want to consider static from the velocities of both objects).

In the case of a moving point and a moving rectangle, this leaves you with a raytracing problem, with the target object being an oriented or axis-aligned rectangle (depending on what you're using). These tests are well documented, and are discussed on the forums fairly frequently. Try searching the archives for (e.g.) 'ray aabb intersection', 'ray obb intersection', 'ray box intersection', and so on. If you have further questions or have trouble finding relevant references, post back here and someone will most likely be able to help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this