deVector6.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 _deVector6_h
00024 #define _deVector6_h
00025 
00033 class deVector6
00034 {
00035 public:
00037         DE_MATH_API deVector3& operator[](deInt row);
00039         DE_MATH_API const deVector3& operator[](deInt row) const;
00041         DE_MATH_API deFloat& elementAt(deInt i);
00043         DE_MATH_API const deFloat& elementAt(deInt i) const;
00045         DE_MATH_API void operator=(const deVector6& v);
00047         DE_MATH_API void zero();
00049         DE_MATH_API void negate(const deVector6& v);
00051         DE_MATH_API void add(const deVector6& v1, const deVector6& v2);
00053         DE_MATH_API void subtract(const deVector6& v1, const deVector6& v2);
00055         DE_MATH_API void multiply(const deVector6& v, const deFloat s);
00057         DE_MATH_API void multiply(const deMatrix6& m, const deVector6& v);
00059         DE_MATH_API void transposedMultiply(const deMatrix6& m, const deVector6& v);
00061         DE_MATH_API void error(const deTransform& T, const deTransform& Td);
00063         DE_MATH_API void error(const deFrame &F, const deFrame &Fd);
00065         DE_MATH_API void operator+=(const deVector6& v);
00067         DE_MATH_API void operator-=(const deVector6& v);
00069         DE_MATH_API void operator*=(const deFloat s);
00071         DE_MATH_API deFloat dot(const deVector6& v) const;
00073         DE_MATH_API void solve(const deMatrix6& m, const deVector6& y);
00075         DE_MATH_API void solveSPD(const deMatrix6& m, const deVector6& y);
00076 
00080         //      @{
00082         // X = [ R 0; dxR R ]
00083         // Fh = X Fi
00084         //    = [ R fi ; dxR fi + R ni ]
00085         DE_MATH_API void xform(const deTransform& t, const deVector6& v);
00087         // Xt = [ Rt -Rtdx; 0 Rt ]
00088         // Vi = Xt Vh
00089         //    = [ Rtvh - Rtdxwh; Rtwh ]
00090         //    = [ Rt(vh - dxwh); Rtwh ]
00091         DE_MATH_API void xformT(const deTransform& t, const deVector6& v);
00093         // Xtinv = [ R dxR; 0 R ]
00094         // Vi = Xtinv Vh
00095         //    = [ R vh + dxR wh;  R wh ]
00096         DE_MATH_API void xformInvT(const deTransform& t, const deVector6& v);
00098         // Xinv = [ Rt 0; -Rtdx Rt ]
00099         // Vh = Xinv Vi
00100         //    = [ Rtvi ; -Rtdxvi + Rtwi ]
00101         //    = [ Rtvi ; Rt(wi - dxvi) ]
00102         DE_MATH_API void xformInv(const deTransform& t, const deVector6& v);
00104         //                            = [ v1 x tmp0 + v0 x tmp1; v1 x tmp1 ]
00105         DE_MATH_API void crossMultiply(const deVector6& v1, const deVector6& v2);
00106         //      @}
00107 
00109         void backSub(const deMatrix6& lu, const deVector6& y);
00111         void backSubSPD(const deMatrix6& lu, const deVector6& y);
00112 
00113 private:
00114         deVector3 _vec3[2];
00115 };
00116 
00117 #endif // _deVector6_h

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