Branimir Karadžić пре 5 дана
родитељ
комит
0e7d969a8a
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      src/bounds.cpp

+ 5 - 5
src/bounds.cpp

@@ -397,13 +397,13 @@ namespace bx
 		bottom.normal.z = zw - zy;
 		bottom.normal.z = zw - zy;
 		bottom.dist     = ww - wy;
 		bottom.dist     = ww - wy;
 
 
-		Plane* plane = _result;
 		for (uint32_t ii = 0; ii < 6; ++ii)
 		for (uint32_t ii = 0; ii < 6; ++ii)
 		{
 		{
-			const float invLen = 1.0f/length(plane->normal);
-			plane->normal = normalize(plane->normal);
-			plane->dist  *= invLen;
-			++plane;
+			Plane& plane = _result[ii];
+
+			const float invLen = divSafe(1.0f, length(plane.normal) );
+			plane.normal = mul(plane.normal, invLen);
+			plane.dist  *= invLen;
 		}
 		}
 	}
 	}