From 38a23c4dc4875d6502f05f3d6584ce60a65981ca Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 19 Jan 2005 23:01:06 +0000 Subject: Added a Matrix Transpose function. git-svn-id: http://svn.leocad.org/trunk@368 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/matrix.cpp | 9 +++++++++ common/matrix.h | 9 +++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/matrix.cpp b/common/matrix.cpp index e232d08..27a199a 100644 --- a/common/matrix.cpp +++ b/common/matrix.cpp @@ -664,6 +664,15 @@ bool Matrix::FromInverse(double* src) return true; } +void Matrix::Transpose3() +{ + float tmp; + + tmp = m[1]; m[1] = m[4]; m[4] = tmp; + tmp = m[2]; m[2] = m[8]; m[8] = tmp; + tmp = m[6]; m[6] = m[9]; m[9] = tmp; +} + bool Matrix::Invert () { double t, inverse[16]; diff --git a/common/matrix.h b/common/matrix.h index 7da4d1d..733f16b 100644 --- a/common/matrix.h +++ b/common/matrix.h @@ -28,10 +28,11 @@ class Matrix void ToEulerAngles (float *rot) const; void ToAxisAngle (float *rot) const; - void LoadIdentity (); - void Translate (float x, float y, float z); - void Multiply (Matrix& m1, Matrix& m2); - bool Invert (); + void LoadIdentity(); + void Translate(float x, float y, float z); + void Multiply(Matrix& m1, Matrix& m2); + bool Invert(); + void Transpose3(); -- cgit v1.2.3