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

Dan johansson johansson_dan at hotmail.com
Wed Oct 9 06:41:57 PDT 2019


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







More information about the osg-users mailing list