Updates to Transform handling in CullVisitor, in prep for moving camera

modelview and projection into Transform nodes.
This commit is contained in:
Robert Osfield
2002-02-11 23:24:23 +00:00
parent 61e3e0c693
commit e6ac4cd190
3 changed files with 158 additions and 294 deletions

View File

@@ -8,6 +8,8 @@ Transform::Transform()
_mode = MODEL;
_matrix = new Matrix;
_inverse = new Matrix;
_inverseDirty = false;
}
Transform::Transform(const Transform& transform,const CopyOp& copyop):
@@ -15,7 +17,9 @@ Transform::Transform(const Transform& transform,const CopyOp& copyop):
_type(transform._type),
_mode(transform._mode),
_computeTransformCallback(_computeTransformCallback),
_matrix(new Matrix(*transform._matrix))
_matrix(new Matrix(*transform._matrix)),
_inverse(new Matrix(*transform._inverse)),
_inverseDirty(transform._inverseDirty)
{
}
@@ -25,6 +29,8 @@ Transform::Transform(const Matrix& mat )
_mode = MODEL;
_matrix = new Matrix(mat);
_inverse = new Matrix();
_inverseDirty = false;
}
@@ -39,7 +45,7 @@ const bool Transform::computeBound() const
// note, NULL pointer for NodeVisitor, so compute's need
// to handle this case gracefully, normally this should not be a problem.
Matrix l2w;
if (getLocalToWorldMatrix(l2w,NULL))
if (_mode!=PROJECTION && getLocalToWorldMatrix(l2w,NULL))
{
Vec3 xdash = _bsphere._center;