Main Page -
Class Hierarchy -
Class List -
File List -
Class Members -
Related Pages -

Information | Reference | SourceForge Project | Author
Muli3D

Reference: Muli3D: m3dmath_quaternion.h Source File

m3dmath_quaternion.h

Go to the documentation of this file.
00001 /* 00002 Muli3D - a software rendering library 00003 Copyright (C) 2004, 2005 Stephan Reiter <streiter@aon.at> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00022 00023 #ifndef __M3DMATH_QUATERNION_H__ 00024 #define __M3DMATH_QUATERNION_H__ 00025 00026 #include "m3dmath_common.h" 00027 00028 struct quaternion 00029 { 00030 float32 x, y, z, w; 00031 00032 quaternion(); 00033 quaternion( const quaternion &i_vVal ); 00034 quaternion( const float32 i_fX, const float32 i_fY, const float32 i_fZ, const float32 i_fW ); 00035 00036 const quaternion &operator =( const quaternion &i_vVal ); 00037 00038 operator float32*(); 00039 operator const float32*() const; 00040 00041 quaternion operator +() const; 00042 quaternion operator -() const; 00043 00044 const quaternion &operator +=( const quaternion &i_vVal ); 00045 const quaternion &operator -=( const quaternion &i_vVal ); 00046 const quaternion &operator *=( const quaternion &i_qVal ); 00047 const quaternion &operator *=( const float32 i_fVal ); 00048 const quaternion &operator /=( const float32 i_fVal ); 00049 00050 quaternion operator +( const quaternion &i_vVal ) const; 00051 quaternion operator -( const quaternion &i_vVal ) const; 00052 quaternion operator *( const quaternion &i_qVal ) const; 00053 quaternion operator *( const float32 i_fVal ) const; 00054 quaternion operator /( const float32 i_fVal ) const; 00055 00056 float32 length() const; 00057 float32 lengthsq() const; 00058 00059 quaternion &normalize(); 00060 }; 00061 00062 quaternion &qQuaternionIdentity( quaternion &o_qQuatOut ); 00063 quaternion &qQuaternionRotationMatrix( quaternion &o_qQuatOut, 00064 const struct matrix44 &i_matMatrix ); 00065 quaternion &qQuaternionSLerp( quaternion &o_qQuatOut, const quaternion &i_qQuatA, 00066 const quaternion &i_qQuatB, const float32 i_fLerp ); 00067 void QuaternionToAxisAngle( quaternion &i_qQuat, struct vector3 &o_vAxis, 00068 float32 &o_fAngle ); 00069 00070 #include "m3dmath_quaternion.inl" 00071 00072 #endif // __M3DMATH_QUATERNION_H__

Documentation created with doxygen SourceForge.net Logo