00001 /* 00002 * Morph target animation header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_MORPHTARGET_ANIMATION_H__ 00009 #define __SP_MORPHTARGET_ANIMATION_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 #include "SceneGraph/spSceneMesh.hpp" 00014 #include "SceneGraph/Animation/spMeshAnimation.hpp" 00015 #include "SceneGraph/Animation/spAnimationBaseStructures.hpp" 00016 00017 #include <vector> 00018 00019 00020 namespace sp 00021 { 00022 namespace scene 00023 { 00024 00025 00031 class SP_EXPORT MorphTargetAnimation : public MeshAnimation 00032 { 00033 00034 public: 00035 00036 MorphTargetAnimation(); 00037 virtual ~MorphTargetAnimation(); 00038 00039 /* === Functions === */ 00040 00048 void addKeyframeSequence(video::MeshBuffer* Surface, u32 Index, const std::vector<SVertexKeyframe> &Keyframes); 00049 00051 void removeKeyframeSequence(video::MeshBuffer* Surface, u32 Index); 00052 00053 void clearKeyframes(); 00054 00055 virtual void setupManualAnimation(SceneNode* Node); 00056 00061 virtual void updateAnimation(SceneNode* Node); 00062 00063 virtual u32 getKeyframeCount() const; 00064 00065 virtual void interpolate(u32 IndexFrom, u32 IndexTo, f32 Interpolation); 00066 00067 virtual void copy(const Animation* Other); 00068 00069 private: 00070 00071 /* === Members === */ 00072 00073 std::list<SMorphTargetVertex> Vertices_; 00074 00075 u32 MaxKeyframe_; 00076 00077 bool isCulling_; 00078 00079 }; 00080 00081 00082 } // /namespace scene 00083 00084 } // /namespace sp 00085 00086 00087 #endif 00088 00089 00090 00091 // ================================================================================