I am doing some physics and I am trying to find the info between a collision of a 2 oriented boxes in 3D space. I already did it for SphereSphere and SphereBox, but I cannot figure it out for BoxBox.
My boxes are: (I can easily get the transformation matrix so the axisXYZ of the box)
struct Box {
Vector3 center;
Vector3 size;
Vector3 rotation;
}
And I want the info like this:
struct CollisionPoints {
Vector3 pointA; // Collision point of box A
Vector3 pointB; // Collision point of box B
Vector3 Normal;
float Depth; // would be (pointA - pointB)
bool HasCollision;
};
But I have no idea how to do it and I do not find a lot of information on internet. There is a lot of help to find if there is a collision or not, but not to get the info.
Thank you in advance.
I found how to detect collision, but I am still looking for the info on the collision.