[osg-users] Optimizer FLATTEN_STATIC_TRANSFORMS not all transforms are flattened

Robert Osfield robert.osfield at gmail.com
Thu Apr 25 01:25:47 PDT 2019


Hi Sergey,

The FLATTEN_STATIC_TRANSFORMS operation is not able to remove the
topmost node so can't flatten this MatrixTransform you've added.  This
limitation is due to the optimization being called with external code
holding a pointer/reference to that topmost node.  To be able to
optimize this topmost node away we'd need to come up with a new API
that requires users to replace the pointer references they have.

Without any API changes the way to get round this limitation is to
have a Group node as the topmost node, then have the new
MatrixTransform as a child of this group, then the original scene
graph below the MatrixTransform.

Robert.

On Wed, 24 Apr 2019 at 21:16, Sergey Lukashev <lukashev.s at ya.ru> wrote:
>
> Hello, osg folks!
>
> I've used FLATTEN_STATIC_TRANSFORMS and it works quite good. However, now I need to rotate the scene, so I added a MatrixTransform on top of the root node. But it does not get flattened for SOME models. I properly set DataVariance of every Transform to STATIC before running the Optimizer. Can somebody point out where issue could come from and how to debug or solve it?
>
>
>
>
>
> --------------------------------------
> Regards, Sergey.
> _______________________________________________
> 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