8 #include "OsgMovableItem.h"
11 #include "OsgRigidBody.h"
13 #include "OsgHingeLimit.h"
16 #include "OsgSimulator.h"
17 #include "OsgUserData.h"
18 #include "OsgUserDataVisitor.h"
19 #include "OsgDragger.h"
51 if(osgJointMT.valid())
54 if(lpUpperLimit && lpUpperLimit->FlapTranslateMT()) osgJointMT->removeChild(lpUpperLimit->FlapTranslateMT());
55 if(lpLowerLimit && lpLowerLimit->FlapTranslateMT()) osgJointMT->removeChild(lpLowerLimit->FlapTranslateMT());
56 if(lpPosFlap && lpPosFlap->FlapTranslateMT()) osgJointMT->removeChild(lpPosFlap->FlapTranslateMT());
79 CStdFPoint vPos(0, 0, 0), vRot(osg::PI/2, 0, 0);
92 m_osgCylinderMat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0.1, 0.1, 0.1, 1));
93 m_osgCylinderMat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(1, 0.25, 1, 1));
94 m_osgCylinderMat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0.25, 0.25, 0.25, 1));
96 m_osgCylinderSS->setMode(GL_BLEND, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
102 void OsgHinge::CreateHingeGraphics(
float fltHeight,
float fltRadius,
float fltFlapWidth,
103 osg::ref_ptr<osg::MatrixTransform> osgJointMT,
OsgHingeLimit *lpUpperLimit,
108 if(lpUpperLimit) lpUpperLimit->SetupLimitGraphics(fltFlapWidth, fltHeight);
109 if(lpLowerLimit) lpLowerLimit->SetupLimitGraphics(fltFlapWidth, fltHeight);
110 if(lpPosFlap) lpPosFlap->SetupLimitGraphics(fltFlapWidth, fltHeight);
113 osgJointMT->addChild(lpUpperLimit->FlapTranslateMT());
114 osgJointMT->addChild(lpLowerLimit->FlapTranslateMT());
115 osgJointMT->addChild(lpPosFlap->FlapTranslateMT());
virtual ~OsgHinge()
Destructor.
virtual void CreateCylinderGraphics(float fltHeight, float fltRadius)
Creates the cylinder graphics.
OsgHinge()
Default constructor.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
osg::ref_ptr< osg::StateSet > m_osgCylinderSS
The osg cylinder state set.
osg::ref_ptr< osg::MatrixTransform > m_osgCylinderMT
The osg cylinder matrix transform.
osg::Geometry ANIMAT_OSG_PORT * CreateConeGeometry(float height, float topradius, float botradius, int sides, bool doSide, bool doTop, bool doBottom)
osg::ref_ptr< osg::Geometry > m_osgCylinder
The osg cylinder geometry.
osg::ref_ptr< osg::Geode > m_osgCylinderGeode
The osg cylinder geode.
osg::ref_ptr< osg::Material > m_osgCylinderMat
The osg cylinder material.
Declares the vortex structure class.
Declares the vortex hinge class.