I am working on a simple rigid-body physics engine ,I've already implemented SAT algorithm for collision detection and everything works fine, Now i get to step to use MTV to calculate the distance which objects might move to, In my case the two objects are cubes ,Actually i am a little confused about the distance and how to use it
Here is the two cubes
Both of them are on the same y-axis and z-axis, Only differs in x-axis
I am calculating MTV and i get:
samllest
which refers to the smallest axis, So it looks like (x,y,z).
overlapDistance
which refers to the smallest overlap distance as a double variable.
I know that overlapDistance
is the distance that one of two cubes should move till no collision
But how to use it , How cubes should respond to this distance ?
Sorry if i am not clear, but for summary i know the smallest overlap distance but i don't know how to get use of it