]> git.jsancho.org Git - lugaru.git/blobdiff - Source/PhysicsMath.h
clean ups, and now campaignProgess is well initialized in accounts
[lugaru.git] / Source / PhysicsMath.h
index 6612982d92b65dd22772e9f34203dbc37cfd6681..75aa7a861e0893decb57f8d6bd5d484479519e55 100644 (file)
@@ -1,3 +1,24 @@
+/*
+Copyright (C) 2003, 2010 - Wolfire Games
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
 #ifndef _PHYSICSMATH_H_
 #define _PHYSICSMATH_H_
 
@@ -693,7 +714,7 @@ inline      Quaternion      MakeQFromEulerAngles(float x, float y, float z)
 
 inline Vector  MakeEulerAnglesFromQ(Quaternion q)
 {
-       double  r11, r21, r31, r32, r33, r12, r13;
+       double  r11, r21, r31, r32, r33;
        double  q00, q11, q22, q33;
        double  tmp;
        Vector  u;
@@ -712,8 +733,8 @@ inline      Vector  MakeEulerAnglesFromQ(Quaternion q)
        tmp = fabs(r31);
        if(tmp > 0.999999)
        {
-               r12 = 2 * (q.v.x*q.v.y - q.n*q.v.z);
-               r13 = 2 * (q.v.x*q.v.z + q.n*q.v.y);
+               double r12 = 2 * (q.v.x*q.v.y - q.n*q.v.z);
+               double r13 = 2 * (q.v.x*q.v.z + q.n*q.v.y);
 
                u.x = RadiansToDegrees(0.0f); //roll
                u.y = RadiansToDegrees((float) (-(pi/2) * r31/tmp)); // pitch