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/mecanim/animation/constantclip.h |
Diffstat (limited to 'Runtime/mecanim/animation/constantclip.h')
-rw-r--r-- | Runtime/mecanim/animation/constantclip.h | 36 |
1 files changed, 36 insertions, 0 deletions
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<float> data; + + ConstantClip () : curveCount (0) { } + + DEFINE_GET_TYPESTRING(ConstantClip) + + template<class TransferFunction> + 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 |