Made the computeLocalToWorld etc method to use const NodePath's parameters.

This commit is contained in:
Robert Osfield
2004-09-09 15:14:33 +00:00
parent 6a48a3ffe7
commit 790da0776a
5 changed files with 82 additions and 52 deletions

View File

@@ -46,10 +46,11 @@ class TransformVisitor : public NodeVisitor
}
}
void accumulate(NodePath& nodePath)
void accumulate(const NodePath& nodePath)
{
for(NodePath::iterator itr=nodePath.begin();
itr!=nodePath.end();
NodePath& non_const_nodePath = const_cast<NodePath&>(nodePath);
for(NodePath::iterator itr=non_const_nodePath.begin();
itr!=non_const_nodePath.end();
++itr)
{
(*itr)->accept(*this);
@@ -58,7 +59,7 @@ class TransformVisitor : public NodeVisitor
};
Matrix osg::computeLocalToWorld(NodePath& nodePath)
Matrix osg::computeLocalToWorld(const NodePath& nodePath)
{
Matrix matrix;
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD);
@@ -66,7 +67,7 @@ Matrix osg::computeLocalToWorld(NodePath& nodePath)
return matrix;
}
Matrix osg::computeWorldToLocal(NodePath& nodePath)
Matrix osg::computeWorldToLocal(const NodePath& nodePath)
{
osg::Matrix matrix;
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL);
@@ -74,7 +75,7 @@ Matrix osg::computeWorldToLocal(NodePath& nodePath)
return matrix;
}
Matrix osg::computeLocalToEye(const Matrix& modelview,NodePath& nodePath)
Matrix osg::computeLocalToEye(const Matrix& modelview,const NodePath& nodePath)
{
Matrix matrix(modelview);
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD);
@@ -82,7 +83,7 @@ Matrix osg::computeLocalToEye(const Matrix& modelview,NodePath& nodePath)
return matrix;
}
Matrix osg::computeEyeToLocal(const Matrix& modelview,NodePath& nodePath)
Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath)
{
Matrix matrix;
matrix.invert(modelview);