OpenClonk
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.

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 }
skeleton_iterator skeletons_end() const
Definition: StdMeshLoader.h:86
skeleton_iterator skeletons_begin() const
Definition: StdMeshLoader.h:85
SkeletonMap::const_iterator skeleton_iterator
Definition: StdMeshLoader.h:83

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

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.

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:1190

References StdMeshInstance::AnimationStack, and StdMeshInstance::StopAnimation().

Here is the call graph for this function:

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