From Jay Zuckerman, fixes to AutoTransform so that it includes checking of
previous position value.
This commit is contained in:
parent
009cda4134
commit
e9f4ed87bc
@ -91,6 +91,8 @@ class SG_EXPORT AutoTransform : public Transform
|
||||
mutable int _previousWidth;
|
||||
mutable int _previousHeight;
|
||||
mutable osg::Matrix _previousProjection;
|
||||
mutable osg::Vec3 _previousPosition;
|
||||
|
||||
|
||||
void computeMatrix() const;
|
||||
|
||||
|
@ -112,7 +112,8 @@ void AutoTransform::accept(NodeVisitor& nv)
|
||||
height = viewport->height();
|
||||
}
|
||||
|
||||
const osg::Vec3& eyePoint = cs->getEyeLocal();
|
||||
osg::Vec3 eyePoint = cs->getEyeLocal();
|
||||
osg::Vec3 position = getPosition();
|
||||
|
||||
const osg::Matrix& projection = cs->getProjectionMatrix();
|
||||
|
||||
@ -132,6 +133,10 @@ void AutoTransform::accept(NodeVisitor& nv)
|
||||
{
|
||||
doUpdate = true;
|
||||
}
|
||||
else if (position != _previousPosition)
|
||||
{
|
||||
doUpdate = true;
|
||||
}
|
||||
}
|
||||
_firstTimeToInitEyePoint = false;
|
||||
|
||||
@ -155,6 +160,7 @@ void AutoTransform::accept(NodeVisitor& nv)
|
||||
_previousWidth = width;
|
||||
_previousHeight = height;
|
||||
_previousProjection = projection;
|
||||
_previousPosition = position;
|
||||
|
||||
_matrixDirty = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user