Marine systems simulation
CBox.h
1#ifndef BOX_H
2#define BOX_H
3
68#include "SimObject.h"
69
70#include <Eigen/Eigen>
71
72#include <string>
73
74
75class CBox : public SimObject
76{
77 public:
79 CBox(std::string sSimObjectName, ISimObjectCreator* pCreator);
80
81#ifdef FH_VISUALIZATION
83 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
84
86 virtual void RenderUpdate(const double T, const double* const X);
87
88 void DrawBody(Ogre::SceneNode* renderNode, Ogre::SceneManager* sceneMgr); // =0;
89#endif
90
92 virtual void OdeFcn(const double dT, const double* const adX,
93 double* const adXDot, const bool bIsMajorTimeStep);
94
95 static Eigen::Vector4f getQuaternion(double* eulerAnglesRad);
96
97 static Eigen::Vector4f normalizeQuaternion(const Eigen::Vector4f& q);
98
99 protected:
100 virtual const double* Position(const double dT, const double* const adX);
101 virtual const double* Velocity(const double dT, const double* const adX);
102 virtual const double* Rotation(const double dT, const double* const adX);
103
104
105 //ISignalPort* m_pInForce; ///< A pointer to the input force.
109 double m_dBoxDim[3];
110
111
112#ifdef FH_VISUALIZATION
113 double m_dScale;
114 Ogre::Entity* m_pRenderEntity;
115 Ogre::SceneNode* m_pRenderNode;
116 Ogre::SceneManager* m_pSceneMgr;
117#endif
118};
119
120
121#endif
Definition: CBox.h:76
int m_IStateVel
The index of the velocity state.
Definition: CBox.h:107
int m_IStateRot
The index of the rotation state.
Definition: CBox.h:108
int m_IStatePos
The index of the position state.
Definition: CBox.h:106
CBox(std::string sSimObjectName, ISimObjectCreator *pCreator)
The constructor sets the pointer to the output object and the parser object.
double m_dBoxDim[3]
The dimensions of the box.
Definition: CBox.h:109
virtual void OdeFcn(const double dT, const double *const adX, double *const adXDot, const bool bIsMajorTimeStep)
Calculates the state derivatives.