taoDynamics.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 _taoDynamics_h
00024 #define _taoDynamics_h
00025 
00026 #include "taoTypes.h"
00027 
00028 class taoDNode;
00029 class deVector3;
00030 class deVector6;
00031 
00038 class taoDynamics
00039 {
00040 public:
00041         static void initialize(taoDNode* root);
00045         static void reset(taoDNode* root);
00046         static void updateTransformation(taoDNode* root);
00047 
00048         static void integrate(taoDNode* root, deFloat dt);
00049 
00051 
00055         static void globalJacobian(taoDNode* root);
00056 
00058 
00062         static void invDynamics(taoDNode* root, deVector3* gravity);
00064 
00068         static void fwdDynamics(taoDNode* root, deVector3* gravity);
00069 
00070 
00072 
00092         static void computeA(taoDNode* root, const deInt dof, deFloat* A);
00094         static void computeAinv(taoDNode* root, const deInt dof, deFloat* Ainv);
00096         static void computeB(taoDNode* root, const deInt dof, deFloat* B);
00098         static void computeG(taoDNode* root, deVector3* gravity, const deInt dof, deFloat* G);
00099 
00101 
00108         static void computeOpSpaceInertiaMatrixInv(taoDNode* root, const deFloat* J, const deInt row, const deInt dof, const deFloat* Ainv, deFloat* Linv);
00109 
00111         static int computeDOF(taoDNode* obj);
00112 
00114 
00121         static void impulse(taoDNode* contactNode, const deVector3* contactPoint, const deVector3* impulseVector);
00122         static void impulseDist(taoDNode* contactNode, const deVector3* contactPoint, const deVector3* impulseVector);
00123         static void force(taoDNode* contactNode, const deVector3* contactPoint, const deVector3* forceVector);
00124         static void resetMass(taoDNode* node, const deFloat mass);
00125 
00126         static deFloat potentialEnergy(taoDNode* root, const deVector3* gravity);
00127         static deFloat kineticEnergy(taoDNode* root);
00128 
00129 private:
00130         typedef enum {TAO_DDQ, TAO_DQ, TAO_TAU} flagType;
00131         static void _Read(taoDNode* root, deFloat* v, flagType type);
00132         static void _Write(taoDNode* root, deFloat* v, flagType type);
00133 };
00134 
00135 #endif // _taoDynamics_h

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