00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00022
00023
#ifndef __M3DMATH_MATRIX44_H__
00024
#define __M3DMATH_MATRIX44_H__
00025
00026
#include "m3dmath_common.h"
00027
#include "m3dmath_vector4.h"
00028
00029
struct matrix44
00030 {
00031
union
00032
{
00033
struct
00034
{
00035
float32 _11, _12, _13, _14;
00036
float32 _21, _22, _23, _24;
00037
float32 _31, _32, _33, _34;
00038
float32 _41, _42, _43, _44;
00039 };
00040
struct {
float32 m[4][4]; };
00041 };
00042
00043 matrix44();
00044 matrix44(
const matrix44 &i_matVal );
00045 matrix44(
const float32 i_f11,
const float32 i_f12,
const float32 i_f13,
const float32 i_f14,
00046
const float32 i_f21,
const float32 i_f22,
const float32 i_f23,
const float32 i_f24,
00047
const float32 i_f31,
const float32 i_f32,
const float32 i_f33,
const float32 i_f34,
00048
const float32 i_f41,
const float32 i_f42,
const float32 i_f43,
const float32 i_f44 );
00049 matrix44(
const struct vector4 &i_vRow0,
const struct vector4 &i_vRow1,
const struct vector4 &i_vRow2,
const struct vector4 &i_vRow3 );
00050
00051
const matrix44 &operator =(
const matrix44 &i_matVal );
00052
00053 operator float32*();
00054 operator const float32*() const;
00055
float32 operator()( const
uint32 i_iRow, const
uint32 i_iCol ) const;
00056
00057 matrix44 operator +() const;
00058 matrix44 operator -() const;
00059
00060 const matrix44 &operator +=( const matrix44 &i_matVal );
00061 const matrix44 &operator -=( const matrix44 &i_matVal );
00062 const matrix44 &operator *=( const matrix44 &i_matVal );
00063 const matrix44 &operator *=( const
float32 i_fVal );
00064 const matrix44 &operator /=( const
float32 i_fVal );
00065
00066 matrix44 operator +( const matrix44 &i_matVal ) const;
00067 matrix44 operator -( const matrix44 &i_matVal ) const;
00068 matrix44 operator *( const matrix44 &i_matVal ) const;
00069 matrix44 operator *( const
float32 i_fVal ) const;
00070 matrix44 operator /( const
float32 i_fVal ) const;
00071
00072
float32 determinant() const;
00073 };
00074
00075 matrix44 &matMatrix44Transpose( matrix44 &o_matMatOut, const matrix44 i_matMat );
00076 matrix44 &matMatrix44Identity( matrix44 &o_matMatOut );
00077 matrix44 &matMatrix44Scaling( matrix44 &o_matMatOut, const
float32 i_fX,
00078 const
float32 i_fY, const
float32 i_fZ );
00079 matrix44 &matMatrix44Scaling( matrix44 &o_matMatOut,
00080 const struct vector3 &i_vScale );
00081 matrix44 &matMatrix44Translation( matrix44 &o_matMatOut,
00082 const
float32 i_fX, const
float32 i_fY,
00083 const
float32 i_fZ );
00084 matrix44 &matMatrix44Translation( matrix44 &o_matMatOut,
00085 const struct vector3 &i_vTranslation );
00086 matrix44 &matMatrix44RotationX( matrix44 &o_matMatOut, const
float32 i_fRot );
00087 matrix44 &matMatrix44RotationY( matrix44 &o_matMatOut, const
float32 i_fRot );
00088 matrix44 &matMatrix44RotationZ( matrix44 &o_matMatOut, const
float32 i_fRot );
00089 matrix44 &matMatrix44RotationYawPitchRoll( matrix44 &o_matMatOut,
00090 const
float32 i_fYaw,
00091 const
float32 i_fPitch,
00092 const
float32 i_fRoll );
00093 matrix44 &matMatrix44RotationYawPitchRoll( matrix44 &o_matMatOut,
00094 const struct vector3 &i_vRot );
00095 matrix44 &matMatrix44RotationAxis( matrix44 &o_matMatOut,
00096 const struct vector3 &i_vAxis, const
float32 i_fRot );
00097 matrix44 &matMatrix44RotationQuaternion( matrix44 &o_matMatOut,
00098 const struct quaternion &i_qQuat );
00099 matrix44 &matMatrix44LookAtLH( matrix44 &o_matMatOut,
00100 const struct vector3 &i_vEye,
00101 const struct vector3 &i_vAt,
00102 const struct vector3 &i_vUp );
00103 matrix44 &matMatrix44LookAtRH( matrix44 &o_matMatOut,
00104 const struct vector3 &i_vEye,
00105 const struct vector3 &i_vAt,
00106 const struct vector3 &i_vUp );
00107 matrix44 &matMatrix44OrthoLH( matrix44 &o_matMatOut, const
float32 i_fWidth,
00108 const
float32 i_fHeight, const
float32 i_fZNear,
00109 const
float32 i_fZFar );
00110 matrix44 &matMatrix44OrthoRH( matrix44 &o_matMatOut, const
float32 i_fWidth,
00111 const
float32 i_fHeight, const
float32 i_fZNear,
00112 const
float32 i_fZFar );
00113 matrix44 &matMatrix44OrthoOffCenterLH( matrix44 &o_matMatOut, const
float32 i_fLeft,
00114 const
float32 i_fRight, const
float32 i_fBottom,
00115 const
float32 i_fTop, const
float32 i_fZNear,
00116 const
float32 i_fZFar );
00117 matrix44 &matMatrix44OrthoOffCenterRH( matrix44 &o_matMatOut, const
float32 i_fLeft,
00118 const
float32 i_fRight, const
float32 i_fBottom,
00119 const
float32 i_fTop, const
float32 i_fZNear,
00120 const
float32 i_fZFar );
00121 matrix44 &matMatrix44PerspectiveFovLH( matrix44 &o_matMatOut, const
float32 i_fFOVY,
00122 const
float32 i_fAspect, const
float32 i_fZNear,
00123 const
float32 i_fZFar );
00124 matrix44 &matMatrix44PerspectiveFovRH( matrix44 &o_matMatOut, const
float32 i_fFOVY,
00125 const
float32 i_fAspect, const
float32 i_fZNear,
00126 const
float32 i_fZFar );
00127 matrix44 &matMatrix44PerspectiveLH( matrix44 &o_matMatOut, const
float32 i_fWidth,
00128 const
float32 i_fHeight, const
float32 i_fZNear,
00129 const
float32 i_fZFar );
00130 matrix44 &matMatrix44PerspectiveRH( matrix44 &o_matMatOut, const
float32 i_fWidth,
00131 const
float32 i_fHeight, const
float32 i_fZNear,
00132 const
float32 i_fZFar );
00133 matrix44 &matMatrix44PerspectiveOffCenterLH( matrix44 &o_matMatOut,
00134 const
float32 i_fLeft,
00135 const
float32 i_fRight,
00136 const
float32 i_fBottom,
00137 const
float32 i_fTop,
00138 const
float32 i_fZNear,
00139 const
float32 i_fZFar );
00140 matrix44 &matMatrix44PerspectiveOffCenterRH( matrix44 &o_matMatOut,
00141 const
float32 i_fLeft,
00142 const
float32 i_fRight,
00143 const
float32 i_fBottom,
00144 const
float32 i_fTop,
00145 const
float32 i_fZNear,
00146 const
float32 i_fZFar );
00147 matrix44 &matMatrix44Viewport( matrix44 &o_matMatOut, const
uint32 i_iX,
00148 const
uint32 i_iY, const
uint32 i_iWidth,
00149 const
uint32 i_iHeight, const
float32 i_fZNear,
00150 const
float32 i_fZFar );
00151
00152 #include "m3dmath_matrix44.inl"
00153
00154 #endif