6 #include "BlOsgGeometry.h"
8 #include "BlRigidBody.h"
10 #include "BlSimulator.h"
36 {
Std_TraceMsg(0,
"Caught Error in desctructor of BlCone\r\n",
"", -1,
false,
true);}
39 void BlCone::CreateGraphicsGeometry()
44 void BlCone::CreatePhysicsGeometry()
48 DeleteCollisionGeometry();
50 CalculateVolumeAndAreas();
52 m_eBodyType = CONVEX_HULL_SHAPE_PROXYTYPE;
53 btConvexHullShape *btHull = OsgMeshToConvexHull(m_osgNode.get(),
true, -1);
54 m_btCollisionShape = btHull;
59 void BlCone::CalculateVolumeAndAreas()
69 float fltTriHeight = (fltLargeDiam - fltSmallDiam) / 2.0;
71 float fltProfileTriangle = 0.5f * fltTriBase * fltTriHeight;
73 float fltProfileArea = fltProfileRect - (2*fltProfileRect);
77 m_vArea.z = 2*osg::PI*fltLargeDiam*fltSmallDiam;
82 Mass(fltMass,
false,
false);
90 BlRigidBody::CreateItem();
100 BlRigidBody::Initialize();
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
virtual bool IsCollisionObject()
Query if this object is collision object.
float m_fltLowerRadius
The lower radius of the cone.
int m_iSides
The number of sides used to draw the cone.
float m_fltMass
The mass of the object.
float m_fltVolume
The volume for the rigid body.
virtual void CreateJoints()
Allows the rigid body to create its joints using the chosen physics engine.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
virtual void CreateJoint()
Creates the joint.
float m_fltDensity
Uniform density for the rigid body.
float m_fltHeight
The height of the cone.
osg::Geometry ANIMAT_OSG_PORT * CreateConeGeometry(float height, float topradius, float botradius, int sides, bool doSide, bool doTop, bool doBottom)
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.
Joint * m_lpJointToParent
float m_fltUpperRadius
The upper radius of the cone.