Diligent Engine
Loading...
Searching...
No Matches
Diligent::RadientAnimationClipDesc Struct Reference

#include <RadientAnimation.h>

Public Attributes

const Char * Name = nullptr
Float32 Duration = 0.f
const RadientAnimationTargetDescpTargets = nullptr
Uint32 TargetCount = 0
const RadientAnimationSamplerDescpSamplers = nullptr
Uint32 SamplerCount = 0
const RadientAnimationChannelDescpChannels = nullptr
Uint32 ChannelCount = 0

Detailed Description

Immutable, unbound animation clip description.

Creation copies the name and all target, sampler, channel, time, and value data. TargetIndex and SamplerIndex values in channels index the corresponding tables below. Duration and all keyframe times are expressed in seconds. An empty clip is valid only when all three table counts are zero and all three table pointers are null. A nonempty clip contains at least one record in every table, and every target and sampler must be referenced by a channel. Target records must have unique (Schema, Object) identities. Channels for one target and property may address adjacent or disjoint ranges, but their ranges must not overlap and must use one native value type. Destination-schema compatibility is established when binding.

Binding evaluation holds the nearest endpoint value outside each sampler's key interval. Looping, ping-pong, playback-rate handling, and time wrapping belong to the caller or a future player.

Example (C++): Object 17 is an authored node identity, while both zero indices refer to tables in Clip.

const Float32 Times[] = {0.f, 1.f};
const RadientFloat3 Translations[] = {{0.f, 0.f, 0.f},
{0.f, 2.f, 0.f}};
RadientAnimationTargetDesc Target{};
Target.Schema = RadientNodeAnimationSchemaID;
Target.Object = 17;
Target.Name = "Root";
RadientAnimationSamplerDesc Sampler{};
Sampler.Value.ArraySize = 1; // One FLOAT3, not three array elements.
Sampler.pTimes = Times;
Sampler.pValues = Translations;
Sampler.ValueDataSize = sizeof(Translations);
Sampler.KeyframeCount = 2;
RadientAnimationChannelDesc Channel{};
Channel.TargetIndex = 0; // Target above.
Channel.Property = RadientNodeTranslationProperty;
Channel.FirstArrayElement = 0;
Channel.SamplerIndex = 0; // Sampler above.
RadientAnimationClipDesc Clip{};
Clip.Name = "Root rise";
Clip.Duration = 1.f;
Clip.pTargets = &Target;
Clip.TargetCount = 1;
Clip.pSamplers = &Sampler;
Clip.SamplerCount = 1;
Clip.pChannels = &Channel;
Clip.ChannelCount = 1;
IRadientAnimationClipAsset* pClip = nullptr;
const RADIENT_STATUS Status = pAssetManager->CreateAnimationClip(Clip, &pClip);
float Float32
32-bit float
Definition BasicTypes.h:44
RADIENT_STATUS
Generic status returned by Radient operations.
Definition RadientTypes.h:57
@ RADIENT_ANIMATION_VALUE_TYPE_FLOAT3
Three 32-bit floating-point values in x, y, z order.
Definition RadientAnimation.h:335
@ RADIENT_ANIMATION_INTERPOLATION_LINEAR
Definition RadientAnimation.h:282
Uint32 TargetIndex
Definition RadientAnimation.h:516
const Char * Name
Definition RadientAnimation.h:616
RadientAnimationSchemaID Schema
Definition RadientAnimation.h:488
Three-component floating-point vector.
Definition RadientMath.h:64

All strings and arrays in this example may use stack storage because CreateAnimationClip copies them before returning. The caller owns the strong reference returned through pClip and releases it in the usual way. C callers initialize descriptors with {0}, explicitly assign every required member (C initialization does not apply C++ DEFAULT_INITIALIZER values), and invoke:

IRadientAssetManager_CreateAnimationClip(pAssetManager, &Clip, &pClip);

Member Data Documentation

◆ ChannelCount

Uint32 Diligent::RadientAnimationClipDesc::ChannelCount = 0

Number of elements in pChannels. A nonempty clip must contain at least one channel.

◆ Duration

Float32 Diligent::RadientAnimationClipDesc::Duration = 0.f

Finite, non-negative duration in seconds. Every sampler time must be in the inclusive range [0, Duration], but Duration need not equal the final key time. When Duration is zero, every sampler must contain exactly one key at time zero.

◆ Name

const Char* Diligent::RadientAnimationClipDesc::Name = nullptr

Optional diagnostic clip name. Creation copies the string. The asset's stored description contains an owned, non-null string, using "" when this input pointer is null.

◆ pChannels

const RadientAnimationChannelDesc* Diligent::RadientAnimationClipDesc::pChannels = nullptr

Array of ChannelCount target-property connections. Must be null exactly when ChannelCount is zero. Creation copies the array.

◆ pSamplers

const RadientAnimationSamplerDesc* Diligent::RadientAnimationClipDesc::pSamplers = nullptr

Array of SamplerCount typed keyframe samplers. Must be null exactly when SamplerCount is zero. Creation copies the descriptors and their time and value arrays.

◆ pTargets

const RadientAnimationTargetDesc* Diligent::RadientAnimationClipDesc::pTargets = nullptr

Array of TargetCount symbolic targets. Must be null exactly when TargetCount is zero. Creation copies the array and all target names.

◆ SamplerCount

Uint32 Diligent::RadientAnimationClipDesc::SamplerCount = 0

Number of elements in pSamplers. Every sampler in a nonempty clip must be referenced by at least one channel.

◆ TargetCount

Uint32 Diligent::RadientAnimationClipDesc::TargetCount = 0

Number of elements in pTargets. Every target in a nonempty clip must be referenced by at least one channel.