# Method for Resolving Multiple Penetration Vectors (3D)

I am currently doing OBB vs. OBB/Triangle collision resolution. I know that the penetration vectors I am getting are correct.

I currently resolve the penetration vectors by subtracting them from the object's velocity and then moving that object along the new velocity. This works perfectly for a single penetration vector; however, an object can end up clipping through objects if there are two penetration vectors that are pointing in different directions along a certain axis.

Pseudocode for my current multiple-penetration-vector resolution:

Vector finalPenetrationVector = new Vector(0, 0, 0);
for(int i = 0; i < penetrationVectors.size(); i++) {
Vector v = penetrationVectors.get(i);

if(finalPenetrationVector.x >= 0 && v.x >= 0) finalPenetrationVector.x = /*The larger of the two.*/;
else if(finalPenetrationVector.x <= 0 && v.x <= 0) finalPenetrationVector.x = /*The smaller of the two.*/;
else finalPenetrationVector.x = /*Both setting it to zero and adding them together yields clipping through one of the surfaces.*/;

/*Repeat for the y-axis and the z-axis.*/
}


Is there a method of resolving these penetration vectors without having to switch to a force-based system or something like that? Note that I do want the entity to "slide" across the sliding plane like they do in most commercial games.