/*] Copyright (c) 2009-2010, Charles McGarvey [************************** **] All rights reserved. * * vi:ts=4 sw=4 tw=75 * * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * **************************************************************************/ #ifndef _ANIMATION_HH_ #define _ANIMATION_HH_ /** * @file Animation.hh * Motion picture!! */ #include #include #include #include class Animation; typedef boost::shared_ptr AnimationP; /** * A class to manage frame-based animation. Animation sequences can be * loaded from file, then named sequences are started. The animation is * updated periodically (each update cycle), and the correct current frame * is determined. This class is generic enough that a frame can mean just * about anything to whatever drawing context is used to render the frame. */ class Animation : public Mf::Resource { class Impl; boost::shared_ptr mImpl; public: Animation(const std::string& name); static AnimationP alloc(const std::string& name) { return AnimationP(new Animation(name)); } void startSequence(const std::string& name); void update(Mf::Scalar t, Mf::Scalar dt); unsigned getFrame() const; static bool getPath(std::string& name); }; #endif // _ANIMATION_HH_