Nebula
Loading...
Searching...
No Matches
animation.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
15#include "resources/resource.h"
16#include "ids/idallocator.h"
20
21//------------------------------------------------------------------------------
22namespace CoreAnimation
23{
24
26
29 const AnimCurve& curve
30 , const Timing::Tick time
31 , uint& key
32 , const AnimKeyBuffer::Interval* sampleTimes
33);
34
35//------------------------------------------------------------------------------
38extern void AnimSampleStep(
39 const AnimClip& clip,
40 const Util::FixedArray<AnimCurve>& curves,
41 const Timing::Tick time,
42 const Math::vec4& velocityScale,
43 const Util::FixedArray<Math::vec4>& idleSamples,
44 const float* srcSamplePtr,
45 const AnimKeyBuffer::Interval* intervalPtr,
46 uint* outSampleKeyPtr,
47 float* outSamplePtr,
48 uchar* outSampleCounts
49);
50
51//------------------------------------------------------------------------------
54extern void AnimSampleLinear(
55 const AnimClip& clip,
56 const Util::FixedArray<AnimCurve>& curves,
57 const Timing::Tick time,
58 const Math::vec4& velocityScale,
59 const Util::FixedArray<Math::vec4>& idleSamples,
60 const float* srcSamplePtr,
61 const AnimKeyBuffer::Interval* intervalPtr,
62 uint* outSampleKeyPtr,
63 float* outSamplePtr,
64 uchar* outSampleCounts
65);
66
67//------------------------------------------------------------------------------
70extern void AnimMix(
71 const AnimClip& clip,
72 const SizeT numSamples,
73 const AnimSampleMask* mask,
74 float mixWeight,
75 const float* src0SamplePtr,
76 const float* src1SamplePtr,
77 const uchar* src0SampleCounts,
78 const uchar* src1SampleCounts,
79 float* outSamplePtr,
80 uchar* outSampleCounts
81);
82
91
95void DestroyAnimation(const AnimationId id);
96
100const AnimClip& AnimGetClip(const AnimationId& id, const IndexT index);
106const IndexT AnimGetIndex(const AnimationId& id, const Util::StringAtom& name);
107
108enum
109{
116
117typedef Ids::IdAllocator<
125
126
127} // namespace CoreAnimation
128//------------------------------------------------------------------------------
An animation clip is a collection of related animation curves (for instance all curves required to an...
Definition animclip.h:25
An animation curve describes a set of animation keys in an AnimKeyBuffer.
Definition animcurve.h:28
An ID allocator associates an id with a slice in an N number of arrays.
Definition idallocator.h:39
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
Organizes key/value pairs by a hash code.
Definition hashtable.h:42
A StringAtom.
Definition stringatom.h:22
#define ID_24_8_TYPE(x)
Definition id.h:132
An animation resource holds a set of animations from a loaded NAX file.
Definition charactercontext.h:40
AnimKeyBuffer::Interval FindNextInterval(const AnimCurve &curve, const Timing::Tick time, uint &key, const AnimKeyBuffer::Interval *sampleTimes)
Definition animsamplejob.cc:37
const Util::FixedArray< AnimClip > & AnimGetClips(const AnimationId &id)
Get clips.
Definition animation.cc:48
void DestroyAnimation(const AnimationId id)
Destroy animation resource.
Definition animation.cc:33
void AnimSampleStep(const AnimClip &clip, const Util::FixedArray< AnimCurve > &curves, const Timing::Tick time, const Math::vec4 &velocityScale, const Util::FixedArray< Math::vec4 > &idleSamples, const float *srcSamplePtr, const AnimKeyBuffer::Interval *intervalPtr, uint *outSampleKeyPtr, float *outSamplePtr, uchar *outSampleCounts)
Definition animsamplejob.cc:69
Ids::IdAllocator< Util::FixedArray< AnimClip >, Util::FixedArray< AnimCurve >, Util::FixedArray< AnimEvent >, Util::HashTable< Util::StringAtom, IndexT, 32 >, Ptr< AnimKeyBuffer > > AnimAllocator
Definition animation.h:123
@ Anim_ClipIndices
Definition animation.h:113
@ Anim_Events
Definition animation.h:112
@ Anim_KeyBuffer
Definition animation.h:114
@ Anim_Clips
Definition animation.h:110
@ Anim_Curves
Definition animation.h:111
const AnimationId CreateAnimation(const AnimationCreateInfo &info)
Create animation resource.
Definition animation.cc:17
const Ptr< AnimKeyBuffer > & AnimGetBuffer(const AnimationId &id)
Get anim buffer.
Definition animation.cc:66
void AnimSampleLinear(const AnimClip &clip, const Util::FixedArray< AnimCurve > &curves, const Timing::Tick time, const Math::vec4 &velocityScale, const Util::FixedArray< Math::vec4 > &idleSamples, const float *srcSamplePtr, const AnimKeyBuffer::Interval *intervalPtr, uint *outSampleKeyPtr, float *outSamplePtr, uchar *outSampleCounts)
Definition animsamplejob.cc:143
const AnimClip & AnimGetClip(const AnimationId &id, const IndexT index)
Get single clip.
Definition animation.cc:57
const IndexT AnimGetIndex(const AnimationId &id, const Util::StringAtom &name)
Get anim clip index.
Definition animation.cc:84
void AnimMix(const AnimClip &clip, const SizeT numSamples, const AnimSampleMask *mask, float mixWeight, const float *src0SamplePtr, const float *src1SamplePtr, const uchar *src0SampleCounts, const uchar *src1SampleCounts, float *outSamplePtr, uchar *outSampleCounts)
Definition animsamplejob.cc:240
const Util::FixedArray< AnimCurve > & AnimGetCurves(const AnimationId &id)
Get curves.
Definition animation.cc:75
AnimAllocator animAllocator
Definition animation.cc:12
ClipStatus::Type clip(const plane &plane, const line &l, line &outClippedLine)
Definition plane.h:208
int Tick
the tick datatype (one tick == 1 millisecond)
Definition time.h:20
Definition animkeybuffer.h:23
Definition animsamplemask.h:16
Definition animation.h:84
Ptr< AnimKeyBuffer > keyBuffer
Definition animation.h:89
Util::FixedArray< AnimCurve > curves
Definition animation.h:86
Util::FixedArray< AnimEvent > events
Definition animation.h:87
Util::HashTable< Util::StringAtom, IndexT, 32 > indices
Definition animation.h:88
Util::FixedArray< AnimClip > clips
Definition animation.h:85
Definition animation.h:25
A 4D vector.
Definition vec4.h:24
unsigned char uchar
Definition types.h:33
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48