Marine systems simulation
HydroBall.h
1#ifndef HYDRO_BALL_H
2#define HYDRO_BALL_H
3
4#include "SimObject.h"
5
6#include "sfh/constants.h"
7#include "sfh/math.h"
8#include "sfh/text.h"
9#include "sfh/util.h"
10
11#include <Eigen/Dense>
12
13#include <memory>
14
79class HydroBall : public SimObject
80{
81 public:
82 HydroBall(const std::string& simObjectName, ISimObjectCreator* const creator);
83 void OdeFcn(const double T, const double* const X, double* const XDot, const bool IsMajorTimeStep);
84 void InitialConditionSetup(const double T, const double* const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
85
86#ifdef FH_VISUALIZATION
87 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
88 void RenderUpdate(const double T, const double* const X);
89#endif
90
91 protected:
92 void SetOutputPortValues(const double T, const double* const X);
93 const double* Position(const double T, const double* const X);
94 const double* Velocity(const double T, const double* const X);
95
96 ICommonComputation* m_SetOutputPortValues;
97 ISignalPort* m_ForceExt;
98 ISignalPort* m_Current;
99 int m_PositionIndex, m_VelocityIndex;
100 double m_Position[3];
101 double m_Velocity[3];
102
103 double m_Mass, m_Radius, m_DragCoef, m_RhoWater, m_RhoBall;
104
105#ifdef FH_VISUALIZATION
106 Ogre::SceneNode* m_RenderNode;
107 std::string m_MaterialName;
108 std::string m_MeshName;
109 double m_Scale;
110#endif
111};
112
113#endif
Definition: HydroBall.h:80