2 #include "OsgMovableItem.h"
4 #include "OsgRigidBody.h"
8 #include "OsgUserData.h"
9 #include "OsgUserDataVisitor.h"
12 #include "OsgCameraManipulator.h"
13 #include "OsgDragger.h"
14 #include "OsgMouseSpring.h"
15 #include "OsgSimulator.h"
19 namespace Visualization
22 OsgMouseSpring::OsgMouseSpring(
void)
32 OsgMouseSpring::~OsgMouseSpring(
void)
36 void OsgMouseSpring::Visible(
bool bVal)
39 m_gdeLine->setNodeMask(0x1);
41 m_gdeLine->setNodeMask(0x0);
44 void OsgMouseSpring::Initialize()
47 m_linesGeom =
new osg::Geometry();
49 m_aryLines =
new osg::Vec3Array();
51 m_aryLines->push_back(m_v3Start);
52 m_aryLines->push_back(m_v3End);
55 m_linesGeom->setVertexArray(m_aryLines.get());
58 m_linesGeom->addPrimitiveSet(
new osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP,0,m_aryLines->size()));
61 osg::Vec4Array* colors =
new osg::Vec4Array;
62 colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
63 colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
64 m_linesGeom->setColorArray(colors);
65 m_linesGeom->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
68 m_linesGeom->setDataVariance(osg::Object::DYNAMIC);
69 m_linesGeom->setUseDisplayList(
false);
71 m_gdeLine =
new osg::Geode();
72 m_gdeLine->addDrawable(m_linesGeom.get());
74 osg::StateSet *ss =
new osg::StateSet();
75 ss->setMode( GL_LIGHTING, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF );
77 m_lineWidth =
new osg::LineWidth();
78 m_lineWidth->setWidth(1.0f);
79 ss->setAttributeAndModes(m_lineWidth.get(), osg::StateAttribute::ON);
80 ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
81 m_gdeLine->setStateSet(ss);
87 void OsgMouseSpring::SetStart(osg::Vec3 v3Start)
93 void OsgMouseSpring::SetEnd(osg::Vec3 v3End)
99 void OsgMouseSpring::Update()
101 (*m_aryLines)[0].set(m_v3Start);
102 (*m_aryLines)[1].set(m_v3End);
104 m_linesGeom->dirtyBound();
Declares the vortex Light class.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
Declares the vortex organism class.
Declares the vortex structure class.