Marine systems simulation
Pendulum.h
1#ifndef PENDULUM_H
2#define PENDULUM_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 <memory>
12
65class Pendulum : public SimObject
66{
67 public:
68 Pendulum(const std::string& simObjectName, ISimObjectCreator* const creator);
69 void OdeFcn(const double T, const double* const X, double* const XDot, const bool IsMajorTimeStep);
70 void InitialConditionSetup(const double T, const double* const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
71
72#ifdef FH_VISUALIZATION
73 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
74 void RenderUpdate(const double T, const double* const X);
75#endif
76
77 protected:
78 void SetOutputPortValues(const double T, const double* const X);
79 const double* Angle(const double T, const double* const X);
80 const double* AngularVelocity(const double T, const double* const X);
81
82 ICommonComputation* m_SetOutputPortValues;
83 int m_AngleIndex, m_AngularVelocityIndex;
84
85 double m_Length, m_Gravity;
86 double m_Angle, m_AngularVelocity;
87 double m_Origin[3];
88
89#ifdef FH_VISUALIZATION
90 Ogre::ManualObject* m_Line;
91 Ogre::SceneNode* m_RenderNode;
92 std::string m_MaterialName;
93 std::string m_MeshName;
94 double m_Scale;
95#endif
96};
97
98#endif
Definition: Pendulum.h:66