1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3
* This library is open source and may be redistributed and/or modified under
4
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
3
* This library is open source and may be redistributed and/or modified under
4
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5
5
* (at your option) any later version. The full license is in LICENSE file
6
6
* included with this distribution, and on the openscenegraph.org website.
8
8
* This library is distributed in the hope that it will be useful,
9
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
11
* OpenSceneGraph Public License for more details.
32
AutoTransform(const AutoTransform& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
32
AutoTransform(const AutoTransform& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
34
34
virtual osg::Object* cloneType() const { return new AutoTransform (); }
35
35
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new AutoTransform (*this,copyop); }
42
42
virtual AutoTransform* asAutoTransform() { return this; }
43
43
virtual const AutoTransform* asAutoTransform() const { return this; }
45
inline void setPosition(const Vec3& pos) { _position = pos; _matrixDirty=true; dirtyBound(); }
46
inline const Vec3& getPosition() const { return _position; }
45
inline void setPosition(const Vec3d& pos) { _position = pos; _matrixDirty=true; dirtyBound(); }
46
inline const Vec3d& getPosition() const { return _position; }
49
49
inline void setRotation(const Quat& quat) { _rotation = quat; _matrixDirty=true; dirtyBound(); }
50
50
inline const Quat& getRotation() const { return _rotation; }
52
inline void setScale(float scale) { setScale(osg::Vec3(scale,scale,scale)); }
54
void setScale(const Vec3& scale);
55
inline const Vec3& getScale() const { return _scale; }
57
void setMinimumScale(float minimumScale) { _minimumScale = minimumScale; }
58
float getMinimumScale() const { return _minimumScale; }
60
void setMaximumScale(float maximumScale) { _maximumScale = maximumScale; }
61
float getMaximumScale() const { return _maximumScale; }
63
inline void setPivotPoint(const Vec3& pivot) { _pivotPoint = pivot; _matrixDirty=true; dirtyBound(); }
64
inline const Vec3& getPivotPoint() const { return _pivotPoint; }
52
inline void setScale(double scale) { setScale(osg::Vec3(scale,scale,scale)); }
54
void setScale(const Vec3d& scale);
55
inline const Vec3d& getScale() const { return _scale; }
57
void setMinimumScale(double minimumScale) { _minimumScale = minimumScale; }
58
double getMinimumScale() const { return _minimumScale; }
60
void setMaximumScale(double maximumScale) { _maximumScale = maximumScale; }
61
double getMaximumScale() const { return _maximumScale; }
63
inline void setPivotPoint(const Vec3d& pivot) { _pivotPoint = pivot; _matrixDirty=true; dirtyBound(); }
64
inline const Vec3d& getPivotPoint() const { return _pivotPoint; }
67
67
void setAutoUpdateEyeMovementTolerance(float tolerance) { _autoUpdateEyeMovementTolerance = tolerance; }
68
68
float getAutoUpdateEyeMovementTolerance() const { return _autoUpdateEyeMovementTolerance; }
84
84
bool getAutoScaleToScreen() const { return _autoScaleToScreen; }
86
void setAutoScaleTransistionWidthRatio(float ratio) { _autoScaleTransitionWidthRatio = ratio; }
87
float getAutoScaleTransistionWidthRatio() const { return _autoScaleTransitionWidthRatio; }
86
void setAutoScaleTransitionWidthRatio(float ratio) { _autoScaleTransitionWidthRatio = ratio; }
87
float getAutoScaleTransitionWidthRatio() const { return _autoScaleTransitionWidthRatio; }
90
90
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
99
99
virtual ~AutoTransform() {}
103
float _autoUpdateEyeMovementTolerance;
103
double _autoUpdateEyeMovementTolerance;
105
105
AutoRotateMode _autoRotateMode;
107
107
bool _autoScaleToScreen;
109
109
mutable Quat _rotation;
110
mutable Vec3d _scale;
111
111
mutable bool _firstTimeToInitEyePoint;
112
112
mutable osg::Vec3 _previousEyePoint;
113
113
mutable osg::Vec3 _previousLocalUp;
114
114
mutable Viewport::value_type _previousWidth;
115
mutable Viewport::value_type _previousHeight;
116
mutable osg::Matrix _previousProjection;
117
mutable osg::Vec3 _previousPosition;
121
float _autoScaleTransitionWidthRatio;
115
mutable Viewport::value_type _previousHeight;
116
mutable osg::Matrixd _previousProjection;
117
mutable osg::Vec3d _previousPosition;
119
double _minimumScale;
120
double _maximumScale;
121
double _autoScaleTransitionWidthRatio;
123
123
void computeMatrix() const;
125
mutable bool _matrixDirty;
126
mutable osg::Matrix _cachedMatrix;
125
mutable bool _matrixDirty;
126
mutable osg::Matrixd _cachedMatrix;