6 #include "OsgMovableItem.h"
8 #include "OsgRigidBody.h"
11 #include "OsgSimulator.h"
12 #include "OsgUserData.h"
13 #include "OsgUserDataVisitor.h"
14 #include "OsgDragger.h"
15 #include "OsgPyramid.h"
20 namespace Visualization
27 OsgPyramid::OsgPyramid()
31 OsgPyramid::OsgPyramid(osg::Vec3d vPoint, osg::Vec3d vBase[3])
34 for(
int iIdx=0; iIdx<3; iIdx++)
35 m_vBase[iIdx] = vBase[iIdx];
38 OsgPyramid::OsgPyramid(osg::Vec3d vPoint, osg::Vec3d vBase1, osg::Vec3d vBase2, osg::Vec3d vBase3)
46 OsgPyramid::~OsgPyramid()
53 {
Std_TraceMsg(0,
"Caught Error in desctructor of OsgPyramid\r\n",
"", -1,
false,
true);}
56 float OsgPyramid::Height()
59 float dx = m_vPoint[0] - m_vBase[0][0];
60 float dy = m_vPoint[1] - m_vBase[0][1];
61 float dz = m_vPoint[2] - m_vBase[0][2];
62 osg::Vec3d vt(dx, dy, dz);
69 osg::Vec3 normal = (m_vBase[1]-m_vBase[0])^(m_vBase[2]-m_vBase[1]);
82 float OsgPyramid::BaseArea()
84 float fltA = (m_vBase[0] - m_vBase[1]).length();
85 float fltB = (m_vBase[1] - m_vBase[2]).length();
86 float fltC = (m_vBase[2] - m_vBase[0]).length();
88 float fltS = (fltA + fltB + fltC)/2.0;
90 float fltVal = fltS * (fltS - fltA) * (fltS - fltB) * (fltS - fltC);
91 float fltArea = sqrt(fltVal);
96 float OsgPyramid::Volume()
102 float baseArea = BaseArea();
105 float fltVolume = (d * baseArea) / 3.0;
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.
Declares the vortex structure class.