Changeset 11131

Show
Ignore:
Timestamp:
02/26/10 16:40:19 (4 years ago)
Author:
robert
Message:

From Paul Martz, "Regarding the osg-users thread "mergeGeodes crash", I'm submitting this for consideration as a fix for the problem with the FlattenStaticTransformsVisitor?. It seems that the additional nested loop over the Transform's parent was not needed. I'm not sure why it was there, and if it really was unnecessary, then it has probably been resulting in many redundant Nodes for quite some time. Perhaps this fix will result in a cull- and draw-time performance boost."

From Robert Osfield, added copying of the UserData? and Descriptions from the transform to the new group.

Files:
1 modified

Legend:

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

    r11046 r11131  
    10771077                group->setNodeMask(transform->getNodeMask()); 
    10781078                group->setStateSet(transform->getStateSet()); 
     1079                group->setUserData(transform->getUserData()); 
     1080                group->setDescriptions(transform->getDescriptions()); 
    10791081                for(unsigned int i=0;i<transform->getNumChildren();++i) 
    10801082                { 
    1081                     for(unsigned int j=0;j<transform->getNumParents();++j) 
    1082                     { 
    1083                         group->addChild(transform->getChild(i)); 
    1084                     } 
     1083                    group->addChild(transform->getChild(i)); 
    10851084                } 
    10861085