I am writing a custom osg::Drawable
class which needs to calculate its current distance from the camera's eye when its drawImplementation
method is called. It needs to do this in order to determine the optimal number of facets for rendering.
The difficulty is that my drawable can have any number of osg:Transform
nodes as parents. I need to apply the transformation of the actual parent that is being applied to the drawable. Using osg::Node::getParents()
and/or getParentalNodePaths()
, I can determine all possible paths to this drawable, but not the path that was taken.
Is there any way to determine this in OpenSceneGraph
? I have dug through the examples and documentation and have not found exactly what I require.