# 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.

## 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 on other sites
if I understand your question correctly, then you need to use the momentum law.
http://en.wikipedia.org/wiki/Elastic_collision

##### 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 on other sites
Quote:
 Original post by VorpyProject 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 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.

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 28
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631737
• Total Posts
3001945
×