# From OBB-OBB intersection test to Sweep OBB test?

## Recommended Posts

I understand what stationary OBB intersection test is get min/max scalar in 15 axises, when all overlap, then minimum interval overlapping is the axis that used to push away 2 OBBs to "just touch". I have complete this.

So in sweep test, how to choose the right axis projecting and how every projection transform? I only need a ratio of current velocity when start intersect from disjoint.

I have read Ron Levine's post:

And oliii's:

I get the code but cannot get it works as expect when port to my project, even I don't clearly know what params refer to.

For further optimization, I wish somebody can teach me how velocity part works conceptually instead of just code.

My case is DOBB-OBB only(dynamic to stationary).

Edited by shintiger

##### Share on other sites

You cannot form a simple equation and solve it if your OBBs carry angular velocity.

Otherwise, conceptually, finding a time of impact (TOI) along a given axis can be done by simple linear interpolation. For example, say we have a point A traveling along a velocity V at a plane P. It is possible to do:

d0 = Distance(A, P);
d1 = Distance(A + V * dt, P);

Then d0 and d1 can be used to lerp from A to A * V + dt by forming the interpolant: d0 / (d0 - d1).

The same concept can apply to any axis and any given point, even axes and points on the surface of OBBs.

Edited by Randy Gaul

##### Share on other sites

I got it now, sweep OBB is almost as same as sweep AABB, except two things:

1. 15 axis rather than xyz

2. each axis test may using scalar representation rather than simple xyz diff

And I have just finish this part, thanks Randy.

## Create an account

Register a new account

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633294
• Total Posts
3011242
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

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!