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 193 of file StdMeshUpdate.cpp.

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

194 {
195  // Store all animation names of all skeletons by pointer, we need those when
196  // updating the animation state of mesh instances after the update.
197  for(StdMeshSkeletonLoader::skeleton_iterator iter = skeleton_loader.skeletons_begin(); iter != skeleton_loader.skeletons_end(); ++iter)
198  {
199  const StdMeshSkeleton& skeleton = *iter->second;
200  for (std::map<StdCopyStrBuf, StdMeshAnimation>::const_iterator iter = skeleton.Animations.begin(); iter != skeleton.Animations.end(); ++iter)
201  {
202  AnimationNames[&iter->second] = iter->first;
203  }
204  }
205 }
SkeletonMap::const_iterator skeleton_iterator
Definition: StdMeshLoader.h:84
skeleton_iterator skeletons_begin() const
Definition: StdMeshLoader.h:86
skeleton_iterator skeletons_end() const
Definition: StdMeshLoader.h:87

Here is the call graph for this function:

Member Function Documentation

void StdMeshAnimationUpdate::Update ( StdMeshInstance instance) const

Definition at line 207 of file StdMeshUpdate.cpp.

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

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

Here is the call graph for this function:

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