00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SG_OFFSET_TRASNFORM_HXX
00023 #define SG_OFFSET_TRASNFORM_HXX
00024
00025 #include <osg/Transform>
00026
00027 class SGOffsetTransform : public osg::Transform {
00028 public:
00029 SGOffsetTransform(double scaleFactor = 1.0);
00030 SGOffsetTransform(const SGOffsetTransform&,
00031 const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
00032
00033 META_Node(simgear, SGOffsetTransform);
00034
00035 double getScaleFactor() const { return _scaleFactor; };
00036
00037 void setScaleFactor(double scaleFactor)
00038 {
00039 _scaleFactor = scaleFactor;
00040 _rScaleFactor = 1.0 / scaleFactor;
00041 }
00042
00043 virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,
00044 osg::NodeVisitor* nv) const;
00045 virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,
00046 osg::NodeVisitor* nv) const;
00047
00048 private:
00049 double _scaleFactor;
00050 double _rScaleFactor;
00051 };
00052
00053 #endif