X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=Source%2FPhysicsMath.h;h=75aa7a861e0893decb57f8d6bd5d484479519e55;hb=8afdcba610cded0e54b85069ba051268b29669a6;hp=5ae94481c5b4e00f4d0c258a1f24542d1f71decb;hpb=40a3dd7b76b6b10ae05dbd074f1f80ea7b4aa96d;p=lugaru.git diff --git a/Source/PhysicsMath.h b/Source/PhysicsMath.h index 5ae9448..75aa7a8 100644 --- a/Source/PhysicsMath.h +++ b/Source/PhysicsMath.h @@ -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 @@ -733,4 +754,4 @@ inline Vector MakeEulerAnglesFromQ(Quaternion q) -#endif \ No newline at end of file +#endif