Hi Jason,

I don't know what is up with your code, but using dynamic_cast to a
particular type of osg::Transform when the OSG can handle a whole
range is a bit limiting.  The osg::Transform class has support built
in for accumulating matrices correctly, and there is are convenience
methods for getting the local to world and world to local matrices, as
well as getting all the possible world matrices from a node.
Functions/methods to look at are:

>From include/osg/Transform:

/** Compute the matrix which transforms objects in local coords to world coords,
  * by accumulating the Transform local to world matrices along the
specified node path.
*/
extern OSG_EXPORT Matrix computeLocalToWorld(const NodePath& nodePath,
bool ignoreCameras = true);

/** Compute the matrix which transforms objects in world coords to local coords,
  * by accumulating the Transform world to local matrices along the
specified node path.
*/
extern OSG_EXPORT Matrix computeWorldToLocal(const NodePath& nodePath,
bool ignoreCameras = true);

And from include/osg/Node:

       /** Get the list of matrices that transform this node from
local coordinates to world coordinates.
          * The optional Node* haltTraversalAtNode allows the user to
prevent traversal beyond a specifed node. */
        MatrixList getWorldMatrices(const osg::Node*
haltTraversalAtNode=0) const;


Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to