6 #include "VsMovableItem.h"
9 #include "VsMotorizedJoint.h"
10 #include "VsRigidBody.h"
11 #include "VsCylinder.h"
12 #include "VsSimulator.h"
13 #include "VsDragger.h"
26 VsCylinder::VsCylinder()
31 VsCylinder::~VsCylinder()
39 {
Std_TraceMsg(0,
"Caught Error in desctructor of VsCylinder\r\n",
"", -1,
false,
true);}
42 void VsCylinder::CreateGraphicsGeometry()
47 CStdFPoint vPos(0, 0, 0), vRot(-(osg::PI/2), 0, 0);
48 GeometryRotationMatrix(SetupMatrix(vPos, vRot));
51 void VsCylinder::CalculateEstimatedMassAndVolume()
59 void VsCylinder::CreatePhysicsGeometry()
64 CalculateEstimatedMassAndVolume();
71 VsRigidBody::CreateItem();
72 Cylinder::CreateParts();
73 VsRigidBody::SetBody();
81 Cylinder::CreateJoints();
82 VsRigidBody::Initialize();
85 void VsCylinder::ResizePhysicsGeometry()
89 VxCylinder *vxCylinder =
dynamic_cast<VxCylinder *
>(m_vxGeometry);
92 THROW_TEXT_ERROR(Vs_Err_lGeometryMismatch, Vs_Err_strGeometryMismatch, m_lpThisAB->Name());
97 CalculateEstimatedMassAndVolume();
virtual bool IsCollisionObject()
Query if this object is collision object.
float m_fltRadius
The radius of the cylinder.
float m_fltEstimatedVolume
The estimated volume. See m_fltEstimatedMass desciption.
int m_iSides
The number of sides used to draw the cylinder.
Simulator * m_lpSim
The pointer to a Simulation.
virtual void DistanceUnits(std::string strUnits)
Sets the distance units.
osg::Geometry * CreateConeGeometry(float height, float topradius, float botradius, int sides, bool doSide, bool doTop, bool doBottom)
float m_fltHeight
The height of the cylinder.
virtual void CreateJoint()
Creates the joint.
virtual float DisplayMassUnits()
Gets the density mass units.
float m_fltDensity
Uniform density for the rigid body.
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.
virtual void CreateJoints()
Allows the rigid body to create its joints using the chosen physics engine.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
Joint * m_lpJointToParent