Marine systems simulation
CSphereBase.h
1#ifndef CSphereBase_h__
2#define CSphereBase_h__
3
4#include "sfh/constants.h"
5
6#ifdef FH_VISUALIZATION
7#pragma warning(push)
8#pragma warning( disable : 4251 )
9 #include <Ogre.h>
10#pragma warning(pop)
11#endif
12
14{
15public:
16 inline static double DragForce( double Rho, double Cd, double Dsphere, double Dcable, double Ampvel, double Vel)
17 {
18 return 1./8. * Rho * sfh::pi* Ampvel * Cd * Dsphere * (Dsphere- Dcable/sfh::pi)*Vel;
19 }
20
21#ifdef FH_VISUALIZATION
22 inline static void CreateOgreSphere(Ogre::SceneManager* SceneManager, Ogre::String SphereName, Ogre::SceneNode** pNode, Ogre::Entity** pEntity, double Diameter=1, Ogre::String MaterialName="DiffuseSpecular")
23 {
24 *pNode = SceneManager->getRootSceneNode()->createChildSceneNode( SphereName + "Node");
25 *pEntity = SceneManager->createEntity( SphereName+"Entity", "fhSphere.mesh" );
26 (*pNode)->attachObject( *pEntity );
27 (*pNode)->scale(static_cast<Ogre::Real>(Diameter),static_cast<Ogre::Real>(Diameter),static_cast<Ogre::Real>(Diameter) );
28 (*pEntity)->setMaterialName(MaterialName);
29 }
30#endif
31};
32
33#endif // CSphereBase_h__
Definition: CSphereBase.h:14