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

Information | Reference | SourceForge Project | Author
Muli3D

Reference: Muli3D: m3dmath_vector4.h Source File

m3dmath_vector4.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_VECTOR4_H__ 00024 #define __M3DMATH_VECTOR4_H__ 00025 00026 #include "m3dmath_common.h" 00027 00028 struct vector4 00029 { 00030 union 00031 { 00032 struct { float32 x, y, z, w; }; 00033 struct { float32 r, g, b, a; }; 00034 }; 00035 00036 vector4(); 00037 vector4( const vector4 &i_vVal ); 00038 vector4( const float32 i_fX, const float32 i_fY, const float32 i_fZ, const float32 i_fW ); 00039 vector4( const struct vector3 &i_vVal ); 00040 vector4( const struct vector2 &i_vVal ); 00041 00042 const vector4 &operator =( const vector4 &i_vVal ); 00043 const vector4 &operator =( const struct vector3 &i_vVal ); 00044 const vector4 &operator =( const struct vector2 &i_vVal ); 00045 const vector4 &operator =( const float32 i_fVal ); 00046 00047 operator float32*(); 00048 operator const float32*() const; 00049 00050 vector4 operator +() const; 00051 vector4 operator -() const; 00052 00053 const vector4 &operator +=( const vector4 &i_vVal ); 00054 const vector4 &operator -=( const vector4 &i_vVal ); 00055 const vector4 &operator *=( const vector4 &i_vVal ); 00056 const vector4 &operator *=( const struct matrix44 &i_matVal ); 00057 const vector4 &operator *=( const float32 i_fVal ); 00058 const vector4 &operator /=( const float32 i_fVal ); 00059 00060 vector4 operator +( const vector4 &i_vVal ) const; 00061 vector4 operator -( const vector4 &i_vVal ) const; 00062 vector4 operator *( const vector4 &i_vVal ) const; 00063 vector4 operator *( const struct matrix44 &i_matVal ) const; 00064 vector4 operator *( const float32 i_fVal ) const; 00065 vector4 operator /( const float32 i_fVal ) const; 00066 00067 float32 length() const; 00068 float32 lengthsq() const; 00069 00070 vector4 &normalize(); 00071 vector4 &homogenize(); 00072 00073 vector4 &clamp( const float32 i_fLower, const float32 i_fUpper ); 00074 vector4 &saturate(); 00075 }; 00076 00077 float32 fVector4Dot( const vector4 &i_vVecA, const vector4 &i_vVecB ); 00078 vector4 &vVector4Lerp( vector4 &o_vVecOut, const vector4 &i_vVecA, const vector4 &i_vVecB, const float32 i_fInterpolation ); 00079 00080 #include "m3dmath_vector4.inl" 00081 00082 #endif // __M3DMATH_VECTOR4_H__

Documentation created with doxygen SourceForge.net Logo