Refactor osg::Geode to subclass from osg::Group and reuse the NodeList children container

This commit is contained in:
Robert Osfield
2014-06-03 09:23:24 +00:00
parent 2d41cbd0cf
commit 3dde165f14
10 changed files with 120 additions and 287 deletions

View File

@@ -15,7 +15,7 @@
#include <osg/BoundingBox>
#include <osg/Transform>
#include <osg/OccluderNode>
#include <osg/Drawable>
#include <osg/Geometry>
#include <osg/Notify>
#include <stdio.h>
@@ -84,6 +84,11 @@ bool Group::insertChild( unsigned int index, Node *child )
if (child)
{
// handle deprecated geometry configurations by calling fixDeprecatedData().
osg::Geometry* geometry = child->asGeometry();
if (geometry && geometry->containsDeprecatedData()) geometry->fixDeprecatedData();
// note ref_ptr<> automatically handles incrementing child's reference count.
if (index >= _children.size())
{