Explorar o código

fix calculation of distance from plane to origin

fix calculation of distance from plane to origin
sxop %!s(int64=11) %!d(string=hai) anos
pai
achega
5dbfd41924
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      gameplay/src/Form.cpp

+ 1 - 1
gameplay/src/Form.cpp

@@ -1025,7 +1025,7 @@ bool Form::projectPoint(int x, int y, Vector3* point)
 
 
         // To get the plane's distance from the origin, we project a point on the
         // To get the plane's distance from the origin, we project a point on the
         // plane onto the plane's normal vector.
         // plane onto the plane's normal vector.
-        const float distance = fabs(Vector3::dot(pointOnPlane, normal));
+        const float distance = Vector3::dot(pointOnPlane, normal);
         Plane plane(normal, -distance);
         Plane plane(normal, -distance);
 
 
         // Check for collision with plane.
         // Check for collision with plane.