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:
parent
4a0a0a30ea
commit
25abad8307
@ -82,6 +82,7 @@ class OSG_EXPORT AutoTransform : public Transform
|
||||
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
|
||||
virtual BoundingSphere computeBound() const;
|
||||
|
||||
|
||||
protected :
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user