From Paul Martz, "I've attempted to make AutoTransform override computeBounds() to return

an invalid bounding sphere if it hasn't seen a cull traversal yet. It
depends on _firstTimeToSetEyePoint, which is initially true, then false
after a cull. There might be a better way? If so, let me know.

This change does resolve the issue I had encountered with auto scale to
screen and incorrect culling."
This commit is contained in:
Robert Osfield 2006-02-21 13:51:10 +00:00
parent 4a0a0a30ea
commit 25abad8307
2 changed files with 14 additions and 0 deletions

View File

@ -82,6 +82,7 @@ class OSG_EXPORT AutoTransform : public Transform
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
virtual BoundingSphere computeBound() const;
protected :

View File

@ -189,3 +189,16 @@ void AutoTransform::accept(NodeVisitor& nv)
// now do the proper accept
Transform::accept(nv);
}
BoundingSphere AutoTransform::computeBound() const
{
BoundingSphere bsphere;
float scale( 1.f );
if ( getAutoScaleToScreen() && _firstTimeToInitEyePoint )
return bsphere;
bsphere = Transform::computeBound();
return bsphere;
}