<div dir="ltr">I'm not sure what you are trying to accomplish, maybe a customĀ osg::Node::ComputeBoundingSphereCallback can help;<div>osg::Node::setComputeBoundingSphereCallback(cb) will call a custom callback when a node or it's children changes.</div><div>Laurens.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019 at 3:41 PM Dan johansson <<a href="mailto:johansson_dan@hotmail.com">johansson_dan@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
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<br>
<br>
<br>
Code:<br>
<br>
osg::NodePathList fullNodePath = node2->getParentalNodePaths();<br>
osg::NodePath lastNodePath = fullNodePath.at(fullNodePath.size() - 1);<br>
<br>
osg::Matrixd lastNodePositionMatrix = osg::computeLocalToWorld(lastNodePath);<br>
osg::Vec3f lastNodePosition = lastNodePositionMatrix.getTrans();<br>
<br>
node2->setPosition(lastNodePosition);<br>
<br>
<br>
<br>
<br>
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?<br>
<br>
Regards Dan<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=76812#76812" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76812#76812</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div>