25 #include <osgDB/ReadFile> 26 #include <osgUtil/CullVisitor> 33 setCullingActive(
false);
34 getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
35 getStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
36 getStateSet()->setRenderBinDetails(INT_MIN,
"RenderBin");
42 if (nv && nv->getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
44 osgUtil::CullVisitor* cv =
static_cast<osgUtil::CullVisitor*
>(nv);
45 matrix.preMult(osg::Matrix::translate(cv->getEyeLocal()));
50 return BaseClass::computeLocalToWorldMatrix(matrix, nv);
57 if (nv && nv->getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
59 osgUtil::CullVisitor* cv =
static_cast<osgUtil::CullVisitor*
>(nv);
60 matrix.postMult(osg::Matrix::translate(cv->getEyeLocal()));
65 return BaseClass::computeWorldToLocalMatrix(matrix, nv);
72 mNode = osgDB::readNodeFile(fileName);
Namespace that contains controls for sample scene objects.
bool LoadFile(std::string fileName)
Loads a geometry file.
virtual bool computeWorldToLocalMatrix(osg::Matrix &matrix, osg::NodeVisitor *nv) const override
Calculates the world to local matrix.
virtual bool computeLocalToWorldMatrix(osg::Matrix &matrix, osg::NodeVisitor *nv) const override
Calculates the local to world matrix.
bool Valid() const
Returns True if the smart pointer has a valid internal pointer set.
SkyBoxNode()
Adds an easy and swappable access to the base class.
trBase::SmrtPtr< osg::Node > mNode