1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 03:39:14 +00:00
OpenMW/components/resource/animation.hpp

43 lines
1017 B
C++
Raw Normal View History

2020-11-18 23:11:56 +00:00
#ifndef OPENMW_COMPONENTS_RESOURCE_ANIMATION_HPP
#define OPENMW_COMPONENTS_RESOURCE_ANIMATION_HPP
#include <vector>
#include <osg/Node>
#include <osg/Object>
#include <osgAnimation/Channel>
namespace Resource
{
/// Stripped down class of osgAnimation::Animation, only needed for OSG's plugin formats like dae
class Animation : public osg::Object
{
2022-09-22 18:26:05 +00:00
public:
META_Object(Resource, Animation)
2020-11-18 23:11:56 +00:00
2022-09-22 18:26:05 +00:00
Animation()
: mDuration(0.0)
, mStartTime(0)
{
}
2020-11-18 23:11:56 +00:00
2022-09-22 18:26:05 +00:00
Animation(const Animation&, const osg::CopyOp&);
~Animation() {}
2020-11-18 23:11:56 +00:00
2022-09-22 18:26:05 +00:00
void addChannel(osg::ref_ptr<osgAnimation::Channel> pChannel);
2020-11-18 23:11:56 +00:00
2022-09-22 18:26:05 +00:00
std::vector<osg::ref_ptr<osgAnimation::Channel>>& getChannels();
2020-11-18 23:11:56 +00:00
2022-09-22 18:26:05 +00:00
const std::vector<osg::ref_ptr<osgAnimation::Channel>>& getChannels() const;
2020-11-18 23:11:56 +00:00
2022-09-22 18:26:05 +00:00
bool update(double time);
2020-11-18 23:11:56 +00:00
2022-09-22 18:26:05 +00:00
protected:
double mDuration;
double mStartTime;
std::vector<osg::ref_ptr<osgAnimation::Channel>> mChannels;
};
2020-11-18 23:11:56 +00:00
}
#endif