Changeset 2751 for GTP/trunk/App/Demos/Vis/CHC_revisited/Matrix4x4.cpp
- Timestamp:
- 06/10/08 13:15:59 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/CHC_revisited/Matrix4x4.cpp
r2746 r2751 6 6 using namespace std; 7 7 8 //namespace GtpVisibilityPreprocessor { 8 namespace CHCDemo 9 { 10 11 Matrix4x4::Matrix4x4() 12 {} 9 13 10 14 … … 85 89 x[3][3] = x44; 86 90 } 91 92 93 float Matrix4x4::Det3x3() const 94 { 95 return (x[0][0]*x[1][1]*x[2][2] + \ 96 x[1][0]*x[2][1]*x[0][2] + \ 97 x[2][0]*x[0][1]*x[1][2] - \ 98 x[2][0]*x[1][1]*x[0][2] - \ 99 x[0][0]*x[2][1]*x[1][2] - \ 100 x[1][0]*x[0][1]*x[2][2]); 101 } 102 87 103 88 104 … … 167 183 } 168 184 185 169 186 // Invert the given matrix using the above inversion routine. 170 Matrix4x4 171 Invert(const Matrix4x4& M) 187 Matrix4x4 Invert(const Matrix4x4& M) 172 188 { 173 189 Matrix4x4 InvertMe = M; … … 178 194 179 195 // Transpose the matrix. 180 void 181 Matrix4x4::Transpose() 196 void Matrix4x4::Transpose() 182 197 { 183 198 for (int i = 0; i < 4; i++) … … 190 205 } 191 206 207 192 208 // Transpose the given matrix using the transpose routine above. 193 Matrix4x4 194 Transpose(const Matrix4x4& M) 209 Matrix4x4 Transpose(const Matrix4x4& M) 195 210 { 196 211 Matrix4x4 TransposeMe = M; … … 199 214 } 200 215 216 201 217 // Construct an identity matrix. 202 Matrix4x4 203 IdentityMatrix() 218 Matrix4x4 IdentityMatrix() 204 219 { 205 220 Matrix4x4 M; … … 211 226 } 212 227 228 213 229 // Construct a zero matrix. 214 Matrix4x4 215 ZeroMatrix() 230 Matrix4x4 ZeroMatrix() 216 231 { 217 232 Matrix4x4 M; … … 635 650 } 636 651 637 //}652 }
Note: See TracChangeset
for help on using the changeset viewer.