Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

mat3_t Class Reference

#include <math_matrix.h>

Collaboration diagram for mat3_t:

Collaboration graph
[legend]

Public Member Functions

void Clear (void)
void Clear (void)
void Identity (void)
void Identity (void)
mat3_t Inverse (void) const
mat3_t Inverse (void) const
 mat3_t (const float xx, const float xy, const float xz, const float yx, const float yy, const float yz, const float zx, const float zy, const float zz)
 mat3_t (idVec3_t const &x, idVec3_t const &y, idVec3_t const &z)
 mat3_t (float src[3][3])
 mat3_t ()
 mat3_t (const float xx, const float xy, const float xz, const float yx, const float yy, const float yz, const float zx, const float zy, const float zz)
 mat3_t (idVec3_t const &x, idVec3_t const &y, idVec3_t const &z)
 mat3_t (float src[3][3])
 mat3_t ()
mat3_t operator * (float a) const
mat3_t operator * (const mat3_t &a) const
idVec3_t operator * (const idVec3_t &vec) const
mat3_t operator * (float a) const
mat3_t operator * (const mat3_t &a) const
idVec3_t operator * (const idVec3_t &vec) const
mat3_toperator *= (float a)
mat3_toperator *= (float a)
mat3_t operator+ (mat3_t const &a) const
mat3_t operator+ (mat3_t const &a) const
mat3_toperator+= (mat3_t const &a)
mat3_toperator+= (mat3_t const &a)
mat3_t operator- (mat3_t const &a) const
mat3_t operator- (mat3_t const &a) const
mat3_toperator-= (mat3_t const &a)
mat3_toperator-= (mat3_t const &a)
idVec3_toperator[] (int index)
idVec3_t operator[] (int index) const
idVec3_toperator[] (int index)
idVec3_t operator[] (int index) const
void OrthoNormalize (void)
void OrthoNormalize (void)
void ProjectVector (const idVec3_t &src, idVec3_t &dst) const
void ProjectVector (const idVec3_t &src, idVec3_t &dst) const
void Transpose (void)
void Transpose (mat3_t &matrix)
void Transpose (void)
void Transpose (mat3_t &matrix)
void UnprojectVector (const idVec3_t &src, idVec3_t &dst) const
void UnprojectVector (const idVec3_t &src, idVec3_t &dst) const

Data Fields

idVec3_t mat [3]

Friends

void InverseMultiply (const mat3_t &inv, const mat3_t &b, mat3_t &dst)
void InverseMultiply (const mat3_t &inv, const mat3_t &b, mat3_t &dst)
mat3_t operator * (float a, mat3_t const &b)
idVec3_t operator * (const idVec3_t &vec, const mat3_t &mat)
mat3_t operator * (float a, mat3_t const &b)
idVec3_t operator * (const idVec3_t &vec, const mat3_t &mat)
mat3_t SkewSymmetric (idVec3_t const &src)
mat3_t SkewSymmetric (idVec3_t const &src)
void toMatrix (idVec3_t const &src, mat3_t &dst)
void toMatrix (angles_t const &src, mat3_t &dst)
void toMatrix (quat_t const &src, mat3_t &dst)
void toMatrix (idVec3_t const &src, mat3_t &dst)
void toMatrix (angles_t const &src, mat3_t &dst)
void toMatrix (quat_t const &src, mat3_t &dst)

Constructor & Destructor Documentation

ID_INLINE mat3_t  ) 
 

Definition at line 83 of file math_matrix.h.

References ID_INLINE.

Referenced by operator *(), operator+(), and operator-().

00083                          {
00084 }

ID_INLINE mat3_t float  src[3][3]  ) 
 

Definition at line 86 of file math_matrix.h.

References ID_INLINE, mat, memcpy(), and src.

00086                                               {
00087     memcpy( mat, src, sizeof( src ) );
00088 }

Here is the call graph for this function:

ID_INLINE mat3_t idVec3_t const &  x,
idVec3_t const &  y,
idVec3_t const &  z
 

Definition at line 90 of file math_matrix.h.

References ID_INLINE, mat, x, idVec3_t::x, y, idVec3_t::y, z, and idVec3_t::z.

00090                                                                                   {
00091     mat[ 0 ].x = x.x; mat[ 0 ].y = x.y; mat[ 0 ].z = x.z;
00092     mat[ 1 ].x = y.x; mat[ 1 ].y = y.y; mat[ 1 ].z = y.z;
00093     mat[ 2 ].x = z.x; mat[ 2 ].y = z.y; mat[ 2 ].z = z.z;
00094 }

ID_INLINE mat3_t const float  xx,
const float  xy,
const float  xz,
const float  yx,
const float  yy,
const float  yz,
const float  zx,
const float  zy,
const float  zz
 

Definition at line 96 of file math_matrix.h.

References ID_INLINE, mat, idVec3_t::x, idVec3_t::y, and idVec3_t::z.

00096                                                                                                                                                                          {
00097     mat[ 0 ].x = xx; mat[ 0 ].y = xy; mat[ 0 ].z = xz;
00098     mat[ 1 ].x = yx; mat[ 1 ].y = yy; mat[ 1 ].z = yz;
00099     mat[ 2 ].x = zx; mat[ 2 ].y = zy; mat[ 2 ].z = zz;
00100 }

mat3_t  ) 
 

mat3_t float  src[3][3]  ) 
 

mat3_t idVec3_t const &  x,
idVec3_t const &  y,
idVec3_t const &  z
 

mat3_t const float  xx,
const float  xy,
const float  xz,
const float  yx,
const float  yy,
const float  yz,
const float  zx,
const float  zy,
const float  zz
 


Member Function Documentation

void Clear void   ) 
 

void Clear void   ) 
 

Definition at line 130 of file math_matrix.cpp.

References mat, and idVec3_t::set().

00130                          {
00131     mat[0].set( 1, 0, 0 );
00132     mat[1].set( 0, 1, 0 );
00133     mat[2].set( 0, 0, 1 );
00134 }

Here is the call graph for this function:

void Identity void   ) 
 

ID_INLINE void Identity void   ) 
 

Definition at line 199 of file math_matrix.h.

References ID_INLINE, mat, idVec3_t::x, idVec3_t::y, and idVec3_t::z.

00199                                       {
00200     mat[ 0 ].x = 1.f; mat[ 0 ].y = 0.f; mat[ 0 ].z = 0.f;
00201     mat[ 1 ].x = 0.f; mat[ 1 ].y = 1.f; mat[ 1 ].z = 0.f;
00202     mat[ 2 ].x = 0.f; mat[ 2 ].y = 0.f; mat[ 2 ].z = 1.f;
00203 }

mat3_t Inverse void   )  const
 

mat3_t Inverse void   )  const
 

Definition at line 122 of file math_matrix.cpp.

References Transpose().

00122                                    {
00123     mat3_t inv( *this );
00124 
00125     inv.Transpose();
00126 
00127     return inv;
00128 }

Here is the call graph for this function:

mat3_t operator * float  a  )  const
 

mat3_t operator * const mat3_t a  )  const
 

idVec3_t operator * const idVec3_t vec  )  const
 

ID_INLINE mat3_t operator * float  a  )  const
 

Definition at line 132 of file math_matrix.h.

References a, ID_INLINE, mat, mat3_t(), x, y, and z.

00132                                                   {
00133     return mat3_t( 
00134         mat[0].x * a, mat[0].y * a, mat[0].z * a, 
00135         mat[1].x * a, mat[1].y * a, mat[1].z * a, 
00136         mat[2].x * a, mat[2].y * a, mat[2].z * a );
00137 }

Here is the call graph for this function:

ID_INLINE mat3_t operator * const mat3_t a  )  const
 

Definition at line 119 of file math_matrix.h.

References a, ID_INLINE, mat, mat3_t(), x, y, and z.

00119                                                           {
00120     return mat3_t( 
00121         mat[0].x * a[0].x + mat[0].y * a[1].x + mat[0].z * a[2].x,
00122         mat[0].x * a[0].y + mat[0].y * a[1].y + mat[0].z * a[2].y,
00123         mat[0].x * a[0].z + mat[0].y * a[1].z + mat[0].z * a[2].z,
00124         mat[1].x * a[0].x + mat[1].y * a[1].x + mat[1].z * a[2].x,
00125         mat[1].x * a[0].y + mat[1].y * a[1].y + mat[1].z * a[2].y,
00126         mat[1].x * a[0].z + mat[1].y * a[1].z + mat[1].z * a[2].z,
00127         mat[2].x * a[0].x + mat[2].y * a[1].x + mat[2].z * a[2].x,
00128         mat[2].x * a[0].y + mat[2].y * a[1].y + mat[2].z * a[2].y,
00129         mat[2].x * a[0].z + mat[2].y * a[1].z + mat[2].z * a[2].z );
00130 }

Here is the call graph for this function:

ID_INLINE idVec3_t operator * const idVec3_t vec  )  const
 

Definition at line 112 of file math_matrix.h.

References ID_INLINE, mat, idVec3_t::x, x, idVec3_t::y, and idVec3_t::z.

00112                                                                 {
00113     return idVec3_t( 
00114         mat[ 0 ].x * vec.x + mat[ 1 ].x * vec.y + mat[ 2 ].x * vec.z,
00115         mat[ 0 ].y * vec.x + mat[ 1 ].y * vec.y + mat[ 2 ].y * vec.z,
00116         mat[ 0 ].z * vec.x + mat[ 1 ].z * vec.y + mat[ 2 ].z * vec.z );
00117 }

mat3_t& operator *= float  a  ) 
 

ID_INLINE mat3_t & operator *= float  a  ) 
 

Definition at line 167 of file math_matrix.h.

References ID_INLINE, mat, idVec3_t::x, idVec3_t::y, and idVec3_t::z.

00167                                               {
00168     mat[0].x *= a; mat[0].y *= a; mat[0].z *= a;
00169     mat[1].x *= a; mat[1].y *= a; mat[1].z *= a; 
00170     mat[2].x *= a; mat[2].y *= a; mat[2].z *= a;
00171 
00172     return *this;
00173 }

mat3_t operator+ mat3_t const &  a  )  const
 

ID_INLINE mat3_t operator+ mat3_t const &  a  )  const
 

Definition at line 139 of file math_matrix.h.

References a, ID_INLINE, mat, mat3_t(), x, y, and z.

00139                                                           {
00140     return mat3_t( 
00141         mat[0].x + a[0].x, mat[0].y + a[0].y, mat[0].z + a[0].z, 
00142         mat[1].x + a[1].x, mat[1].y + a[1].y, mat[1].z + a[1].z, 
00143         mat[2].x + a[2].x, mat[2].y + a[2].y, mat[2].z + a[2].z );
00144 }

Here is the call graph for this function:

mat3_t& operator+= mat3_t const &  a  ) 
 

ID_INLINE mat3_t & operator+= mat3_t const &  a  ) 
 

Definition at line 175 of file math_matrix.h.

References a, ID_INLINE, mat, idVec3_t::x, idVec3_t::y, and idVec3_t::z.

00175                                                       {
00176     mat[0].x += a[0].x; mat[0].y += a[0].y; mat[0].z += a[0].z;
00177     mat[1].x += a[1].x; mat[1].y += a[1].y; mat[1].z += a[1].z;
00178     mat[2].x += a[2].x; mat[2].y += a[2].y; mat[2].z += a[2].z;
00179 
00180     return *this;
00181 }

mat3_t operator- mat3_t const &  a  )  const
 

ID_INLINE mat3_t operator- mat3_t const &  a  )  const
 

Definition at line 146 of file math_matrix.h.

References a, ID_INLINE, mat, mat3_t(), x, y, and z.

00146                                                           {
00147     return mat3_t( 
00148         mat[0].x - a[0].x, mat[0].y - a[0].y, mat[0].z - a[0].z, 
00149         mat[1].x - a[1].x, mat[1].y - a[1].y, mat[1].z - a[1].z, 
00150         mat[2].x - a[2].x, mat[2].y - a[2].y, mat[2].z - a[2].z );
00151 }

Here is the call graph for this function:

mat3_t& operator-= mat3_t const &  a  ) 
 

ID_INLINE mat3_t & operator-= mat3_t const &  a  ) 
 

Definition at line 183 of file math_matrix.h.

References a, ID_INLINE, mat, idVec3_t::x, idVec3_t::y, and idVec3_t::z.

00183                                                       {
00184     mat[0].x -= a[0].x; mat[0].y -= a[0].y; mat[0].z -= a[0].z;
00185     mat[1].x -= a[1].x; mat[1].y -= a[1].y; mat[1].z -= a[1].z;
00186     mat[2].x -= a[2].x; mat[2].y -= a[2].y; mat[2].z -= a[2].z;
00187 
00188     return *this;
00189 }

idVec3_t& operator[] int  index  ) 
 

idVec3_t operator[] int  index  )  const
 

ID_INLINE idVec3_t & operator[] int  index  ) 
 

Definition at line 107 of file math_matrix.h.

References assert, ID_INLINE, and mat.

00107                                                   {
00108     assert( ( index >= 0 ) && ( index < 3 ) );
00109     return mat[ index ];
00110 }

ID_INLINE idVec3_t operator[] int  index  )  const
 

Definition at line 102 of file math_matrix.h.

References assert, ID_INLINE, and mat.

00102                                                        {
00103     assert( ( index >= 0 ) && ( index < 3 ) );
00104     return mat[ index ];
00105 }

void OrthoNormalize void   ) 
 

ID_INLINE void OrthoNormalize void   ) 
 

Definition at line 191 of file math_matrix.h.

References idVec3_t::Cross(), ID_INLINE, mat, and idVec3_t::Normalize().

00191                                             {
00192     mat[ 0 ].Normalize();
00193     mat[ 2 ].Cross( mat[ 0 ], mat[ 1 ] );
00194     mat[ 2 ].Normalize();
00195     mat[ 1 ].Cross( mat[ 2 ], mat[ 0 ] );
00196     mat[ 1 ].Normalize();
00197 }

Here is the call graph for this function:

void ProjectVector const idVec3_t src,
idVec3_t dst
const
 

void ProjectVector const idVec3_t src,
idVec3_t dst
const
 

Definition at line 87 of file math_matrix.cpp.

References mat, src, idVec3_t::x, idVec3_t::y, and idVec3_t::z.

00087                                                                      {
00088     dst.x = src * mat[ 0 ];
00089     dst.y = src * mat[ 1 ];
00090     dst.z = src * mat[ 2 ];
00091 }

void Transpose void   ) 
 

void Transpose mat3_t matrix  ) 
 

void Transpose void   ) 
 

Definition at line 108 of file math_matrix.cpp.

References i, j, and mat.

00108                              {
00109     float   temp;
00110     int     i;
00111     int     j;
00112    
00113     for( i = 0; i < 3; i++ ) {
00114         for( j = i + 1; j < 3; j++ ) {
00115             temp = mat[ i ][ j ];
00116             mat[ i ][ j ] = mat[ j ][ i ];
00117             mat[ j ][ i ] = temp;
00118         }
00119     }
00120 }

void Transpose mat3_t matrix  ) 
 

Definition at line 97 of file math_matrix.cpp.

References i, j, and mat.

Referenced by Inverse().

00097                                        {
00098     int i;
00099     int j;
00100    
00101     for( i = 0; i < 3; i++ ) {
00102         for( j = 0; j < 3; j++ ) {
00103             matrix[ i ][ j ] = mat[ j ][ i ];
00104         }
00105     }
00106 }

void UnprojectVector const idVec3_t src,
idVec3_t dst
const
 

void UnprojectVector const idVec3_t src,
idVec3_t dst
const
 

Definition at line 93 of file math_matrix.cpp.

References mat, src, coord::x, and coord::y.

00093                                                                        {
00094     dst = mat[ 0 ] * src.x + mat[ 1 ] * src.y + mat[ 2 ] * src.z;
00095 }


Friends And Related Function Documentation

void InverseMultiply const mat3_t inv,
const mat3_t b,
mat3_t dst
[friend]
 

Definition at line 205 of file math_matrix.h.

00205                                                                                   {
00206     dst[0].x = inv[0].x * b[0].x + inv[1].x * b[1].x + inv[2].x * b[2].x;
00207     dst[0].y = inv[0].x * b[0].y + inv[1].x * b[1].y + inv[2].x * b[2].y;
00208     dst[0].z = inv[0].x * b[0].z + inv[1].x * b[1].z + inv[2].x * b[2].z;
00209     dst[1].x = inv[0].y * b[0].x + inv[1].y * b[1].x + inv[2].y * b[2].x;
00210     dst[1].y = inv[0].y * b[0].y + inv[1].y * b[1].y + inv[2].y * b[2].y;
00211     dst[1].z = inv[0].y * b[0].z + inv[1].y * b[1].z + inv[2].y * b[2].z;
00212     dst[2].x = inv[0].z * b[0].x + inv[1].z * b[1].x + inv[2].z * b[2].x;
00213     dst[2].y = inv[0].z * b[0].y + inv[1].z * b[1].y + inv[2].z * b[2].y;
00214     dst[2].z = inv[0].z * b[0].z + inv[1].z * b[1].z + inv[2].z * b[2].z;
00215 }

void InverseMultiply const mat3_t inv,
const mat3_t b,
mat3_t dst
[friend]
 

Definition at line 205 of file math_matrix.h.

00205                                                                                   {
00206     dst[0].x = inv[0].x * b[0].x + inv[1].x * b[1].x + inv[2].x * b[2].x;
00207     dst[0].y = inv[0].x * b[0].y + inv[1].x * b[1].y + inv[2].x * b[2].y;
00208     dst[0].z = inv[0].x * b[0].z + inv[1].x * b[1].z + inv[2].x * b[2].z;
00209     dst[1].x = inv[0].y * b[0].x + inv[1].y * b[1].x + inv[2].y * b[2].x;
00210     dst[1].y = inv[0].y * b[0].y + inv[1].y * b[1].y + inv[2].y * b[2].y;
00211     dst[1].z = inv[0].y * b[0].z + inv[1].y * b[1].z + inv[2].y * b[2].z;
00212     dst[2].x = inv[0].z * b[0].x + inv[1].z * b[1].x + inv[2].z * b[2].x;
00213     dst[2].y = inv[0].z * b[0].y + inv[1].z * b[1].y + inv[2].z * b[2].y;
00214     dst[2].z = inv[0].z * b[0].z + inv[1].z * b[1].z + inv[2].z * b[2].z;
00215 }

mat3_t operator * float  a,
mat3_t const &  b
[friend]
 

Definition at line 160 of file math_matrix.h.

00160                                                        {
00161     return mat3_t( 
00162         b[0].x * a, b[0].y * a, b[0].z * a, 
00163         b[1].x * a, b[1].y * a, b[1].z * a, 
00164         b[2].x * a, b[2].y * a, b[2].z * a );
00165 }

idVec3_t operator * const idVec3_t vec,
const mat3_t mat
[friend]
 

Definition at line 153 of file math_matrix.h.

00153                                                                        {
00154     return idVec3_t( 
00155         mat[ 0 ].x * vec.x + mat[ 1 ].x * vec.y + mat[ 2 ].x * vec.z,
00156         mat[ 0 ].y * vec.x + mat[ 1 ].y * vec.y + mat[ 2 ].y * vec.z,
00157         mat[ 0 ].z * vec.x + mat[ 1 ].z * vec.y + mat[ 2 ].z * vec.z );
00158 }

mat3_t operator * float  a,
mat3_t const &  b
[friend]
 

Definition at line 160 of file math_matrix.h.

00160                                                        {
00161     return mat3_t( 
00162         b[0].x * a, b[0].y * a, b[0].z * a, 
00163         b[1].x * a, b[1].y * a, b[1].z * a, 
00164         b[2].x * a, b[2].y * a, b[2].z * a );
00165 }

idVec3_t operator * const idVec3_t vec,
const mat3_t mat
[friend]
 

Definition at line 153 of file math_matrix.h.

00153                                                                        {
00154     return idVec3_t( 
00155         mat[ 0 ].x * vec.x + mat[ 1 ].x * vec.y + mat[ 2 ].x * vec.z,
00156         mat[ 0 ].y * vec.x + mat[ 1 ].y * vec.y + mat[ 2 ].y * vec.z,
00157         mat[ 0 ].z * vec.x + mat[ 1 ].z * vec.y + mat[ 2 ].z * vec.z );
00158 }

mat3_t SkewSymmetric idVec3_t const &  src  )  [friend]
 

Definition at line 217 of file math_matrix.h.

00217                                                       {
00218     return mat3_t( 0.0f, -src.z,  src.y, src.z,   0.0f, -src.x, -src.y,  src.x,   0.0f );
00219 }

mat3_t SkewSymmetric idVec3_t const &  src  )  [friend]
 

Definition at line 217 of file math_matrix.h.

00217                                                       {
00218     return mat3_t( 0.0f, -src.z,  src.y, src.z,   0.0f, -src.x, -src.y,  src.x,   0.0f );
00219 }

void toMatrix idVec3_t const &  src,
mat3_t dst
[friend]
 

Definition at line 82 of file math_matrix.cpp.

00082                                                   {
00083         angles_t sup = src;
00084         toMatrix(sup, dst);
00085 }

void toMatrix angles_t const &  src,
mat3_t dst
[friend]
 

Definition at line 61 of file math_matrix.cpp.

00061                                                   {
00062     float           angle;
00063     static float    sr, sp, sy, cr, cp, cy; // static to help MS compiler fp bugs
00064         
00065     angle = src.yaw * ( M_PI * 2.0f / 360.0f );
00066     sy = sin( angle );
00067     cy = cos( angle );
00068 
00069     angle = src.pitch * ( M_PI * 2.0f / 360.0f );
00070     sp = sin( angle );
00071     cp = cos( angle );
00072 
00073     angle = src.roll * ( M_PI * 2.0f / 360.0f );
00074     sr = sin( angle );
00075     cr = cos( angle );
00076 
00077     dst[ 0 ].set( cp * cy, cp * sy, -sp );
00078     dst[ 1 ].set( sr * sp * cy + cr * -sy, sr * sp * sy + cr * cy, sr * cp );
00079     dst[ 2 ].set( cr * sp * cy + -sr * -sy, cr * sp * sy + -sr * cy, cr * cp );
00080 }

void toMatrix quat_t const &  src,
mat3_t dst
[friend]
 

Definition at line 26 of file math_matrix.cpp.

00026                                                 {
00027     float   wx, wy, wz;
00028     float   xx, yy, yz;
00029     float   xy, xz, zz;
00030     float   x2, y2, z2;
00031 
00032     x2 = src.x + src.x;
00033     y2 = src.y + src.y;
00034     z2 = src.z + src.z;
00035 
00036     xx = src.x * x2;
00037     xy = src.x * y2;
00038     xz = src.x * z2;
00039 
00040     yy = src.y * y2;
00041     yz = src.y * z2;
00042     zz = src.z * z2;
00043 
00044     wx = src.w * x2;
00045     wy = src.w * y2;
00046     wz = src.w * z2;
00047 
00048     dst[ 0 ][ 0 ] = 1.0f - ( yy + zz );
00049     dst[ 0 ][ 1 ] = xy - wz;
00050     dst[ 0 ][ 2 ] = xz + wy;
00051 
00052     dst[ 1 ][ 0 ] = xy + wz;
00053     dst[ 1 ][ 1 ] = 1.0f - ( xx + zz );
00054     dst[ 1 ][ 2 ] = yz - wx;
00055 
00056     dst[ 2 ][ 0 ] = xz - wy;
00057     dst[ 2 ][ 1 ] = yz + wx;
00058     dst[ 2 ][ 2 ] = 1.0f - ( xx + yy );
00059 }

void toMatrix idVec3_t const &  src,
mat3_t dst
[friend]
 

Definition at line 82 of file math_matrix.cpp.

00082                                                   {
00083         angles_t sup = src;
00084         toMatrix(sup, dst);
00085 }

void toMatrix angles_t const &  src,
mat3_t dst
[friend]
 

Definition at line 61 of file math_matrix.cpp.

00061                                                   {
00062     float           angle;
00063     static float    sr, sp, sy, cr, cp, cy; // static to help MS compiler fp bugs
00064         
00065     angle = src.yaw * ( M_PI * 2.0f / 360.0f );
00066     sy = sin( angle );
00067     cy = cos( angle );
00068 
00069     angle = src.pitch * ( M_PI * 2.0f / 360.0f );
00070     sp = sin( angle );
00071     cp = cos( angle );
00072 
00073     angle = src.roll * ( M_PI * 2.0f / 360.0f );
00074     sr = sin( angle );
00075     cr = cos( angle );
00076 
00077     dst[ 0 ].set( cp * cy, cp * sy, -sp );
00078     dst[ 1 ].set( sr * sp * cy + cr * -sy, sr * sp * sy + cr * cy, sr * cp );
00079     dst[ 2 ].set( cr * sp * cy + -sr * -sy, cr * sp * sy + -sr * cy, cr * cp );
00080 }

void toMatrix quat_t const &  src,
mat3_t dst
[friend]
 

Definition at line 26 of file math_matrix.cpp.

00026                                                 {
00027     float   wx, wy, wz;
00028     float   xx, yy, yz;
00029     float   xy, xz, zz;
00030     float   x2, y2, z2;
00031 
00032     x2 = src.x + src.x;
00033     y2 = src.y + src.y;
00034     z2 = src.z + src.z;
00035 
00036     xx = src.x * x2;
00037     xy = src.x * y2;
00038     xz = src.x * z2;
00039 
00040     yy = src.y * y2;
00041     yz = src.y * z2;
00042     zz = src.z * z2;
00043 
00044     wx = src.w * x2;
00045     wy = src.w * y2;
00046     wz = src.w * z2;
00047 
00048     dst[ 0 ][ 0 ] = 1.0f - ( yy + zz );
00049     dst[ 0 ][ 1 ] = xy - wz;
00050     dst[ 0 ][ 2 ] = xz + wy;
00051 
00052     dst[ 1 ][ 0 ] = xy + wz;
00053     dst[ 1 ][ 1 ] = 1.0f - ( xx + zz );
00054     dst[ 1 ][ 2 ] = yz - wx;
00055 
00056     dst[ 2 ][ 0 ] = xz - wy;
00057     dst[ 2 ][ 1 ] = yz + wx;
00058     dst[ 2 ][ 2 ] = 1.0f - ( xx + yy );
00059 }


Field Documentation

idVec3_t mat
 

Definition at line 41 of file math_matrix.h.

Referenced by Clear(), Identity(), mat3_t(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator[](), OrthoNormalize(), ProjectVector(), Transpose(), and UnprojectVector().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 19:56:23 2005 for Quake III Arena by  doxygen 1.3.9.1