Jump to content
  • Advertisement
Sign in to follow this  
YZK

How to calculate the new move distance when two OBB box are collision?

This topic is 3930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The question is this: Suppose two OBB box: A,B A is still. B is move along Vector P, move distance is 10.0, and B hit A if not limit move distance of B , so we should find a new distance to avoid this. How to get it? Can get someting from 15 steps of seperate aixs test?

Share this post


Link to post
Share on other sites
Advertisement
if I understand your question correctly, then you need to use the momentum law.
if its an elastic collision then this should help you:
http://en.wikipedia.org/wiki/Elastic_collision

Share this post


Link to post
Share on other sites
Project both OBBs to the axis of P. From there it is easy to see how far apart A and B are in the direction of movement.

Share this post


Link to post
Share on other sites
Quote:
Original post by Vorpy
Project both OBBs to the axis of P. From there it is easy to see how far apart A and B are in the direction of movement.
I don't think that's right - the boxes could be oriented in such a way that their projections onto P intersect before the boxes themselves do.

@The OP: To find the first time of intersection you'll want to use a continuous or 'swept' version of the SAT.

Try googling 'swept separating axis test' or 'continuous separating axis test' for more info.

Share this post


Link to post
Share on other sites
Hmm...I don't know what I was thinking.

The swept separating axis test is definitely what's needed here. You compute the times at which the objects begin and end intersecting on each axis. The collisions happen after all the axes are intersecting, so the time that the last intersection begins is the time of collision. There is no collision if the latest intersection start time is greater than the earliest intersection end time.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!