Removed osg::Transform::ComputeTransformCallback from osg::Transform.
Updated various dependant files to reimplemt callbacks as Transform subclasses.
This commit is contained in:
@@ -80,7 +80,7 @@ void CollectOccludersVisitor::apply(osg::Transform& node)
|
||||
pushCurrentMask();
|
||||
|
||||
ref_ptr<osg::RefMatrix> matrix = createOrReuseMatrix(getModelViewMatrix());
|
||||
node.getLocalToWorldMatrix(*matrix,this);
|
||||
node.computeLocalToWorldMatrix(*matrix,this);
|
||||
pushModelViewMatrix(matrix.get());
|
||||
|
||||
handle_cull_callbacks_and_traverse(node);
|
||||
|
||||
@@ -38,11 +38,11 @@ class TransformVisitor : public NodeVisitor
|
||||
{
|
||||
if (_coordMode==LOCAL_TO_WORLD)
|
||||
{
|
||||
transform.getLocalToWorldMatrix(_matrix,this);
|
||||
transform.computeLocalToWorldMatrix(_matrix,this);
|
||||
}
|
||||
else // worldToLocal
|
||||
{
|
||||
transform.getWorldToLocalMatrix(_matrix,this);
|
||||
transform.computeWorldToLocalMatrix(_matrix,this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,12 +95,6 @@ Matrix osg::computeEyeToLocal(const Matrix& modelview,NodePath& nodePath)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Transform::Transform()
|
||||
{
|
||||
_referenceFrame = RELATIVE_TO_PARENTS;
|
||||
@@ -108,7 +102,6 @@ Transform::Transform()
|
||||
|
||||
Transform::Transform(const Transform& transform,const CopyOp& copyop):
|
||||
Group(transform,copyop),
|
||||
_computeTransformCallback(transform._computeTransformCallback),
|
||||
_referenceFrame(transform._referenceFrame)
|
||||
{
|
||||
}
|
||||
@@ -136,7 +129,7 @@ bool Transform::computeBound() const
|
||||
// to handle this case gracefully, normally this should not be a problem.
|
||||
Matrix l2w;
|
||||
|
||||
getLocalToWorldMatrix(l2w,NULL);
|
||||
computeLocalToWorldMatrix(l2w,NULL);
|
||||
|
||||
Vec3 xdash = _bsphere._center;
|
||||
xdash.x() += _bsphere._radius;
|
||||
|
||||
@@ -393,7 +393,7 @@ void CullVisitor::apply(Billboard& node)
|
||||
|
||||
RefMatrix* billboard_matrix = createOrReuseMatrix(modelview);
|
||||
|
||||
node.getMatrix(*billboard_matrix,eye_local,pos);
|
||||
node.computeMatrix(*billboard_matrix,eye_local,pos);
|
||||
|
||||
|
||||
float d = distance(pos,modelview);
|
||||
@@ -499,7 +499,7 @@ void CullVisitor::apply(Transform& node)
|
||||
if (node_state) pushStateSet(node_state);
|
||||
|
||||
ref_ptr<RefMatrix> matrix = createOrReuseMatrix(getModelViewMatrix());
|
||||
node.getLocalToWorldMatrix(*matrix,this);
|
||||
node.computeLocalToWorldMatrix(*matrix,this);
|
||||
pushModelViewMatrix(matrix.get());
|
||||
|
||||
handle_cull_callbacks_and_traverse(node);
|
||||
|
||||
@@ -593,7 +593,7 @@ void IntersectVisitor::apply(Transform& node)
|
||||
if (!enterNode(node)) return;
|
||||
|
||||
osg::ref_ptr<RefMatrix> matrix = new RefMatrix;
|
||||
node.getLocalToWorldMatrix(*matrix,this);
|
||||
node.computeLocalToWorldMatrix(*matrix,this);
|
||||
|
||||
pushMatrix(*matrix);
|
||||
|
||||
|
||||
@@ -525,11 +525,11 @@ class CollectLowestTransformsVisitor : public osg::NodeVisitor
|
||||
else if (transform->getReferenceFrame()==osg::Transform::RELATIVE_TO_ABSOLUTE) _moreThanOneMatrixRequired=true;
|
||||
else
|
||||
{
|
||||
if (_transformSet.empty()) transform->getLocalToWorldMatrix(_firstMatrix,0);
|
||||
if (_transformSet.empty()) transform->computeLocalToWorldMatrix(_firstMatrix,0);
|
||||
else
|
||||
{
|
||||
osg::Matrix matrix;
|
||||
transform->getLocalToWorldMatrix(_firstMatrix,0);
|
||||
transform->computeLocalToWorldMatrix(_firstMatrix,0);
|
||||
if (_firstMatrix!=matrix) _moreThanOneMatrixRequired=true;
|
||||
}
|
||||
}
|
||||
@@ -1029,7 +1029,7 @@ void Optimizer::RemoveRedundantNodesVisitor::apply(osg::Transform& transform)
|
||||
{
|
||||
static osg::Matrix identity;
|
||||
osg::Matrix matrix;
|
||||
transform.getWorldToLocalMatrix(matrix,NULL);
|
||||
transform.computeWorldToLocalMatrix(matrix,NULL);
|
||||
if (matrix==identity)
|
||||
{
|
||||
_redundantNodeList.insert(&transform);
|
||||
|
||||
Reference in New Issue
Block a user