Show
Ignore:
Timestamp:
07/16/09 13:06:31 (5 years ago)
Author:
robert
Message:

From Colin MacDonald?,"The Optimizer Merge Geometry visitor is always merging geometries,
even if they have had DataVariance? DYNAMIC explicitly specified. Then
when an application attempts to dynamically update the geometry in the
frame loop the primitive sets and data arrays are no longer as
expected, leading to display and/or memory corruption.

Attached is a simple fix. "

Note from Robert Osfield, tweaked Colin's changes to that it use != DYNAMIC as the the test rather than == STATIC.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp

    r9987 r10480  
    18421842                //geom->computeCorrectBindingsAndArraySizes(); 
    18431843 
    1844                 if (!geometryContainsSharedArrays(*geom) && isOperationPermissibleForObject(geom)) 
     1844                if (!geometryContainsSharedArrays(*geom) && 
     1845                      geom->getDataVariance()!=osg::Object::DYNAMIC && 
     1846                      isOperationPermissibleForObject(geom)) 
    18451847                { 
    18461848                    geometryDuplicateMap[geom].push_back(geom);