X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FPhysicsMath.h;h=75aa7a861e0893decb57f8d6bd5d484479519e55;hb=8afdcba610cded0e54b85069ba051268b29669a6;hp=064829e883c575f8e8532af729a6cb2a6df096ef;hpb=0cca0c495c7dc29d134a10d7eed5de1f377c99bf;p=lugaru.git diff --git a/Source/PhysicsMath.h b/Source/PhysicsMath.h index 064829e..75aa7a8 100644 --- a/Source/PhysicsMath.h +++ b/Source/PhysicsMath.h @@ -1,11 +1,30 @@ +/* +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_ //#include -#ifdef WIN32 -#include "WinDefs.h" -#endif +#include "MacCompatibility.h" //------------------------------------------------------------------------// // Misc. Constants @@ -695,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; @@ -714,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 @@ -735,4 +754,4 @@ inline Vector MakeEulerAnglesFromQ(Quaternion q) -#endif \ No newline at end of file +#endif