summaryrefslogtreecommitdiff
path: root/Runtime/Animation/AvatarPlayback.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Animation/AvatarPlayback.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/Animation/AvatarPlayback.h')
-rw-r--r--Runtime/Animation/AvatarPlayback.h51
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