Added SampleRatioWhenMoving property and support to new osgVolume::MultipassTechnique.

This commit is contained in:
Robert Osfield
2013-12-12 09:53:24 +00:00
parent a5c0127a6e
commit 939aa38a2a
8 changed files with 110 additions and 40 deletions

View File

@@ -86,3 +86,27 @@ void VolumeTechnique::traverse(osg::NodeVisitor& nv)
// otherwise fallback to the Group::traverse()
_volumeTile->osg::Group::traverse(nv);
}
bool VolumeTechnique::isMoving(osgUtil::CullVisitor* cv)
{
bool moving = false;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
OSG_NOTICE<<"cv="<<cv<<", cv->getIdentifier()="<<cv->getIdentifier()<<std::endl;
ModelViewMatrixMap::iterator itr = _modelViewMatrixMap.find(cv->getIdentifier());
if (itr!=_modelViewMatrixMap.end())
{
osg::Matrix newModelViewMatrix = *(cv->getModelViewMatrix());
osg::Matrix& previousModelViewMatrix = itr->second;
moving = (newModelViewMatrix != previousModelViewMatrix);
previousModelViewMatrix = newModelViewMatrix;
}
else
{
_modelViewMatrixMap[cv->getIdentifier()] = *(cv->getModelViewMatrix());
}
return moving;
}