openscenegraph
BasicAnimationManager
Go to the documentation of this file.
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
15#ifndef OSGANIMATION_BASIC_ANIMATION_MANAGER_H
16#define OSGANIMATION_BASIC_ANIMATION_MANAGER_H
17
18#include <osg/Group>
19#include <osgAnimation/AnimationManagerBase>
20#include <osgAnimation/Export>
21#include <osg/FrameStamp>
22
23namespace osgAnimation
24{
25 class OSGANIMATION_EXPORT BasicAnimationManager : public AnimationManagerBase
26 {
27 public:
28
29 META_Object(osgAnimation, BasicAnimationManager);
30
31 BasicAnimationManager();
32 BasicAnimationManager(const BasicAnimationManager& b, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
33 BasicAnimationManager(const AnimationManagerBase& b, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
34 virtual ~BasicAnimationManager();
35
36 void update (double time);
37
38 void playAnimation (Animation* pAnimation, int priority = 0, float weight = 1.0);
39 bool stopAnimation (Animation* pAnimation);
40
41 bool findAnimation (Animation* pAnimation);
42 bool isPlaying (Animation* pAnimation);
43 bool isPlaying (const std::string& animationName);
44
45 void stopAll();
46
47 protected:
48 typedef std::map<int, AnimationList > AnimationLayers;
49 AnimationLayers _animationsPlaying;
50 double _lastUpdate;
51 };
52
53}
54#endif