#include <RadientAnimation.h>
Public Attributes | |
| RadientAnimationValueDesc | Value |
| Type and fixed array length produced by this sampler. | |
| RADIENT_ANIMATION_INTERPOLATION | Interpolation = RADIENT_ANIMATION_INTERPOLATION_LINEAR |
| const Float32 * | pTimes = nullptr |
| const void * | pValues = nullptr |
| Uint64 | ValueDataSize = 0 |
| Uint32 | KeyframeCount = 0 |
Immutable keyframe sampler stored by an animation clip.
pTimes contains KeyframeCount strictly increasing, finite clip-local times. STEP and LINEAR samplers contain KeyframeCount arrays described by Value in pValues. CUBIC_SPLINE samplers contain three arrays per keyframe in incoming-tangent, value, outgoing-tangent order. Values use the native type selected by Value.Type and arrays are tightly packed. ValueDataSize must exactly equal the native value size multiplied by Value.ArraySize, KeyframeCount, and three for CUBIC_SPLINE (one otherwise). Boolean and integer samplers only support STEP interpolation. Floating-point components must be finite. A one-key CUBIC_SPLINE sampler is valid and represents the key's central value; its tangent arrays are still present. Cubic tangents are derivatives per second in the same native storage type as the value.
For example, this sampler stores two linearly interpolated FLOAT3 positions:
const Float32 Times[] = {0.f, 1.f};
const RadientFloat3 Positions[] = {{0.f, 0.f, 0.f},
{2.f, 1.f, 0.f}};
const RadientAnimationSamplerDesc PositionSampler =
{
{RADIENT_ANIMATION_VALUE_TYPE_FLOAT3, 1},
RADIENT_ANIMATION_INTERPOLATION_LINEAR,
Times,
Positions,
sizeof(Positions),
2
};
With Type FLOAT3, ArraySize 2, and KeyframeCount 2, LINEAR pValues contains four consecutive FLOAT3 values: key0[0], key0[1], key1[0], key1[1]. CUBIC_SPLINE contains twelve: key0 incoming[2], value[2], outgoing[2], followed by the same three arrays for key1.
| RADIENT_ANIMATION_INTERPOLATION Diligent::RadientAnimationSamplerDesc::Interpolation = RADIENT_ANIMATION_INTERPOLATION_LINEAR |
Interpolation applied between keyframes. Boolean and signed or unsigned integer values require STEP. A target property's schema determines semantic details; for example, a rotation property may interpret FLOAT4 LINEAR as a spherical interpolation rather than component-wise interpolation.
| Uint32 Diligent::RadientAnimationSamplerDesc::KeyframeCount = 0 |
Number of entries in pTimes and logical keys in pValues. Must be nonzero. CUBIC_SPLINE also permits a single key.
| const Float32* Diligent::RadientAnimationSamplerDesc::pTimes = nullptr |
Array of KeyframeCount times in seconds. The pointer must be non-null when KeyframeCount is nonzero. Times must be finite, strictly increasing, and in the inclusive range [0, RadientAnimationClipDesc::Duration]. The first and last times need not equal the clip boundaries. Creation copies this array before returning.
| const void* Diligent::RadientAnimationSamplerDesc::pValues = nullptr |
Tightly packed keyframe data. STEP and LINEAR store one Value array per key. CUBIC_SPLINE stores incoming-tangent, central-value, and outgoing-tangent arrays for every key. The pointer must be non-null for a nonempty sampler and is copied during clip creation.
| Uint64 Diligent::RadientAnimationSamplerDesc::ValueDataSize = 0 |
Exact size of pValues in bytes. This must equal the native byte size of Value.Type multiplied by Value.ArraySize, KeyframeCount, and three for CUBIC_SPLINE (one for STEP or LINEAR).