6 #include "VsMovableItem.h"
9 #include "VsMotorizedJoint.h"
10 #include "VsRigidBody.h"
11 #include "VsBoxTest.h"
13 #include "VsSimulator.h"
14 #include "VsOsgUserData.h"
15 #include "VsOsgUserDataVisitor.h"
16 #include "VsDragger.h"
29 VsBoxTest::VsBoxTest()
34 VsBoxTest::~VsBoxTest()
45 void VsBoxTest::CreateGraphicsGeometry()
50 void VsBoxTest::CreatePhysicsGeometry()
59 osg::Group *m_World = lpVsSim->OSGRoot();
60 VxMaterialTable *m_MT = lpVsSim->Frame()->getMaterialTable();
62 osg::ref_ptr<osg::Node> object;
63 VxGeometry* objectGeom = 0;
68 boxDrawable->setColor(osg::Vec4(1, 0, 0, 0));
69 osg::ref_ptr<osg::Geode> box =
new osg::Geode;
70 box->addDrawable(boxDrawable.get());
71 object = box.release();
76 this->node =
new osg::MatrixTransform(osg::Matrix::translate(vPos.x, vPos.y, vPos.z));
77 this->node->setName(
"Object");
78 this->node->addChild(
object.
get());
81 m_World->addChild(this->node.get());
86 this->part =
new VxPart;
87 this->part->setName(
"object");
88 this->part->setControl(VxEntity::kControlDynamic);
89 this->part->setPosition(vPos.x, vPos.y, vPos.z);
92 this->part->addGeometry(objectGeom, m_MT->getMaterial(
"DEFAULTMATERIAL"));
93 this->part->setFastMoving(
true);
94 this->part->freeze(
false);
97 lpVsSim->Universe()->addEntity(this->part);
100 for(
int iIndex=0; iIndex<iCount; iIndex++)
114 void VsBoxTest::ResizePhysicsGeometry()
Simulator * m_lpSim
The pointer to a Simulation.
virtual CStdFPoint Position()
Gets the local position. (m_oPosition)
virtual void CreateJoints()
Allows the rigid body to create its joints using the chosen physics engine.
float m_fltLength
The length dimension of the box.
CStdPtrArray< RigidBody > m_aryChildParts
float m_fltWidth
The width dimension of the box.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
float m_fltHeight
The height dimension of the box.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
Declares the vortex structure class.