From 79cb22eb061da756b3f9bca15fc9b74dfe15d6a4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 17 Mar 2011 13:56:27 +0000 Subject: [PATCH] Changed the view movement detection code so that it uses the new CullVisitor::Identifier to indentifier cull traversals, this enables the code to properly detect movement when osgViewer::Renderer uses double buffering of SceneView. --- include/osgVolume/RayTracedTechnique | 2 +- src/osgVolume/RayTracedTechnique.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/osgVolume/RayTracedTechnique b/include/osgVolume/RayTracedTechnique index 58ab6bbba..1d3da73a4 100644 --- a/include/osgVolume/RayTracedTechnique +++ b/include/osgVolume/RayTracedTechnique @@ -47,7 +47,7 @@ class OSGVOLUME_EXPORT RayTracedTechnique : public VolumeTechnique osg::ref_ptr _transform; - typedef std::map ModelViewMatrixMap; + typedef std::map ModelViewMatrixMap; OpenThreads::Mutex _mutex; ModelViewMatrixMap _modelViewMatrixMap; diff --git a/src/osgVolume/RayTracedTechnique.cpp b/src/osgVolume/RayTracedTechnique.cpp index 14d9c7eee..857e05d96 100644 --- a/src/osgVolume/RayTracedTechnique.cpp +++ b/src/osgVolume/RayTracedTechnique.cpp @@ -553,7 +553,7 @@ void RayTracedTechnique::cull(osgUtil::CullVisitor* cv) bool moving = false; { OpenThreads::ScopedLock lock(_mutex); - ModelViewMatrixMap::iterator itr = _modelViewMatrixMap.find(cv); + ModelViewMatrixMap::iterator itr = _modelViewMatrixMap.find(cv->getIdentifier()); if (itr!=_modelViewMatrixMap.end()) { osg::Matrix newModelViewMatrix = *(cv->getModelViewMatrix()); @@ -564,7 +564,7 @@ void RayTracedTechnique::cull(osgUtil::CullVisitor* cv) } else { - _modelViewMatrixMap[cv] = *(cv->getModelViewMatrix()); + _modelViewMatrixMap[cv->getIdentifier()] = *(cv->getModelViewMatrix()); } }