8 #include "VsMovableItem.h"
11 #include "VsMotorizedJoint.h"
12 #include "VsRigidBody.h"
15 #include "VsSimulator.h"
16 #include "VsOsgUserData.h"
17 #include "VsOsgUserDataVisitor.h"
18 #include "VsDragger.h"
56 void VsPlaneTest::CreateGraphicsGeometry()
61 void VsPlaneTest::CreatePhysicsGeometry()
70 osg::Group *m_World = lpVsSim->OSGRoot();
71 VxMaterialTable *m_MT = lpVsSim->Frame()->getMaterialTable();
74 osg::ref_ptr<osg::Node> terrain;
75 VxGeometry* terrainGeom = 0;
80 osg::ref_ptr<osg::Geometry> terrainDrawable = osg::createTexturedQuadGeometry(
81 osg::Vec3(-50, 0, -50), osg::Vec3(100, 0, 0), osg::Vec3(0, 0, 100), 0, 0, 1, 1);
84 osg::ref_ptr<osg::Geode> terrainGeode =
new osg::Geode;
85 terrainGeode->addDrawable(terrainDrawable.get());
86 terrain = terrainGeode.release();
89 terrainGeom =
new VxPlane;
93 this->node =
new osg::MatrixTransform;
94 this->node->setName(
"TerrainNode");
97 this->node->addChild(terrain.get());
100 m_World->addChild(this->node.get());
103 this->part =
new VxPart;
104 this->part->setName(
"TerrainPart");
105 this->part->setControl(VxEntity::kControlNode);
106 this->part->freeze(
true);
109 this->part->addGeometry(terrainGeom, m_MT->getMaterial(
"DEFAULTMATERIAL"));
112 lpVsSim->Universe()->addEntity(this->part);
115 void VsPlaneTest::ResizePhysicsGeometry()
121 void VsPlaneTest::Physics_FluidDataChanged()
Simulator * m_lpSim
The pointer to a Simulation.
VsPlaneTest()
Default constructor.
virtual ~VsPlaneTest()
Destructor.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
virtual void CreateParts()
Allows the rigid body to create its parts using the chosen physics engine.
Declares the vortex plane class.
Declares the vortex structure class.