[osg-users] How to get Node object from PositionAttitudeTransform object

duc nguyen osgforum at tevs.eu
Fri Apr 14 20:05:22 PDT 2017


Hi,

I use PositionAttitudeTransform object  to store and set position for my Node object. Like that:

Code:
osg::ref_ptr< osg::PositionAttitudeTransform> pt = new osg::PositionAttitudeTransform;
pt->setPosition( osg::Vec3( Vertex[0], Vertex[1], Vertex[2] ) );
pt->addChild(myNode);



It OK. But after that i can't get my Node from that PositionAttitudeTransform. I try to use dynamic_cast but not success:

Code:
osg::Node* myNode = dynamic_cast<osg::Node*>(pt); 


// it return PositionAttitudeTransform type for MyNode, then MyNode become PositionAttitudeTransform object, I want it return Node Object

Please help me how can i get Node from PositionAttitudeTransform object

... 

Thank you!

Cheers,
duc

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70763#70763








More information about the osg-users mailing list