diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Animation/AvatarPlayback.h |
Diffstat (limited to 'Runtime/Animation/AvatarPlayback.h')
-rw-r--r-- | Runtime/Animation/AvatarPlayback.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Runtime/Animation/AvatarPlayback.h b/Runtime/Animation/AvatarPlayback.h new file mode 100644 index 0000000..75e9ff4 --- /dev/null +++ b/Runtime/Animation/AvatarPlayback.h @@ -0,0 +1,51 @@ +#ifndef AVATARPLAYBACK_H +#define AVATARPLAYBACK_H + +#include "Runtime/Animation/MecanimUtility.h" + +namespace mecanim +{ + namespace animation + { + struct AvatarMemory ; + } +} + +class AvatarFrame +{ +public: + AvatarFrame() : m_AvatarMemory(0), m_CurrentTime(0) {} + mecanim::animation::AvatarMemory* m_AvatarMemory; + float m_CurrentTime; +}; + +class AvatarPlayback +{ +public: + + AvatarPlayback(MemLabelId label); + + void Clear(); + mecanim::animation::AvatarMemory* PlayFrame(float time, float& effectiveTime); + void RecordFrame(float deltaTime, const mecanim::animation::AvatarMemory* srcMemory); + + void Init(int frameCount); + + float StartTime(); + float StopTime(); + float CursorTime(); + + +private: + std::vector<AvatarFrame> m_Frames; + + int m_FrameCount; + int m_StartIndex; + int m_StopIndex; + int m_CursorIndex; + + int NextIndex(int index); + mecanim::memory::MecanimAllocator m_Alloc; +}; + +#endif // AVATARPLAYBACK_H |