BasicAnimationManager 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* -*-c++-*-
  2. * Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
  3. *
  4. * This library is open source and may be redistributed and/or modified under
  5. * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
  6. * (at your option) any later version. The full license is in LICENSE file
  7. * included with this distribution, and on the openscenegraph.org website.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * OpenSceneGraph Public License for more details.
  13. */
  14. #ifndef OSGANIMATION_BASIC_ANIMATION_MANAGER_H
  15. #define OSGANIMATION_BASIC_ANIMATION_MANAGER_H
  16. #include <osg/Group>
  17. #include <osgAnimation/AnimationManagerBase>
  18. #include <osgAnimation/Export>
  19. #include <osg/FrameStamp>
  20. namespace osgAnimation
  21. {
  22. class OSGANIMATION_EXPORT BasicAnimationManager : public AnimationManagerBase
  23. {
  24. public:
  25. META_Object(osgAnimation, BasicAnimationManager);
  26. BasicAnimationManager();
  27. BasicAnimationManager(const BasicAnimationManager& b, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
  28. BasicAnimationManager(const AnimationManagerBase& b, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
  29. virtual ~BasicAnimationManager();
  30. void update (double time);
  31. void playAnimation (Animation* pAnimation, int priority = 0, float weight = 1.0);
  32. bool stopAnimation (Animation* pAnimation);
  33. bool findAnimation (Animation* pAnimation);
  34. bool isPlaying (Animation* pAnimation);
  35. bool isPlaying (const std::string& animationName);
  36. void stopAll();
  37. protected:
  38. typedef std::map<int, AnimationList > AnimationLayers;
  39. AnimationLayers _animationsPlaying;
  40. double _lastUpdate;
  41. };
  42. }
  43. #endif