🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

From OBB-OBB intersection test to Sweep OBB test?

Started by
2 comments, last by shintiger 6 years, 5 months ago

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:

http://www.realtimecollisiondetection.net/files/levine_swept_sat.txt

 

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

Advertisement

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.

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.

This topic is closed to new replies.

Advertisement