#pragma once #include "animation.h" #include "geometry.h" #include "keyframe.h" #include "jointtransform.h" #include "joint.h" #include #include class ColladaModel; class Animator { private: ColladaModel* entity_; Animation current_animation_; float animation_time_; void increaseAnimationTime(); std::map calculateCurrentAnimationPose(); void applyPoseToJoints(std::map currentPose, Joint joint, Matrix parentTransform); std::vector getPreviousAndNextFrames(); float calculateProgression(Keyframe previousFrame, Keyframe nextFrame); std::map interpolatePoses(Keyframe previousFrame, Keyframe nextFrame, float progression); public: Animator(ColladaModel entity); void doanimation(Animation animation); void update(); }; template< class Key, class T, class Comparator, class MapAllocator, class SetAllocator> void make_key_set(const std::map& map, std::set& set) { set.clear(); typedef typename std::map map_type; typename map_type::const_iterator itr = map.begin(); while (map.end() != itr) { set.insert((itr++)->first); } }