deMatrix3.h

Go to the documentation of this file.
00001 /* Copyright (c) 2005 Arachi, Inc. and Stanford University.
00002  *
00003  * Permission is hereby granted, free of charge, to any person obtaining
00004  * a copy of this software and associated documentation files (the
00005  * "Software"), to deal in the Software without restriction, including
00006  * without limitation the rights to use, copy, modify, merge, publish,
00007  * distribute, sublicense, and/or sell copies of the Software, and to
00008  * permit persons to whom the Software is furnished to do so, subject
00009  * to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included
00012  * in all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00018  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00019  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00020  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00021  */
00022 
00023 #ifndef _deMatrix3_h
00024 #define _deMatrix3_h
00025 
00033 class deMatrix3
00034 {
00035 public:
00037         operator deFloat*() { return _data[0]; }
00039         operator const deFloat*() const { return _data[0]; }
00041         deFloat* operator[](const deInt row) { return _data[row]; }
00043         const deFloat* operator[](const deInt row) const { return _data[row]; }
00045         deFloat& elementAt(const deInt i, const deInt j) { return _data[i][j]; }
00047         const deFloat& elementAt(const deInt i, const deInt j) const { return _data[i][j]; }
00049         DE_MATH_API void operator=(const deMatrix3& m);
00051         DE_MATH_API void zero();
00053         DE_MATH_API void identity();
00055         DE_MATH_API void negate(const deMatrix3& m);
00057         DE_MATH_API void add(const deMatrix3& m1, const deMatrix3& m2);
00059         DE_MATH_API void subtract(const deMatrix3& m1, const deMatrix3& m2);
00061         DE_MATH_API void multiply(const deMatrix3& m1, const deMatrix3& m2);
00063         DE_MATH_API void transposedMultiply(const deMatrix3& m1, const deMatrix3& m2);
00065         DE_MATH_API void multiplyTransposed(const deMatrix3& m1, const deMatrix3& m2);
00067         DE_MATH_API void multiply(const deMatrix3& m, const deFloat s);
00069         DE_MATH_API void operator+=(const deMatrix3& m);
00071         DE_MATH_API void operator-=(const deMatrix3& m);
00073         DE_MATH_API void operator*=(const deFloat s);
00075         DE_MATH_API void diagonal(const deFloat x, const deFloat y, const deFloat z);
00077         DE_MATH_API void diagonal(const deVector3& v);
00078 
00082         // @{
00084         DE_MATH_API void eulerXYZ(const deFloat x, const deFloat y, const deFloat z);
00086         DE_MATH_API void eulerZYX(const deFloat x, const deFloat y, const deFloat z);
00088         DE_MATH_API void set(const deQuaternion& q);
00090         DE_MATH_API void set(const deInt axis, const deFloat angle); 
00092         DE_MATH_API void set(const deVector3& axis, const deFloat angle);
00094         DE_MATH_API void set(const deFloat a0, const deFloat a1, const deFloat a2,
00095                         const deFloat a3, const deFloat a4, const deFloat a5,
00096                         const deFloat a6, const deFloat a7, const deFloat a8);
00097         // @}
00098 
00100         DE_MATH_API deFloat det() const;
00102         DE_MATH_API void inverseDet(const deMatrix3& m);
00104         DE_MATH_API void inverseDetSPD(const deMatrix3& m);
00106         DE_MATH_API void ludecomp(const deMatrix3& m);
00108         DE_MATH_API void transpose(const deMatrix3& m);
00110         DE_MATH_API void multiplyTransposed(const deVector3& v1, const deVector3& v2);
00112         DE_MATH_API void crossMultiply(const deVector3& v, const deMatrix3& m);
00114         DE_MATH_API void cross(const deVector3& v);
00116         DE_MATH_API void multiplyCross(const deMatrix3& m, const deVector3& v);
00117 
00118         friend class deVector3;
00119         friend class deQuaternion;
00120 
00121 private:
00122         deFloat _data[DE_MATRIX3_ROW][DE_MATRIX3_COL];
00123 };
00124 
00125 #endif // _deMatrix3_h

Generated on Sun Apr 9 22:12:42 2006 for TAO by  doxygen 1.4.6-NO