0
\$\begingroup\$

I now (thanks to several questions that were already asked here) that I can use SAT to check if two OOB are intersecting or not. But what if they are already intersecting?

My situation is: I have two OOB that are moved independently by user with different speeds; my code can't always prevent them from intersecting. They can also be intersecting from the start.

My code doesn't move OOB so my problem is not exactly collision resolution (AFAIK), I need only to check if the movement chosen by the user is "ok".

My question is - how can I check if moving one (or both) OOB will resolve the intersection?

What I tried already with some limited success:

  • "Predict" OOB positions after moving for some time delta. Doesn't work for slow movement, predicted OOB can still be intersecting. Making delta bigger can result in falling through. Checking several predictions each time requires too much time.
  • Check if distance between centroids of the OOB is getting bigger. Kinda works but not for any movement; particularly, rotations around centroid won't change said distance.

The only other solution that I can think of is too compute the volume of intersection and check if it's getting smaller for a predicted OOBs but I'm afraid that will be too slow.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.