ソースを参照

Adds forms test using default theme and fixes point projection on Xcode. Also adds billboards test to the Xcode project.

Ken Whatmough 13 年 前
コミット
a0b32956f1
1 ファイル変更1 行追加1 行削除
  1. 1 1
      gameplay/src/Form.cpp

+ 1 - 1
gameplay/src/Form.cpp

@@ -731,7 +731,7 @@ bool Form::projectPoint(int x, int y, Vector3* point)
         // by the quad's forward vector and one of its points to the plane defined by the same vector and the origin.
         // by the quad's forward vector and one of its points to the plane defined by the same vector and the origin.
         const float& a = normal.x; const float& b = normal.y; const float& c = normal.z;
         const float& a = normal.x; const float& b = normal.y; const float& c = normal.z;
         const float d = -(a*min.x) - (b*min.y) - (c*min.z);
         const float d = -(a*min.x) - (b*min.y) - (c*min.z);
-        const float distance = abs(d) /  sqrt(a*a + b*b + c*c);
+        const float distance = fabs(d) /  sqrt(a*a + b*b + c*c);
         Plane plane(normal, -distance);
         Plane plane(normal, -distance);
 
 
         // Check for collision with plane.
         // Check for collision with plane.