[osg-users] Updating a PositionAttitudeTransform node from another PositionAttitudeTransform node

Voerman, L. l.voerman at rug.nl
Wed Oct 9 09:22:58 PDT 2019


I'm not sure what you are trying to accomplish, maybe a
custom osg::Node::ComputeBoundingSphereCallback can help;
osg::Node::setComputeBoundingSphereCallback(cb) will call a custom callback
when a node or it's children changes.
Laurens.

On Wed, Oct 9, 2019 at 3:41 PM Dan johansson <johansson_dan at hotmail.com>
wrote:

> Hi!
>
> Thanks for the reply, i understand the issue. I'm not really understanding
> why this isn't built in automatically though. This simple code seemed to do
> the trick even with multiple Pat's chained
>
>
> Code:
>
> osg::NodePathList fullNodePath = node2->getParentalNodePaths();
> osg::NodePath lastNodePath = fullNodePath.at(fullNodePath.size() - 1);
>
> osg::Matrixd lastNodePositionMatrix =
> osg::computeLocalToWorld(lastNodePath);
> osg::Vec3f lastNodePosition = lastNodePositionMatrix.getTrans();
>
> node2->setPosition(lastNodePosition);
>
>
>
>
> Is there a good way to add a callback to this update that is _not_ on
> every render but rather when the specific Pat have been
> moved/rotated/scaled?
>
> Regards Dan
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=76812#76812
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191009/a7cd7c1e/attachment.html>


More information about the osg-users mailing list