Changed the ReferenceFrame enums to be RELEATIVE and ABSOLUTE, and

deprecated the RELATIVE_TO_ABSOLUTE and RELATIVE_TO_PARENTS.
This commit is contained in:
Robert Osfield
2004-10-22 19:26:45 +00:00
parent 8ab8fc762f
commit 6821a80e14
36 changed files with 98 additions and 75 deletions

View File

@@ -45,7 +45,7 @@ bool AutoTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_matrixDirty) computeMatrix();
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
matrix.preMult(_cachedMatrix);
}
@@ -59,7 +59,7 @@ bool AutoTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
bool AutoTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
matrix.postMult(osg::Matrix::translate(-_position)*
osg::Matrix::rotate(_rotation.inverse())*

View File

@@ -321,7 +321,7 @@ bool Group::computeBound() const
++itr)
{
const osg::Transform* transform = (*itr)->asTransform();
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE_TO_PARENTS)
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE)
{
bb.expandBy((*itr)->getBound());
}
@@ -340,7 +340,7 @@ bool Group::computeBound() const
++itr)
{
const osg::Transform* transform = (*itr)->asTransform();
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE_TO_PARENTS)
if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE)
{
_bsphere.expandRadiusBy((*itr)->getBound());
}

View File

@@ -16,7 +16,7 @@ using namespace osg;
LightSource::LightSource():
_value(StateAttribute::ON),
_referenceFrame(RELATIVE_TO_PARENTS)
_referenceFrame(RELATIVE)
{
// switch off culling of light source nodes by default.
setCullingActive(false);
@@ -33,7 +33,7 @@ LightSource::~LightSource()
void LightSource::setReferenceFrame(ReferenceFrame rf)
{
_referenceFrame = rf;
setCullingActive(_referenceFrame==RELATIVE_TO_PARENTS);
setCullingActive(_referenceFrame==RELATIVE);
}
void LightSource::setLight(Light* light)
@@ -62,7 +62,7 @@ bool LightSource::computeBound() const
{
Group::computeBound();
if (_light.valid() && _referenceFrame==RELATIVE_TO_PARENTS)
if (_light.valid() && _referenceFrame==RELATIVE)
{
const Vec4& pos = _light->getPosition();
if (pos[3]!=0.0f)

View File

@@ -29,7 +29,7 @@ MatrixTransform::MatrixTransform(const MatrixTransform& transform,const CopyOp&
MatrixTransform::MatrixTransform(const Matrix& mat )
{
_referenceFrame = RELATIVE_TO_PARENTS;
_referenceFrame = RELATIVE;
_matrix = mat;
_inverseDirty = false;
@@ -42,7 +42,7 @@ MatrixTransform::~MatrixTransform()
bool MatrixTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
matrix.preMult(_matrix);
}
@@ -57,7 +57,7 @@ bool MatrixTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) con
{
const Matrix& inverse = getInverseMatrix();
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
matrix.postMult(inverse);
}

View File

@@ -21,7 +21,7 @@ PositionAttitudeTransform::PositionAttitudeTransform():
bool PositionAttitudeTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
matrix.preMult(osg::Matrix::translate(-_pivotPoint)*
osg::Matrix::scale(_scale)*
@@ -41,7 +41,7 @@ bool PositionAttitudeTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVis
bool PositionAttitudeTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
matrix.postMult(osg::Matrix::translate(-_position)*
osg::Matrix::rotate(_attitude.inverse())*

View File

@@ -98,7 +98,7 @@ Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath)
Transform::Transform()
{
_referenceFrame = RELATIVE_TO_PARENTS;
_referenceFrame = RELATIVE;
}
Transform::Transform(const Transform& transform,const CopyOp& copyop):
@@ -118,7 +118,7 @@ void Transform::setReferenceFrame(ReferenceFrame rf)
_referenceFrame = rf;
// switch off culling if transform is absolute.
if (_referenceFrame==RELATIVE_TO_ABSOLUTE) setCullingActive(false);
if (_referenceFrame==RELATIVE) setCullingActive(false);
else setCullingActive(true);
}