OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 ( 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_begin() const
Definition: StdMeshLoader.h:85
skeleton_iterator skeletons_end() const
Definition: StdMeshLoader.h:86

Here is the call graph for this function:

Member Function Documentation

void StdMeshAnimationUpdate::Update ( StdMeshInstance instance) const

Definition at line 208 of file StdMeshUpdate.cpp.

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

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:


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