From 87d52dc1fd106b659424cca5fbbc3610d30888fc Mon Sep 17 00:00:00 2001 From: Bo Svensson <90132211+bosvensson1@users.noreply.github.com> Date: Wed, 6 Oct 2021 10:04:03 +0000 Subject: [PATCH] fixes coverity-ci warning --- components/nifosg/particle.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/components/nifosg/particle.cpp b/components/nifosg/particle.cpp index 0f103588e8..7821b9c2b8 100644 --- a/components/nifosg/particle.cpp +++ b/components/nifosg/particle.cpp @@ -70,16 +70,14 @@ void ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) const void InverseWorldMatrix::operator()(osg::MatrixTransform *node, osg::NodeVisitor *nv) { - if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) - { - osg::NodePath path = nv->getNodePath(); - path.pop_back(); + osg::NodePath path = nv->getNodePath(); + path.pop_back(); + + osg::Matrix mat = osg::computeLocalToWorld( path ); + mat.orthoNormalize(mat); // don't undo the scale + mat.invert(mat); + node->setMatrix(mat); - osg::Matrix mat = osg::computeLocalToWorld( path ); - mat.orthoNormalize(mat); // don't undo the scale - mat.invert(mat); - node->setMatrix(mat); - } traverse(node,nv); }