[osg-users] Limit on number of children ?
Paul Melis
paul at pecm.nl
Fri May 2 06:22:20 PDT 2008
You shouldn't have to use a separate Group as a Geode is a subclass of
osg::Node and therefore can be held in a osg::Group.
Do you have a stack trace for the case where you app crashed?
Paul
Vincent Bourdier wrote:
> Yes, i did it and it works well, but I don't understand why I have to
> use a group...
>
> Thanks,
> Vincent
>
> 2008/5/2 Gordon Tomlinson <gordon at gordon-tomlinson.com
> <mailto:gordon at gordon-tomlinson.com>>:
>
> HI
>
>
>
> Try creating a group and adding the Moon and Sun geodes to that
> and then add this new group to your Root
>
>
>
> Personally I never give a geode to the root node (
>
>
>
> __________________________________________________________
> /Gordon Tomlinson /
>
> Email : /gordon at GordonTomlinson.com
> <mailto:gordon at GordonTomlinson.com>/
> YIM/AIM : /gordon3dBrit/
> MSN IM : /gordon3dBrit at 3dscenegraph.com
> <mailto:gordon3dBrit at 3dscenegraph.com>/
> Website : /www.vis-sim.com <http://www.vis-sim.com>
> www.gordontomlinson.com <http://www.gordontomlinson.com>/
>
> __________________________________________________________
>
>
>
> *From:* osg-users-bounces at lists.openscenegraph.org
> <mailto:osg-users-bounces at lists.openscenegraph.org>
> [mailto:osg-users-bounces at lists.openscenegraph.org
> <mailto:osg-users-bounces at lists.openscenegraph.org>] *On Behalf Of
> *Vincent Bourdier
> *Sent:* Friday, May 02, 2008 8:45 AM
> *To:* OpenSceneGraph Users
>
> *Subject:* Re: [osg-users] Limit on number of children ?
>
>
>
> Thanks for help,
> a bit of code will be more clear so this is something approaching :
>
> osg::Geode* createMoon(std::string texturePath);
> osg::Geode* createSun(std::string texturePath);
>
> and in the main:
>
> _root->addChild(createSkyMap
>
> (config->Skypath));
> _root->addChild(createSunLight(_root.get()));
> _root->addChild(earthGroup);
> ...
> _root->addChild(createSun(...)) //ok
> _root->addChild(createMoon(...)) //error
>
> but if I do this :
>
> _root->addChild(createSkyMap(config->Skypath));
> _root->addChild(createSunLight(_root.get()));
> _root->addChild(earthGroup);
> ...
> //_root->addChild(createSun(...))
> _root->addChild(createMoon(...)) //ok
>
> So I don't understand what can be the problem...
> I if put createSun() or createMoon() it work well, but if I put
> the two, it crashes...
>
> I hope it's more clear now.
>
> Thanks,
> Vincent
>
>
>
> 2008/5/2 Paul Melis <paul at science.uva.nl
> <mailto:paul at science.uva.nl>>:
>
> Vincent Bourdier wrote:
> > Somewhere in my code, I make some
> root->addChild(functionCreateGeode());
> >
> > but when I added a last one, OSG crash on rendering, pretending
> a vector
> > error.
> > I've verified, it do not depend on the Geode, because it work if I
> > remove an "addChild()" before doing mine...
>
> Not sure what you mean here, showing the relevant code might help.
>
>
> > Is there a limit in the number of child ? or is it impossible to
> add 2
> > Geode (or more) on the same group ?
>
> A Group node keeps its children nodes using a std::vector, which
> doesn't
> have any practical length limit (other than available memory and an
> integer counter of the number of items which might overflow).
>
> Without seeing your actual code I'd guess this has something to do
> with
> not using ref_ptr where you should.
>
> Paul
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> <mailto:osg-users at lists.openscenegraph.org>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> <mailto:osg-users at lists.openscenegraph.org>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
More information about the osg-users
mailing list