00001 /**************************************************************************** 00002 * Copyright 2005 Evan Drumwright 00003 * This library is distributed under the terms of the GNU General Public 00004 * License (found in COPYING). 00005 ****************************************************************************/ 00006 00007 #ifndef _MATRIX6_H 00008 #define _MATRIX6_H 00009 00010 #include <Physsim/SVector6.h> 00011 #include <Physsim/Matrix3.h> 00012 #include <Physsim/Matrix4.h> 00013 #include <Physsim/SMatrixN.h> 00014 00015 namespace Physsim { 00016 00017 class Quat; 00018 class AAngle; 00019 00021 class SMatrix6 : public SMatrixN 00022 { 00023 public: 00024 SMatrix6(); 00025 SMatrix6(const SMatrix6& source); 00026 SMatrix6(const MatrixN& source); 00027 SMatrix6(const MatrixNN& source); 00028 Matrix3 get_upper_left() const; 00029 Matrix3 get_upper_right() const; 00030 Matrix3 get_lower_left() const; 00031 Matrix3 get_lower_right() const; 00032 void set_upper_left(const Matrix3& m); 00033 void set_upper_right(const Matrix3& m); 00034 void set_lower_left(const Matrix3& m); 00035 void set_lower_right(const Matrix3& m); 00036 void set_identity(); 00037 virtual void transpose(); 00038 SMatrix6 transpose(const SMatrix6& m); 00039 virtual void operator=(const MatrixN& source) { assert(source.rows() == 6 && source.columns() == 6); MatrixN::operator=(source); } 00040 virtual void operator=(const MatrixNN& source) { assert(source.rows() == 6); MatrixN::operator=(source); } 00041 void operator=(const SMatrix6& source) { MatrixN::operator=(source); } 00042 SVector6 operator*(const SVector6& v) const; 00043 static SMatrix6 spatial_cross(const SVector6& v); 00044 static SMatrix6 calc_spatial_transform(const Matrix4& source, const Matrix4& target); 00045 static SMatrix6 calc_spatial_transform(const Matrix3& sourceR, const Vector3& sourceX, const Matrix3& targetR, const Vector3& targetX); 00046 static SMatrix6 invert_inertia(const SMatrix6& I); 00047 }; // end class 00048 } // end namespace 00049 00050 #endif 00051
1.5.1