Updates to osg::Transform to allow it subclassed more easily.

This commit is contained in:
Robert Osfield
2002-01-23 15:42:36 +00:00
parent 55e0a21dad
commit 9c8c73c77f
2 changed files with 57 additions and 4 deletions

View File

@@ -5,15 +5,25 @@ using namespace osg;
Transform::Transform()
{
_type = DYNAMIC;
_matrix = new Matrix;
_matrix->makeIdentity();
_matrixDirty = false;
_inverse = new Matrix;
_inverse->makeIdentity();
_inverseDirty = false;
}
Transform::Transform(const Matrix& mat )
{
_type = DYNAMIC;
_matrix = new Matrix(mat);
_matrixDirty = false;
_inverseDirty = true; // will neeed to recompute.
}
@@ -25,6 +35,8 @@ const bool Transform::computeBound() const
{
if (!Group::computeBound()) return false;
if (_matrixDirty) computeMatrix();
Vec3 xdash = _bsphere._center;
xdash.x() += _bsphere._radius;
xdash = xdash*(*_matrix);