94 float m11,
float m12,
float m13,
95 float m21,
float m22,
float m23,
96 float m31,
float m32,
float m33
109 float m11,
float m12,
float m13,
110 float m21,
float m22,
float m23,
111 float m31,
float m32,
float m33
277 Row[0].Set(1.0,0.0,0.0);
278 Row[1].Set(0.0,1.0,0.0);
279 Row[2].Set(0.0,0.0,1.0);
328 Row[0].Set(1.0f,0.0f,0.0f);
329 Row[1].Set(0.0f,1.0f,0.0f);
330 Row[2].Set(0.0f,0.0f,1.0f);
336 float m11,
float m12,
float m13,
337 float m21,
float m22,
float m23,
338 float m31,
float m32,
float m33
341 Row[0].Set(m11,m12,m13);
342 Row[1].Set(m21,m22,m23);
343 Row[2].Set(m31,m32,m33);
348 float m11,
float m12,
float m13,
349 float m21,
float m22,
float m23,
350 float m31,
float m32,
float m33
353 Row[0].Set(m11,m12,m13);
354 Row[1].Set(m21,m22,m23);
355 Row[2].Set(m31,m32,m33);
365 Set(axis,s_angle,c_angle);
370 Set(axis,sinf(angle),cosf(angle));
378 (
float)(axis[0]*axis[0] + c*(1.0f - axis[0]*axis[0])),
379 (
float)(axis[0]*axis[1]*(1.0f - c) - axis[2]*s),
380 (
float)(axis[2]*axis[0]*(1.0f - c) + axis[1]*s)
384 (
float)(axis[0]*axis[1]*(1.0f - c) + axis[2]*s),
385 (
float)(axis[1]*axis[1] + c*(1.0f - axis[1]*axis[1])),
386 (
float)(axis[1]*axis[2]*(1.0f - c) - axis[0]*s)
390 (
float)(axis[2]*axis[0]*(1.0f - c) - axis[1]*s),
391 (
float)(axis[1]*axis[2]*(1.0f - c) + axis[0]*s),
392 (
float)(axis[2]*axis[2] + c*(1 - axis[2]*axis[2]))
441 for (j=0; j<3; j++) {
445 for (i=j+1; i<3; i++) {
463 for (i=0; i<3; i++) {
465 b.
Row[i] -= a[i][j] * b.
Row[j];
466 a.
Row[i] -= a[i][j] * a.
Row[j];
684 float ood = 1.0f / d;
733 #define ROWCOL(i,j) a[i][0]*b[0][j] + a[i][1]*b[1][j] + a[i][2]*b[2][j]
751 a[0][0] * v[0] + a[0][1] * v[1] + a[0][2] * v[2],
752 a[1][0] * v[0] + a[1][1] * v[1] + a[1][2] * v[2],
753 a[2][0] * v[0] + a[2][1] * v[1] + a[2][2] * v[2]
760 return ((a [0] == b [0]) && (a [1] == b [1]) && (a [2] == b [2]));
791 tmp1 =
Row[0][1]; tmp2 =
Row[0][2];
792 Row[0][1] = (float)( c*tmp1 + s*tmp2);
793 Row[0][2] = (float)(-s*tmp1 + c*tmp2);
795 tmp1 =
Row[1][1]; tmp2 =
Row[1][2];
796 Row[1][1] = (float)( c*tmp1 + s*tmp2);
797 Row[1][2] = (float)(-s*tmp1 + c*tmp2);
799 tmp1 =
Row[2][1]; tmp2 =
Row[2][2];
800 Row[2][1] = (float)( c*tmp1 + s*tmp2);
801 Row[2][2] = (float)(-s*tmp1 + c*tmp2);
825 tmp1 =
Row[0][0]; tmp2 =
Row[0][2];
826 Row[0][0] = (float)(c*tmp1 - s*tmp2);
827 Row[0][2] = (float)(s*tmp1 + c*tmp2);
829 tmp1 =
Row[1][0]; tmp2 =
Row[1][2];
830 Row[1][0] = (float)(c*tmp1 - s*tmp2);
831 Row[1][2] = (float)(s*tmp1 + c*tmp2);
833 tmp1 =
Row[2][0]; tmp2 =
Row[2][2];
834 Row[2][0] = (float)(c*tmp1 - s*tmp2);
835 Row[2][2] = (float)(s*tmp1 + c*tmp2);
860 tmp1 =
Row[0][0]; tmp2 =
Row[0][1];
861 Row[0][0] = (float)( c*tmp1 + s*tmp2);
862 Row[0][1] = (float)(-s*tmp1 + c*tmp2);
864 tmp1 =
Row[1][0]; tmp2 =
Row[1][1];
865 Row[1][0] = (float)( c*tmp1 + s*tmp2);
866 Row[1][1] = (float)(-s*tmp1 + c*tmp2);
868 tmp1 =
Row[2][0]; tmp2 =
Row[2][1];
869 Row[2][0] = (float)( c*tmp1 + s*tmp2);
870 Row[2][1] = (float)(-s*tmp1 + c*tmp2);
995 out->
X = (A[0][0] * v->
X + A[0][1] * v->
Y + A[0][2] * v->
Z);
996 out->
Y = (A[1][0] * v->
X + A[1][1] * v->
Y + A[1][2] * v->
Z);
997 out->
Z = (A[2][0] * v->
X + A[2][1] * v->
Y + A[2][2] * v->
Z);
1012 out->
X = (A[0][0] * v->
X + A[1][0] * v->
Y + A[2][0] * v->
Z);
1013 out->
Y = (A[0][1] * v->
X + A[1][1] * v->
Y + A[2][1] * v->
Z);
1014 out->
Z = (A[0][2] * v->
X + A[1][2] * v->
Y + A[2][2] * v->
Z);
1020 for (
int i=0; i<3; i++) {
1024 (*set_extent)[i] = 0.0f;
1026 for (
int j=0; j<3; j++) {
WWINLINE Matrix3x3 & operator/=(float d)
void Re_Orthogonalize(void)
WWINLINE void Rotate_X(float theta)
WWINLINE friend Matrix3x3 operator*(const Matrix3x3 &a, float d)
static const Matrix3x3 RotateX270
WWINLINE Matrix3x3 Inverse(void) const
WWINLINE float Determinant(void) const
WWINLINE Matrix3x3 & operator+=(const Matrix3x3 &m)
WWINLINE Matrix3x3 & operator-=(const Matrix3x3 &m)
float Get_Y_Rotation(void) const
static const Matrix3x3 RotateZ270
static const Matrix3x3 RotateY180
static const Matrix3x3 RotateZ180
WWINLINE friend int operator==(const Matrix3x3 &a, const Matrix3x3 &b)
WWINLINE Vector3 Get_Y_Vector(void) const
static const Matrix3x3 RotateZ90
static const Matrix3x3 RotateY270
WWINLINE void Rotate_Y(float theta)
float Get_Z_Rotation(void) const
WWINLINE Vector3 Get_Z_Vector(void) const
WWINLINE friend Matrix3x3 operator/(const Matrix3x3 &a, float d)
static WWINLINE void Rotate_Vector(const Matrix3x3 &tm, const Vector3 &in, Vector3 *out)
WWINLINE friend Matrix3x3 operator+(const Matrix3x3 &a, const Matrix3x3 &b)
static const Matrix3x3 RotateX180
static WWINLINE void Add(const Matrix3x3 &a, const Matrix3x3 &b, Matrix3x3 *res)
static const Matrix3x3 RotateY90
WWINLINE void Rotate_AABox_Extent(const Vector3 &extent, Vector3 *new_extent)
WWINLINE friend void Swap(Matrix3x3 &a, Matrix3x3 &b)
static void Multiply(const Matrix3x3 &a, const Matrix3x3 &b, Matrix3x3 *res)
WWINLINE Vector3 & operator[](int i)
static const Matrix3x3 Identity
WWINLINE friend int operator!=(const Matrix3x3 &a, const Matrix3x3 &b)
WWINLINE Matrix3x3 & operator*=(float d)
WWINLINE Matrix3x3 Transpose(void) const
static WWINLINE void Subtract(const Matrix3x3 &a, const Matrix3x3 &b, Matrix3x3 *res)
static WWINLINE void Transpose_Rotate_Vector(const Matrix3x3 &tm, const Vector3 &in, Vector3 *out)
WWINLINE void Make_Identity(void)
WWINLINE Matrix3x3 & operator=(const Matrix3x3 &m)
float Get_X_Rotation(void) const
WWINLINE friend Matrix3x3 operator-(const Matrix3x3 &a)
void Set(const Matrix3D &m)
WWINLINE void Rotate_Z(float theta)
WWINLINE Vector3 Get_X_Vector(void) const
int Is_Orthogonal(void) const
static const Matrix3x3 RotateX90
WWINLINE float Length2(void) const
static WWINLINE void Subtract(const Vector3 &a, const Vector3 &b, Vector3 *c)
static WWINLINE void Add(const Vector3 &a, const Vector3 &b, Vector3 *c)
WWINLINE void Set(float x, float y, float z)
static float Atan2(float y, float x)
static WWINLINE float Fabs(float val)
WWINLINE Matrix3x3 operator-(const Matrix3x3 &a)
WWINLINE Matrix3x3 operator+(const Matrix3x3 &a, const Matrix3x3 &b)
WWINLINE Matrix3x3 operator/(const Matrix3x3 &a, float d)
WWINLINE int operator==(const Matrix3x3 &a, const Matrix3x3 &b)
WWINLINE int operator!=(const Matrix3x3 &a, const Matrix3x3 &b)
WWINLINE Matrix3x3 Create_Y_Rotation_Matrix3(float s, float c)
WWINLINE Matrix3x3 operator*(const Matrix3x3 &a, float d)
WWINLINE Matrix3x3 Create_X_Rotation_Matrix3(float s, float c)
WWINLINE Matrix3x3 Create_Z_Rotation_Matrix3(float s, float c)