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.
This commit is contained in:
Robert Osfield 2011-03-17 13:56:27 +00:00
parent 6e182e7c17
commit 79cb22eb06
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ class OSGVOLUME_EXPORT RayTracedTechnique : public VolumeTechnique
osg::ref_ptr<osg::MatrixTransform> _transform;
typedef std::map<osgUtil::CullVisitor*, osg::Matrix> ModelViewMatrixMap;
typedef std::map<osgUtil::CullVisitor::Identifier*, osg::Matrix> ModelViewMatrixMap;
OpenThreads::Mutex _mutex;
ModelViewMatrixMap _modelViewMatrixMap;

View File

@ -553,7 +553,7 @@ void RayTracedTechnique::cull(osgUtil::CullVisitor* cv)
bool moving = false;
{
OpenThreads::ScopedLock<OpenThreads::Mutex> 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());
}
}