StdMeshAnimationUpdate Class Reference

#include <StdMeshUpdate.h>

Public Member Functions

 StdMeshAnimationUpdate (const StdMeshSkeletonLoader &skeleton_loader)
void Update (StdMeshInstance *instance) const

Detailed Description

Definition at line 69 of file StdMeshUpdate.h.

Constructor & Destructor Documentation

◆ StdMeshAnimationUpdate()

StdMeshAnimationUpdate::StdMeshAnimationUpdate ( const StdMeshSkeletonLoader skeleton_loader)

Definition at line 194 of file StdMeshUpdate.cpp.

References StdMeshSkeletonLoader::skeletons_begin(), and StdMeshSkeletonLoader::skeletons_end().

195 {
196  // Store all animation names of all skeletons by pointer, we need those when
197  // updating the animation state of mesh instances after the update.
198  for(StdMeshSkeletonLoader::skeleton_iterator iter = skeleton_loader.skeletons_begin(); iter != skeleton_loader.skeletons_end(); ++iter)
199  {
200  const StdMeshSkeleton& skeleton = *iter->second;
201  for (const auto & Animation : skeleton.Animations)
202  {
203  AnimationNames[&Animation.second] = Animation.first;
204  }
205  }
206 }
SkeletonMap::const_iterator skeleton_iterator
Definition: StdMeshLoader.h:83
skeleton_iterator skeletons_end() const
Definition: StdMeshLoader.h:86
skeleton_iterator skeletons_begin() const
Definition: StdMeshLoader.h:85
Here is the call graph for this function:

Member Function Documentation

◆ Update()

void StdMeshAnimationUpdate::Update ( StdMeshInstance instance) const

Definition at line 208 of file StdMeshUpdate.cpp.

References StdMeshInstance::AnimationStack, Clamp(), StdMeshInstanceAnimationNode::CustomNode, Fix0, ftofix(), StdMeshInstanceAnimationNode::GetAnimation(), StdMeshSkeleton::GetAnimationByName(), StdMeshInstanceAnimationNode::GetLeftChild(), StdMeshInstanceAnimationNode::GetPositionProvider(), StdMeshInstanceAnimationNode::GetRightChild(), StdMesh::GetSkeleton(), StdMeshInstanceAnimationNode::GetType(), StdMeshInstanceAnimationNode::LeafNode, StdMeshAnimation::Length, StdMeshInstanceAnimationNode::LinearInterpolationNode, StdMeshInstance::Mesh, StdMeshInstance::StopAnimation(), and StdMeshInstanceValueProvider::Value.

Referenced by C4DefGraphicsPtrBackup::AssignUpdate().

209 {
210  // Update the animation tree. Leaf nodes which refer to an animation that
211  // does not exist anymore are removed.
212  for (unsigned int i = instance->AnimationStack.size(); i > 0; --i)
213  if(!UpdateAnimationNode(instance, instance->AnimationStack[i-1]))
214  instance->StopAnimation(instance->AnimationStack[i-1]);
215 }
AnimationNodeList AnimationStack
Definition: StdMesh.h:652
void StopAnimation(AnimationNode *node)
Definition: StdMesh.cpp:1188
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: