25 namespace Visualization
38 virtual osg::Object* cloneType()
const {
return new VsAutoTransform (); }
39 virtual osg::Object* clone(
const osg::CopyOp& copyop)
const {
return new VsAutoTransform (*
this,copyop); }
40 virtual bool isSameKindAs(
const osg::Object* obj)
const {
return dynamic_cast<const VsAutoTransform *
>(obj)!=NULL; }
41 virtual const char* className()
const {
return "VsAutoTransform"; }
42 virtual const char* libraryName()
const {
return "osg"; }
44 virtual void accept(osg::NodeVisitor& nv);
49 inline void setPosition(
const osg::Vec3d& pos) { _position = pos; _matrixDirty=
true; dirtyBound(); }
50 inline const osg::Vec3d& getPosition()
const {
return _position; }
53 inline void setRotation(
const osg::Quat& quat) { _rotation = quat; _matrixDirty=
true; dirtyBound(); }
54 inline const osg::Quat& getRotation()
const {
return _rotation; }
56 inline void setScale(
double scale) { setScale(osg::Vec3(scale,scale,scale)); }
58 void setScale(
const osg::Vec3d& scale);
59 inline const osg::Vec3d& getScale() {
return _scale; }
61 void setMinimumScale(
double minimumScale) { _minimumScale = minimumScale; }
62 double getMinimumScale() {
return _minimumScale; }
64 void setMaximumScale(
double maximumScale) { _maximumScale = maximumScale; }
65 double getMaximumScale() {
return _maximumScale; }
67 inline void setPivotPoint(
const osg::Vec3d& pivot) { _pivotPoint = pivot; _matrixDirty=
true; dirtyBound(); }
68 inline const osg::Vec3d& getPivotPoint() {
return _pivotPoint; }
71 void setAutoUpdateEyeMovementTolerance(
float tolerance) { _autoUpdateEyeMovementTolerance = tolerance; }
72 float getAutoUpdateEyeMovementTolerance() {
return _autoUpdateEyeMovementTolerance; }
82 void setAutoRotateMode(AutoRotateMode mode) { _autoRotateMode = mode; _firstTimeToInitEyePoint =
true; }
84 AutoRotateMode getAutoRotateMode()
const {
return _autoRotateMode; }
86 void setAutoScaleToScreen(
bool autoScaleToScreen) { _autoScaleToScreen = autoScaleToScreen; _matrixDirty=
true; }
88 bool getAutoScaleToScreen()
const {
return _autoScaleToScreen; }
90 void setAutoScaleTransitionWidthRatio(
float ratio) { _autoScaleTransitionWidthRatio = ratio; }
91 float getAutoScaleTransitionWidthRatio()
const {
return _autoScaleTransitionWidthRatio; }
94 virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv)
const;
96 virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv)
const;
98 virtual osg::BoundingSphere computeBound()
const;
105 osg::Vec3d _position;
106 osg::Vec3d _pivotPoint;
107 double _autoUpdateEyeMovementTolerance;
109 AutoRotateMode _autoRotateMode;
111 bool _autoScaleToScreen;
113 mutable osg::Quat _rotation;
114 mutable osg::Vec3d _scale;
115 mutable bool _firstTimeToInitEyePoint;
116 mutable osg::Vec3 _previousEyePoint;
117 mutable osg::Vec3 _previousLocalUp;
118 mutable osg::Viewport::value_type _previousWidth;
119 mutable osg::Viewport::value_type _previousHeight;
120 mutable osg::Matrixd _previousProjection;
121 mutable osg::Vec3d _previousPosition;
123 double _minimumScale;
124 double _maximumScale;
125 double _autoScaleTransitionWidthRatio;
127 void computeMatrix()
const;
129 mutable bool _matrixDirty;
130 mutable osg::Matrixd _cachedMatrix;
Classes for implementing the cm-labs vortex physics engine for AnimatLab.