|
JK2eA
|
00001 #pragma once 00002 00003 // FPS animace 00004 #include <Vector.h> 00005 #include "CurveGraph.h" 00006 #include "CurveGraphSlerp.h" 00007 #include "CurveGraphLinear.h" 00008 #include "Controller.h" 00009 #include "ControllerGraph.h" 00010 #include "Bone.h" 00011 #include "SkeletalAnimationMixer.h" 00012 00016 class CControllerSkeletalAnimation : public CController { 00017 private: 00021 struct BONE_KEYFRAMED { 00022 CBone* bone; 00023 CCurveGraphSlerp* rot_graph; 00024 CCurveGraphLinear<vec>* pos_graph; 00025 00026 CControllerGraph<vec>* cnt_pos; 00027 CControllerGraph<vec4>* cnt_rot; 00028 00029 BONE_KEYFRAMED(); 00030 }; 00031 00032 std::string m_name; // 00033 std::vector<BONE_KEYFRAMED> m_keyframes; 00034 CSkeleton* m_anim_for_skel; 00035 float m_fps; 00036 float m_totaltime; 00037 00038 00039 public: 00045 CControllerSkeletalAnimation(const std::string& name, CSkeleton* anim_for_skel); 00049 virtual ~CControllerSkeletalAnimation(); 00050 00055 bool Load(const char* file_name); 00056 00060 void Release(); 00061 00062 00069 void ToMixer(CSkeletalAnimationMixer* mixer, float* global_weight, char priority); 00070 00071 00072 /* 00073 Inherited 00074 */ 00075 virtual void Update(float dt); 00076 virtual void SetTimeScale(const float fTimeScale); 00077 virtual void SetORT(CONTRL_ORT ort); 00078 virtual void Reset(const bool activate = false); 00079 00080 CNTRL_CLASS_NAME(CControllerSkeletalAnimation) 00081 }; 00082
1.8.0