[osg-users] Perform actions when a child node is added

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Fri Jun 23 18:47:37 PDT 2017


Hi Bruno,

What Robert suggested is the correct one. However, I was in your situation
where I had to do stuff on PagedLOD children change so I end up with a
working hack, and that was an Update callback monitoring the children. Just
an idea

On Sat, Jun 24, 2017 at 12:45 AM, Bruno Oliveira <
bruno.manata.oliveira at gmail.com> wrote:

> I actually tried it already, in my nodes derived doth from osg::Group* and
> osg::PagedLOD*.
> However, overloading the PagedLOD's functions made my scene crash the app
> during the cull traversal (my overload was rewriting the node's center,
> radius and InitialBound...)
>
> 2017-06-23 15:18 GMT+01:00 Robert Osfield <robert.osfield at gmail.com>:
>
>> HI Bruno,
>>
>> There is no "child added callback" mechanism in osg::Group, but you
>> can override the addChild and insertChild methods to catch attempts to
>> add children, deferring the implementation to the underlying
>> addChild/insertChild method and then doing what extra's you want,
>>
>> Robert.
>>
>> On 23 June 2017 at 11:31, Bruno Oliveira
>> <bruno.manata.oliveira at gmail.com> wrote:
>> > Hello,
>> >
>> >
>> > I want to be able to perform some actions inside a node of my own, when
>> > someone adds a child node to it.
>> >
>> > Is this possible via some callback mechanism or so?
>> >
>> >
>> > ------
>> >
>> > Also, another question. Using osgDB::Registry::ReadFileCallback, I can
>> only
>> > perform actions after a node is read and before it is added to me
>> scene. Is
>> > it possible to perform actions AFTER the node is read and added to the
>> > scene?
>> >
>> >
>> > Thanks.
>> >
>> > _______________________________________________
>> > osg-users mailing list
>> > osg-users at lists.openscenegraph.org
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>> cenegraph.org
>> >
>> _______________________________________________
>> osg-users mailing list
>> 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
>
>


-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170624/2a2f829c/attachment-0003.htm>


More information about the osg-users mailing list