What I do have, is a working collision detection system - I've implemented a version of XenoCollide/ Minkowski Portal Refinement, and it is working acceptably well -- but at this point, all it's doing well is detecting.
I'm not looking to implement real physics, just to prevent objects from intersecting each other, so I was aiming for an update loop along the lines of this:
- Add object position + velocity.x, and test that new value for collision.
- if collision detected, subtract a value from Velocity.x so that the objects are touching instead of intersecting.
- repeat step 1 & 2 for Z-axis.
- repeat step 1 & 2 for Y-axis.
- Add velocity to position.
Is there a way I can use MPR to calculate the appropriate offset to prevent the collision? Since I can guarantee that the two objects are colliding, is there another algorithm I can use to solve for the new positions of 2 convex polyhedra? (Cubes for now, but I'd like to be able to do arbitrary convex shapes)
Any help or feedback would be appreciated!