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

#include <RadientAnimation.h>

Public Attributes

const RadientAnimationDestinationDescpDestinations = nullptr
Uint32 DestinationCount = 0
 Number of elements in pDestinations.

Detailed Description

Description used to compile an animation binding.

Creation copies both descriptor-array levels and asks every destination to resolve every channel contributed by its mapped targets. A destination may bind only the subset of schema properties that it exposes. Unsupported properties are omitted while compiling the binding and incur no evaluation cost. Each nonempty child binding retains its destination; the outer binding retains the children. Unmapped clip targets are ignored. A zero-destination or completely unbound binding is valid and evaluates to RADIENT_STATUS_NO_CHANGE.

Each pDestination must occur in exactly one destination descriptor. Exact duplicate mappings and overlapping accepted writes to the same resolved property range are invalid. Unsupported requests do not participate in overlap checks. A clip target may appear in multiple mappings to support fanout. Different targets may map to one element when their accepted property ranges do not overlap. Aliasing through two different destination interface pointers cannot be detected and is the caller's responsibility; evaluation applies destination descriptors in order.

Evaluation is a sparse overwrite: destination state outside the clip's channel ranges is preserved. Blending, additive animation, base-pose restoration, and root-motion extraction are outside the binding contract and are handled by the caller or a future player/mixer.

Example (C++): a 1,000-joint skeleton uses one destination descriptor, one retained pose destination, and a compact mapping array. Evaluation brackets the complete pose with one BeginUpdate()/EndUpdate() pair, not one virtual call per joint or transform component. ClipTargetForJoint is importer-produced data that maps the clip's authored node identities to skeleton joint indices.

std::vector<RadientAnimationDestinationMappingDesc> JointMappings(JointCount);
for (Uint32 Joint = 0; Joint < JointCount; ++Joint)
{
JointMappings[Joint].ClipTargetIndex = ClipTargetForJoint[Joint];
JointMappings[Joint].DestinationElement = Joint;
}
IRadientAnimationDestination* pPoseDestination = nullptr;
pPose->QueryInterface(IID_RadientAnimationDestination, &pPoseDestination);
PoseDestination.pDestination = pPoseDestination;
PoseDestination.pMappings = JointMappings.data();
PoseDestination.MappingCount = static_cast<Uint32>(JointMappings.size());
RadientAnimationBindingDesc BindingDesc{};
BindingDesc.pDestinations = &PoseDestination;
BindingDesc.DestinationCount = 1;
IRadientAnimationBinding* pBinding = nullptr;
const RADIENT_STATUS Status = pClip->CreateBinding(BindingDesc, &pBinding);
pPoseDestination->Release(); // The binding retained it on success.
virtual void DILIGENT_CALL_TYPE QueryInterface(const INTERFACE_ID &IID, IObject **ppInterface)=0
Queries the specific interface.
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release()=0
RADIENT_STATUS
Generic status returned by Radient operations.
Definition RadientTypes.h:57
uint32_t Uint32
32-bit unsigned integer
Definition BasicTypes.h:53
Definition RadientAnimation.h:901
const RadientAnimationDestinationDesc * pDestinations
Definition RadientAnimation.h:829
One aggregate runtime destination and all clip targets mapped into it.
Definition RadientAnimation.h:725
IRadientAnimationDestination * pDestination
Definition RadientAnimation.h:731
const RadientAnimationDestinationMappingDesc * pMappings
Definition RadientAnimation.h:735
Uint32 MappingCount
Definition RadientAnimation.h:739

For a scene-node transform, the corresponding core fields are:

IRadientAnimationDestination* pSceneDestination = nullptr;
pSceneWriter->QueryInterface(IID_RadientAnimationDestination,
&pSceneDestination);
RootMapping.ClipTargetIndex = RootTargetIndex;
RootMapping.DestinationElement = RootEntity;
SceneDestination.pDestination = pSceneDestination;
SceneDestination.pMappings = &RootMapping;
SceneDestination.MappingCount = 1;
Definition RadientAnimation.h:708
Uint32 ClipTargetIndex
Definition RadientAnimation.h:711
RadientAnimationDestinationElement DestinationElement
Definition RadientAnimation.h:718

SceneDestination replaces PoseDestination in the complete binding example above. Release pSceneDestination after CreateBinding() returns, just like pPoseDestination.

Root animation is the same mapping with the root joint or root entity; root-motion extraction and redirection remain caller or future player/mixer policies.

Member Data Documentation

◆ pDestinations

const RadientAnimationDestinationDesc* Diligent::RadientAnimationBindingDesc::pDestinations = nullptr

Array of DestinationCount aggregate destinations. It must be null exactly when DestinationCount is zero. CreateBinding() copies the array.