TransformCallback 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
  2. *
  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. * (at your option) any later version. The full license is in LICENSE file
  6. * included with this distribution, and on the openscenegraph.org website.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * OpenSceneGraph Public License for more details.
  12. */
  13. //C++ header
  14. #ifndef OSGUTIL_TRANSFORMCALLBACK
  15. #define OSGUTIL_TRANSFORMCALLBACK 1
  16. #include <osg/Callback>
  17. #include <osgUtil/Export>
  18. namespace osgUtil
  19. {
  20. /** TransformCallback is now deprecated, use osg::AnimationPathCallback instead.*/
  21. class OSGUTIL_EXPORT TransformCallback : public osg::NodeCallback
  22. {
  23. public:
  24. TransformCallback(const osg::Vec3& pivot,const osg::Vec3& axis,float angularVelocity);
  25. void setPause(bool pause) { _pause = pause; }
  26. /** implements the callback*/
  27. virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
  28. protected:
  29. float _angular_velocity;
  30. osg::Vec3 _pivot;
  31. osg::Vec3 _axis;
  32. unsigned int _previousTraversalNumber;
  33. double _previousTime;
  34. bool _pause;
  35. };
  36. }
  37. #endif