From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/mecanim/animation/constantclip.h | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Runtime/mecanim/animation/constantclip.h (limited to 'Runtime/mecanim/animation/constantclip.h') diff --git a/Runtime/mecanim/animation/constantclip.h b/Runtime/mecanim/animation/constantclip.h new file mode 100644 index 0000000..a7de648 --- /dev/null +++ b/Runtime/mecanim/animation/constantclip.h @@ -0,0 +1,36 @@ +#pragma once + +#include "Runtime/mecanim/defs.h" +#include "Runtime/Serialize/Blobification/offsetptr.h" + + +namespace mecanim +{ +namespace animation +{ +struct ConstantClip +{ + UInt32 curveCount; + OffsetPtr data; + + ConstantClip () : curveCount (0) { } + + DEFINE_GET_TYPESTRING(ConstantClip) + + template + inline void Transfer (TransferFunction& transfer) + { + TRANSFER_BLOB_ONLY(curveCount); + MANUAL_ARRAY_TRANSFER2(float, data, curveCount); + } +}; + +// Sample functions +void SampleClip (const ConstantClip& curveData, uint32_t outputCount, float* output); +float SampleClipAtIndex (const ConstantClip& curveData, int index); + +void DestroyConstantClip (ConstantClip& clip, memory::Allocator& alloc); +void CreateConstantClip (ConstantClip& clip, size_t curveCount, memory::Allocator& alloc); + +} +} \ No newline at end of file -- cgit v1.1-26-g67d0