FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Sphere.h
1#ifndef CSphere_h__
2#define CSphere_h__
3
62#include "SphereBase.h"
63
64#include <fhsim/simobject/SimObject.h>
65#include <fhsim_environment/EnvironmentProvider.h>
66
67class Sphere : public SimObject
68{
69
70public:
71 Sphere(std::string SimObjectName, ISimObjectCreator* Creator);
72 void OdeFcn(const double T, const double* const X, double* const XDot) const;
73 void FinalSetup(const double T, const double* const X, ISimObjectCreator* const Creator);
74 const double* Position(const double T, const double* const X);
75 const double* Velocity(const double T, const double* const X);
76
77 bool HasJacobians() const override;
78 void OdeJacobian(double T, const double* X, double* J, int nStates) override;
79 int GetJacobianSparsity(int nStates, int* rowPtr, int* colIdx) override;
80
81private:
82 ISignalPort* m_IForce;
83
84 int m_PosIdx;
85 int m_VelIdx;
86
87 double m_sphereD;
88 double m_sphereMass;
89 double m_dragCoeffSphere;
90 double m_Rho;
91 double m_cableD;
92 double m_lift;
93
94 environment::EnvironmentProvider* m_Environment;
95
96#ifdef FH_VISUALIZATION
97public:
98 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
99 void RenderUpdate(const double dT, const double* const adX);
100
101private:
102 Ogre::SceneNode* m_Node;
103 Ogre::Entity* m_Entity;
104 Ogre::String m_Material;
105 std::string m_SphereMesh;
106#endif
107};
108#endif // CSphere_h__
Definition Sphere.h:68