Changeset 3295
- Timestamp:
- 08/17/04 09:58:32 (9 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 2 modified
-
include/osg/AutoTransform (modified) (2 diffs)
-
src/osg/AutoTransform.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/AutoTransform
r3245 r3295 120 120 mutable bool _firstTimeToInitEyePoint; 121 121 mutable osg::Vec3 _previousEyePoint; 122 mutable osg::Vec3 _previousLocalUp; 122 123 mutable int _previousWidth; 123 124 mutable int _previousHeight; … … 130 131 mutable bool _matrixDirty; 131 132 mutable osg::Matrix _cachedMatrix; 132 133 134 135 133 }; 136 134 -
OpenSceneGraph/trunk/src/osg/AutoTransform.cpp
r3245 r3295 114 114 115 115 osg::Vec3 eyePoint = cs->getEyeLocal(); 116 osg::Vec3 localUp = cs->getUpLocal(); 116 117 osg::Vec3 position = getPosition(); 117 118 … … 123 124 osg::Vec3 dv = _previousEyePoint-eyePoint; 124 125 if (dv.length2()>getAutoUpdateEyeMovementTolerance()*(eyePoint-getPosition()).length2()) 126 { 127 doUpdate = true; 128 } 129 osg::Vec3 dupv = _previousLocalUp-localUp; 130 // rotating the camera only affects ROTATE_TO_* 131 if (_autoRotateMode && 132 dupv.length2()>getAutoUpdateEyeMovementTolerance()) 125 133 { 126 134 doUpdate = true; … … 160 168 osg::Vec3 PosToEye = _position - eyePoint; 161 169 osg::Matrix lookto = osg::Matrix::lookAt( 162 osg::Vec3(0,0,0), PosToEye, cs->getUpLocal());170 osg::Vec3(0,0,0), PosToEye, localUp); 163 171 Quat q; 164 172 q.set(osg::Matrix::inverse(lookto)); … … 167 175 168 176 _previousEyePoint = eyePoint; 177 _previousLocalUp = localUp; 169 178 _previousWidth = width; 170 179 _previousHeight = height;
