Marine systems simulation
CRigidBody.h
1#ifndef C_RigidBody_H
2#define C_RigidBody_H
3
4#include "SimObject.h"
5
6#include <Eigen/Eigen>
7class CEnvironment;
8namespace rigidbody
9{
10typedef Eigen::Matrix<double, 6, 6> mat6;
11typedef Eigen::Matrix<double, 6, 1> vec6;
12typedef Eigen::Matrix<double, 3, 3> mat3;
13typedef Eigen::Matrix<double, 3, 1> vec3;
14typedef Eigen::Matrix<double, 13, 1> vec13;
15typedef Eigen::Quaternion<double> quat;
16
18{
19 public:
20 virtual ~CRigidBody(){};
21
22 // r: global
23 // q: global
24 // dX: bodylocal
25 // return: bodylocal
26 virtual vec6 GetInternalForces(const vec6& dX, const vec3& r, const quat& q, CEnvironment* environment, double time, const double* states) = 0;
27
28 // return: bodylocal
29 virtual mat6 GetInertiaMatrix(const vec3& r, double time, const double* states, CEnvironment* environment) = 0;
30
31 // all global coords
32 vec13 GetSecondDerivative(const vec3& r, const quat& q, const vec3& v, const vec3 w, const vec6& externalForces, CEnvironment* environment, double time, const double* states);
33
34 // bodylocal coords
35 static vec6 GetCoriolisForce(const vec6& dX, const mat6& Inertia);
36
37
38#ifdef FH_VISUALIZATION
39 virtual void DrawBody(Ogre::SceneNode* renderNode, Ogre::SceneManager* sceneMgr) = 0;
40#endif
41
42 //static mat6 reorientInertiaRotateTranslate(const mat6& Inertia, const vec6& orientation);
43 static mat6 ReorientInertiaTranslateRotate(const mat6& Inertia, const vec6& orientation);
44 static mat3 MakeDyadic(const vec3& vector);
45 static mat3 GetRotation(const vec3& angle);
46 static mat6 GetRotation6(const vec3& angle);
47};
48}; // namespace rigidbody
49#endif
Definition: CEnvironment.h:10
Definition: CRigidBody.h:18