diff --git a/include/osgUtil/CullVisitor b/include/osgUtil/CullVisitor index b6304cabc..60648ad7e 100644 --- a/include/osgUtil/CullVisitor +++ b/include/osgUtil/CullVisitor @@ -218,6 +218,10 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor return _cvs->_eyePoint; } + inline const osg::Vec3& getUpLocal() const + { + return _cvs->_upVector; + } inline const osg::Vec3& getCenterLocal() const { diff --git a/src/osgDB/ReadFile.cpp b/src/osgDB/ReadFile.cpp index f7753643b..c571a24fa 100644 --- a/src/osgDB/ReadFile.cpp +++ b/src/osgDB/ReadFile.cpp @@ -72,7 +72,7 @@ Node* osgDB::readNodeFiles(std::vector& commandLine) } else // size >1 { - osg::Group* group = new osg::Group(); + osg::Group* group = new osg::Group; for(NodeList::iterator itr=nodeList.begin(); itr!=nodeList.end(); ++itr) diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 31f2249a8..23827f4ad 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -65,7 +65,7 @@ Registry::~Registry() Registry* Registry::instance() { - static RegistryPtr s_nodeFactory = new Registry(); + static RegistryPtr s_nodeFactory = new Registry; return s_nodeFactory.get(); } diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 509ea7460..84d31fa58 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -924,7 +924,8 @@ void CullVisitor::apply(Billboard& node) StateSet* node_state = node.getStateSet(); if (node_state) pushStateSet(node_state); - Vec3 eye_local = getEyeLocal(); + const Vec3& eye_local = getEyeLocal(); + const Vec3& up_local = getUpLocal(); Matrix* matrix = getCurrentMatrix(); for(int i=0;igetStateSet(); diff --git a/src/osgUtil/IntersectVisitor.cpp b/src/osgUtil/IntersectVisitor.cpp index bdddc9b6e..6bda2c1eb 100644 --- a/src/osgUtil/IntersectVisitor.cpp +++ b/src/osgUtil/IntersectVisitor.cpp @@ -536,33 +536,7 @@ void IntersectVisitor::apply(Geode& geode) void IntersectVisitor::apply(Billboard& node) { if (!enterNode(node)) return; - // Vec3 eye_local = getEyeLocal(); - // for(int i=0;imult(local_mat,*(currMatrix)); - // } - // else - // { - // matrix = new Matrix(local_mat); - // } - // - // matrix->ref(); - // matrix->unref(); - // - // } + leaveNode(); } diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index bc28e03a8..9f656b44c 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -82,12 +82,12 @@ void SceneView::setDefaults() _globalState->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); // set up an alphafunc by default to speed up blending operations. - osg::AlphaFunc* alphafunc = new osg::AlphaFunc(); + osg::AlphaFunc* alphafunc = new osg::AlphaFunc; alphafunc->setFunction(osg::AlphaFunc::GREATER,0.0f); _globalState->setAttributeAndModes(alphafunc, osg::StateAttribute::ON); // set up an alphafunc by default to speed up blending operations. - osg::TexEnv* texenv = new osg::TexEnv(); + osg::TexEnv* texenv = new osg::TexEnv; texenv->setMode(osg::TexEnv::MODULATE); _globalState->setAttributeAndModes(texenv, osg::StateAttribute::ON);