8 #include "OsgMovableItem.h"
10 #include "OsgRigidBody.h"
13 #include "OsgDragger.h"
14 #include "OsgSimulator.h"
33 OsgOrganism::~OsgOrganism()
39 Organism::Body(lpBody);
43 THROW_TEXT_ERROR(Osg_Err_lUnableToConvertToVsRigidBody, Osg_Err_strUnableToConvertToVsRigidBody,
"ID: " + lpBody->Name());
46 void OsgOrganism::SetThisPointers()
48 OsgMovableItem::SetThisPointers();
50 m_lpThisST =
dynamic_cast<Structure *
>(
this);
52 THROW_TEXT_ERROR(Osg_Err_lThisPointerNotDefined, Osg_Err_strThisPointerNotDefined,
"m_lpThisST, " + m_lpThisAB->Name());
54 m_lpThisOG =
dynamic_cast<Organism *
>(
this);
56 THROW_TEXT_ERROR(Osg_Err_lThisPointerNotDefined, Osg_Err_strThisPointerNotDefined,
"m_lpThisOG, " + m_lpThisAB->Name());
59 osg::MatrixTransform *OsgOrganism::ParentOSG()
61 return GetOsgSimulator()->OSGRoot();
64 void OsgOrganism::Create()
71 void OsgOrganism::SetupPhysics()
77 OsgMovableItem::Physics_ResetSimulation();
79 Organism::ResetSimulation();
82 void OsgOrganism::UpdatePositionAndRotationFromMatrix()
84 OsgMovableItem::UpdatePositionAndRotationFromMatrix();
88 m_lpOsgBody->EndGripDrag();
91 m_osgFinalMatrix = m_lpOsgBody->FinalMatrix();
92 Physics_UpdateAbsolutePosition();
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
OsgOrganism()
Default constructor.
virtual RigidBody * Body()
Gets the root body.
Organism()
Default constructor.
Structure()
Default constructor.
Declares the vortex organism class.
virtual void ResetSimulation()
Resets the simulation back to time 0.