8 #include "VsMovableItem.h"
11 #include "VsMotorizedJoint.h"
12 #include "VsRigidBody.h"
14 #include "VsSimulator.h"
15 #include "VsDragger.h"
33 m_vxFluidPlane = NULL;
50 {
Std_TraceMsg(0,
"Caught Error in desctructor of VsFluidPlane/\r\n",
"", -1,
false,
true);}
53 void VsFluidPlane::CreateGraphicsGeometry()
55 m_osgGeometry = CreateBoxGeometry(m_ptSize.x, m_ptSize.y, 0.1f, (m_ptSize.x/
GridX()), (m_ptSize.y/
GridY()), 0.1f);
58 void VsFluidPlane::CreatePhysicsGeometry()
67 m_eControlType = VxEntity::kControlNode;
69 VsRigidBody::CreateItem();
70 FluidPlane::CreateParts();
71 VsRigidBody::SetBody();
74 void VsFluidPlane::ResizePhysicsGeometry()
79 void VsFluidPlane::Physics_FluidDataChanged()
90 FluidPlane::Velocity(oPoint, bUseScaling);
96 void VsFluidPlane::Physics_SetDensity(
float fltVal)
99 m_vxFluidPlane->setDefaultDensity(fltVal);
102 void VsFluidPlane::UpdateFluidPlaneHeight()
108 if(m_lpThisRB->IsRoot())
109 vPos = m_lpThisAB->GetStructure()->Position();
111 vPos = m_lpThisRB->AbsolutePosition();
113 m_vxFluidPlane->setLevel(vPos.y);
119 FluidPlane::Position(oPoint, bUseScaling, bFireChangeEvent, bUpdateMatrix);
120 UpdateFluidPlaneHeight();
123 void VsFluidPlane::Physics_PositionChanged()
125 VsRigidBody::Physics_PositionChanged();
126 UpdateFluidPlaneHeight();
129 void VsFluidPlane::DeletePhysics()
134 if(GetVsSimulator() && GetVsSimulator()->Universe())
136 GetVsSimulator()->Universe()->removeFluidState(m_vxFluidPlane);
137 delete m_vxFluidPlane;
140 m_vxFluidPlane = NULL;
143 void VsFluidPlane::SetupPhysics()
152 m_vxFluidPlane->setName(m_lpThisAB->ID().c_str());
153 GetVsSimulator()->Universe()->addFluidState(m_vxFluidPlane);
virtual void SetGravity()
Sets the gravity of the fluid.
CStdFPoint m_vVelocity
This is the velocity of the fluid.
virtual float GridY()
Gets the length of a segment for the y dimension of the plane.
virtual float Gravity()
Gets the gravity value.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
Simulator * m_lpSim
The pointer to a Simulation.
virtual CStdFPoint Position()
Gets the local position. (m_oPosition)
Declares the vortex fluid plane class.
virtual float GridX()
Gets the width of a segment for the x dimension of the plane.
float m_fltDensity
Uniform density for the rigid body.
virtual CStdFPoint Velocity()
Gets the velocity of the fluid.
CStdFPoint m_oAbsPosition
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
VsFluidPlane()
Default constructor.
virtual ~VsFluidPlane()
Destructor.