You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the two boxes are oriented on the same plane (e.g. the ground), their X, Y and Z-axis will be parallel and the resulting cross product will be 0.
I've worked around this changing the overlap comparison from < to <=
return (distance <= oneProject + twoProject);
This covers the case where distance is exactly 0 due to axis being a 0-vector. Obviously with this modification the SAT now succeeds in the rare case where the axis projections are exactly adjacent and not overlapping, but I find this to be an acceptable compromise for my own engine. YMMV.
For calculating the projection of Box on to an axis, I tried this method that I found in
cyclone/src/collide_fine.cpp
But it is not giving me correct results.
I made a small modification by taking absolute values of axis and box axis,
and that gives me correct results.
Can some one please verify this? I am not sure if I am doing something wrong elsewhere in my code.
The text was updated successfully, but these errors were encountered: