Nebula
Loading...
Searching...
No Matches
CoreAnimation Namespace Reference

Detailed Description

An animation resource holds a set of animations from a loaded NAX file.

An anim sample mask controls which samples should be used, and which should be avoided.

Classes

struct  AnimationCreateInfo
 
struct  AnimationId
 
class  AnimationLoader
 
struct  AnimationResourceId
 
class  AnimClip
 An animation clip is a collection of related animation curves (for instance all curves required to animate a character). More...
 
class  AnimCurve
 An animation curve describes a set of animation keys in an AnimKeyBuffer. More...
 
class  AnimEvent
 An animation event associates a name with a point in time. More...
 
class  AnimEventEmitter
 The AnimEventEmitter collects all animevents which are active in the given time range. More...
 
class  AnimKeyBuffer
 A simple buffer of vec4 animation keys. More...
 
class  AnimSampleBuffer
 Stores the result of an animation sampling operation, stores samples key values and sample-counts which keep track of the number of samples which contributed to a mixing result (this is necessary for correct mixing of partial animations). More...
 
struct  AnimSampleMask
 
class  AnimSampleMixInfo
 A data structure for providing sample/mixing attributes to asynchronous jobs in the CoreAnimation subsystem. More...
 
class  AnimUtil
 A class which contains utility methods for animation sampling and mixing. More...
 
class  CurveType
 Describes the general data type of the keys stored in an animation curve. More...
 
class  InfinityType
 Describes how time position outsides of an animation curve's scope are handled. More...
 
struct  Nax2Curve
 
struct  Nax2Group
 
struct  Nax2Header
 legacy NAX2 file format structs More...
 
struct  Nax3Anim
 
struct  Nax3AnimEvent
 
struct  Nax3Clip
 
struct  Nax3Curve
 
struct  Nax3Header
 NAX3 file format structs. More...
 
struct  Nax3Interval
 
class  SampleType
 Describes how an animation curve should be sampled. More...
 

Typedefs

typedef Ids::IdAllocator< Util::FixedArray< AnimClip >, Util::FixedArray< AnimCurve >, Util::FixedArray< AnimEvent >, Util::HashTable< Util::StringAtom, IndexT, 32 >, Ptr< AnimKeyBuffer > > AnimAllocator
 
typedef Ids::IdAllocator< Util::FixedArray< AnimationId > > AnimationResourceAllocator
 

Enumerations

enum  {
  Anim_Clips , Anim_Curves , Anim_Events , Anim_ClipIndices ,
  Anim_KeyBuffer
}
 

Functions

void AnimSampleJob (SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset, void *ctx)
 
void AnimSampleJobWithMix (SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset, void *ctx)
 
const AnimationId CreateAnimation (const AnimationCreateInfo &info)
 Create animation resource.
 
void DestroyAnimation (const AnimationId id)
 Destroy animation resource.
 
const Util::FixedArray< AnimClip > & AnimGetClips (const AnimationId &id)
 Get clips.
 
const AnimClipAnimGetClip (const AnimationId &id, const IndexT index)
 Get single clip.
 
const Ptr< AnimKeyBuffer > & AnimGetBuffer (const AnimationId &id)
 Get anim buffer.
 
const Util::FixedArray< AnimCurve > & AnimGetCurves (const AnimationId &id)
 Get curves.
 
const IndexT AnimGetIndex (const AnimationId &id, const Util::StringAtom &name)
 Get anim clip index.
 
AnimKeyBuffer::Interval FindNextInterval (const AnimCurve &curve, const Timing::Tick time, uint &key, const AnimKeyBuffer::Interval *sampleTimes)
 
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)
 
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)
 
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)
 
 __ImplementClass (CoreAnimation::AnimationLoader, 'SANL', Resources::ResourceLoader)
 
const AnimationId AnimationResourceGetAnimation (const AnimationResourceId id, IndexT index)
 Get animation from resource.
 
void DestroyAnimationResource (const AnimationResourceId id)
 Destroy animation resource.
 
bool operator== (const AnimEvent &a, const AnimEvent &b)
 
bool operator!= (const AnimEvent &a, const AnimEvent &b)
 
bool operator< (const AnimEvent &a, const AnimEvent &b)
 
bool operator> (const AnimEvent &a, const AnimEvent &b)
 
bool operator<= (const AnimEvent &a, const AnimEvent &b)
 
bool operator>= (const AnimEvent &a, const AnimEvent &b)
 
 __ImplementClass (CoreAnimation::AnimKeyBuffer, 'ANKB', Core::RefCounted)
 
Timing::Tick WrapTime (const AnimCurve &curve, Timing::Tick time, Timing::Tick lastTime)
 
void AnimSampleJobFunc (const JobFuncContext &ctx)
 This job function only performs sampling, not mixing.
 
void AnimSampleMixJobFunc (const JobFuncContext &ctx)
 Performs both animation sampling, and mixing with another sample buffer in a single job.
 
void AnimJobUtilSampleStep (const AnimCurve *curves, int numCurves, const float4 &velocityScale, const float4 *src0SamplePtr, float4 *outSamplePtr, uchar *outSampleCounts)
 Sampler for "step" interpolation type.
 
void AnimJobUtilSampleLinear (const AnimCurve *curves, int numCurves, float sampleWeight, const float4 &velocityScale, const float4 *src0SamplePtr, const float4 *src1SamplePtr, float4 *outSamplePtr, uchar *outSampleCounts)
 Sampler for "linear" interpolation type.
 
void AnimJobUtilMix (const AnimCurve *curves, int numCurves, const Characters::CharacterJointMask *mask, float mixWeight, const float4 *src0SamplePtr, const float4 *src1SamplePtr, const uchar *src0SampleCounts, const uchar *src1SampleCounts, float4 *outSamplePtr, uchar *outSampleCounts)
 Mixes 2 source sample buffers into a destination sample buffer using a single lerp-value between 0.0 and 1.0.
 

Variables

AnimAllocator animAllocator
 
AnimationResourceAllocator animationResourceAllocator
 

Typedef Documentation

◆ AnimAllocator

◆ AnimationResourceAllocator

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
Anim_Clips 
Anim_Curves 
Anim_Events 
Anim_ClipIndices 
Anim_KeyBuffer 

Function Documentation

◆ __ImplementClass() [1/2]

CoreAnimation::__ImplementClass ( CoreAnimation::AnimationLoader ,
'SANL' ,
Resources::ResourceLoader  )

◆ __ImplementClass() [2/2]

CoreAnimation::__ImplementClass ( CoreAnimation::AnimKeyBuffer ,
'ANKB' ,
Core::RefCounted  )

◆ AnimationResourceGetAnimation()

const AnimationId CoreAnimation::AnimationResourceGetAnimation ( const AnimationResourceId id,
IndexT index )

Get animation from resource.

◆ AnimGetBuffer()

const Ptr< AnimKeyBuffer > & CoreAnimation::AnimGetBuffer ( const AnimationId & id)

Get anim buffer.

◆ AnimGetClip()

const AnimClip & CoreAnimation::AnimGetClip ( const AnimationId & id,
const IndexT index )

Get single clip.

◆ AnimGetClips()

const Util::FixedArray< AnimClip > & CoreAnimation::AnimGetClips ( const AnimationId & id)

Get clips.

◆ AnimGetCurves()

const Util::FixedArray< AnimCurve > & CoreAnimation::AnimGetCurves ( const AnimationId & id)

Get curves.

◆ AnimGetIndex()

const IndexT CoreAnimation::AnimGetIndex ( const AnimationId & id,
const Util::StringAtom & name )

Get anim clip index.

◆ AnimJobUtilMix()

void CoreAnimation::AnimJobUtilMix ( const AnimCurve * curves,
int numCurves,
const Characters::CharacterJointMask * mask,
float mixWeight,
const float4 * src0SamplePtr,
const float4 * src1SamplePtr,
const uchar * src0SampleCounts,
const uchar * src1SampleCounts,
float4 * outSamplePtr,
uchar * outSampleCounts )
inline

Mixes 2 source sample buffers into a destination sample buffer using a single lerp-value between 0.0 and 1.0.

Mixing takes sample counts into consideration. A source sample count of 0 indicates, the this sample is not valid and the result is made of 100% of the other sample. If both source samples are valid, the result is blended from both source samples. This gives the expected results when an animation clip only manipulates parts of a character skeleton.

NOTE: the output data blocks may be identical with one of the input data blocks!

◆ AnimJobUtilSampleLinear()

void CoreAnimation::AnimJobUtilSampleLinear ( const AnimCurve * curves,
int numCurves,
float sampleWeight,
const float4 & velocityScale,
const float4 * src0SamplePtr,
const float4 * src1SamplePtr,
float4 * outSamplePtr,
uchar * outSampleCounts )
inline

Sampler for "linear" interpolation type.

◆ AnimJobUtilSampleStep()

void CoreAnimation::AnimJobUtilSampleStep ( const AnimCurve * curves,
int numCurves,
const float4 & velocityScale,
const float4 * src0SamplePtr,
float4 * outSamplePtr,
uchar * outSampleCounts )
inline

Sampler for "step" interpolation type.

◆ AnimMix()

void CoreAnimation::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 )
extern

◆ AnimSampleJob()

void CoreAnimation::AnimSampleJob ( SizeT totalJobs,
SizeT groupSize,
IndexT groupIndex,
SizeT invocationOffset,
void * ctx )
extern

◆ AnimSampleJobFunc()

void CoreAnimation::AnimSampleJobFunc ( const JobFuncContext & ctx)
extern

This job function only performs sampling, not mixing.

This is usually called for the first anim job of a mixing chain.

◆ AnimSampleJobWithMix()

void CoreAnimation::AnimSampleJobWithMix ( SizeT totalJobs,
SizeT groupSize,
IndexT groupIndex,
SizeT invocationOffset,
void * ctx )
extern

◆ AnimSampleLinear()

void CoreAnimation::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 )
extern

◆ AnimSampleMixJobFunc()

void CoreAnimation::AnimSampleMixJobFunc ( const JobFuncContext & ctx)
extern

Performs both animation sampling, and mixing with another sample buffer in a single job.

◆ AnimSampleStep()

void CoreAnimation::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 )
extern

◆ CreateAnimation()

const AnimationId CoreAnimation::CreateAnimation ( const AnimationCreateInfo & info)

Create animation resource.

◆ DestroyAnimation()

void CoreAnimation::DestroyAnimation ( const AnimationId id)

Destroy animation resource.

◆ DestroyAnimationResource()

void CoreAnimation::DestroyAnimationResource ( const AnimationResourceId id)

Destroy animation resource.

◆ FindNextInterval()

AnimKeyBuffer::Interval CoreAnimation::FindNextInterval ( const AnimCurve & curve,
const Timing::Tick time,
uint & key,
const AnimKeyBuffer::Interval * sampleTimes )
extern

◆ operator!=()

bool CoreAnimation::operator!= ( const AnimEvent & a,
const AnimEvent & b )
inline

◆ operator<()

bool CoreAnimation::operator< ( const AnimEvent & a,
const AnimEvent & b )
inline

◆ operator<=()

bool CoreAnimation::operator<= ( const AnimEvent & a,
const AnimEvent & b )
inline

◆ operator==()

bool CoreAnimation::operator== ( const AnimEvent & a,
const AnimEvent & b )
inline

◆ operator>()

bool CoreAnimation::operator> ( const AnimEvent & a,
const AnimEvent & b )
inline

◆ operator>=()

bool CoreAnimation::operator>= ( const AnimEvent & a,
const AnimEvent & b )
inline

◆ WrapTime()

Timing::Tick CoreAnimation::WrapTime ( const AnimCurve & curve,
Timing::Tick time,
Timing::Tick lastTime )
inline

Variable Documentation

◆ animAllocator

AnimAllocator CoreAnimation::animAllocator

◆ animationResourceAllocator

AnimationResourceAllocator CoreAnimation::animationResourceAllocator