Merged fixes to osgVolume's handling of ImageSequence animated volumes, merge command:

svn merge -r 9746:9747 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8
This commit is contained in:
Robert Osfield
2009-02-10 18:51:43 +00:00
parent 2fcd7f1d99
commit 51f6fa249f
6 changed files with 103 additions and 2 deletions

View File

@@ -49,6 +49,8 @@ VolumeTile::VolumeTile():
_hasBeenTraversal(false)
{
setThreadSafeRefUnref(true);
setNumChildrenRequiringUpdateTraversal(1);
}
VolumeTile::VolumeTile(const VolumeTile& volumeTile,const osg::CopyOp& copyop):
@@ -58,6 +60,8 @@ VolumeTile::VolumeTile(const VolumeTile& volumeTile,const osg::CopyOp& copyop):
_hasBeenTraversal(false),
_layer(volumeTile._layer)
{
setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1);
if (volumeTile.getVolumeTechnique())
{
setVolumeTechnique(osg::clone(volumeTile.getVolumeTechnique()));
@@ -117,6 +121,12 @@ void VolumeTile::traverse(osg::NodeVisitor& nv)
_hasBeenTraversal = true;
}
if (nv.getVisitorType()==osg::NodeVisitor::UPDATE_VISITOR &&
_layer->requiresUpdateTraversal())
{
_layer->update(nv);
}
if (_volumeTechnique.valid())
{
@@ -138,6 +148,11 @@ void VolumeTile::init()
}
}
void VolumeTile::setLayer(Layer* layer)
{
_layer = layer;
}
void VolumeTile::setVolumeTechnique(VolumeTechnique* volumeTechnique)
{
if (_volumeTechnique == volumeTechnique) return;