Skip to main content
GameDev.net gamedev.net
🔒 Locked

Moving Point and Moving Rectangle Intersection

Started by GMaker0507 May 31, 2009 at 2:12 PM 0 replies 1.8k views
Original Post
GMaker0507
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.
Zakwayda
Zakwayda
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.