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

Information | Reference | SourceForge Project | Author
Muli3D

Reference: Muli3D: m3dmath_vector3.h Source File

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

Documentation created with doxygen SourceForge.net Logo