[osg-users] How to add some new nodes at runtime

Per Nordqvist nordqvist at gmail.com
Tue Apr 12 05:15:42 PDT 2011


On a related note, it says in Rui Wang's new OSG 3.0 book that it is
dangerous to
do scene graph updates in the frame loop due to multithreading issues.
(Chapter 8, p193)

Snippet from the specific example:

while  ( !viewer.done() )
{
...
  rttcamera->setViewMatrixAsLookat(...); // unsafe!?
  viewer.frame();
}


Instead, Rui is recommending callbacks.
So is the above unsafe, and is this true for all kinds of scene graph updates?

Regards,

/Per



More information about the osg-users mailing list