raycast division safety - corrects issues with awesomium and the guionobject resources relating to WYSIWYG casts.

This commit is contained in:
Azaezel 2016-06-27 13:48:11 -05:00
parent 963ef1ecdb
commit c67ba876d0

View file

@ -1630,7 +1630,12 @@ bool TSMesh::castRayOpcode( const Point3F &s, const Point3F &e, RayInfo *info, T
}
// slerp
Point3F s = ( (max - min) - (facePoint - min) ) / (max - min);
Point3F divSafe = (max - min);
if (divSafe.x == 0.0f) divSafe.x = POINT_EPSILON;
if (divSafe.y == 0.0f) divSafe.y = POINT_EPSILON;
if (divSafe.z == 0.0f) divSafe.z = POINT_EPSILON;
Point3F s = ( (max - min) - (facePoint - min) ) / divSafe;
// compute axis
S32 bestAxis = 0;