Point of intersection between oriented boxes (or OBB)

I'm trying to write a simulator of a rigid body, and during the simulation I'm not only interested in finding out if two objects collide or not, but also a point, as well as collision normals. I found many resources that actually say whether two OBBs collide or do not use the dividing axis theorem. I'm also interested in the 3D representation of OBB. Now, if I know the axis with the minimum overlap area for two colliding OBBs, is there a way to find the collision point and collision normal? In addition, there are two main cases of collision: first, the point and the second edge. I tried to solve this problem, but almost every solution only detects a collision with true or false.

Please help someone!

+4
source share
1 answer

Look at the scene in the direction of movement (in other words, apply a change of coordinates so that this direction becomes vertical and reduces height). You get a two-dimensional digit.

Given the edges of two boxes that are facing each other, you will see two hexagons, each of which is divided into three parallelograms.

enter image description here

Then

  • Edge intersection detection in 2D. From the relationship of the section at the edges, you can determine the actual distances z.

  • For all vertices, define the face on which they fall in another field; and from three-dimensional equations - the breakdown point of the viewing line into the plane of the face, hence the distance. (Repeat this for vertices A and B.)

, ( , ).

"--" , .

0

Source: https://habr.com/ru/post/1681911/


All Articles