xoreos  0.0.5
Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | List of all members
Graphics::Aurora::Animation Class Reference

#include <animation.h>

Collaboration diagram for Graphics::Aurora::Animation:
Collaboration graph
[legend]

Public Member Functions

 Animation ()
 
 ~Animation ()
 
const Common::UStringgetName () const
 Get the animation's name. More...
 
void setName (Common::UString &name)
 
float getLength () const
 Get the animations length. More...
 
void setLength (float length)
 
void setTransTime (float transtime)
 
void update (Model *model, float lastFrame, float nextFrame, const std::vector< ModelNode *> &modelNodeMap)
 Update the model position and orientation. More...
 
void addAnimNode (AnimNode *node)
 
bool hasNode (const Common::UString &node) const
 Does the specified node exist? More...
 
ModelNodegetNode (const Common::UString &node)
 Get the specified node. More...
 
const ModelNodegetNode (const Common::UString &node) const
 Get the specified node. More...
 
const std::list< AnimNode * > & getNodes () const
 Get all animation nodes. More...
 

Protected Types

typedef std::list< AnimNode * > NodeList
 
typedef std::map< Common::UString, AnimNode *, Common::UString::ilessNodeMap
 

Protected Attributes

NodeList nodeList
 The nodes within the state. More...
 
NodeMap nodeMap
 The nodes within the state, indexed by name. More...
 
NodeList rootNodes
 The nodes in the state without a parent. More...
 
Common::UString _name
 The model's name. More...
 
float _length
 
float _transtime
 

Private Member Functions

void interpolatePosition (ModelNode *animNode, ModelNode *target, float time, float scale, bool relative) const
 
void interpolateOrientation (ModelNode *animNode, ModelNode *target, float time) const
 
void updateSkinnedModel (Model *model)
 Transform vertices for each node of the specified model based on current animation. More...
 

Detailed Description

Definition at line 50 of file animation.h.

Member Typedef Documentation

◆ NodeList

typedef std::list<AnimNode *> Graphics::Aurora::Animation::NodeList
protected

Definition at line 83 of file animation.h.

◆ NodeMap

Definition at line 84 of file animation.h.

Constructor & Destructor Documentation

◆ Animation()

Graphics::Aurora::Animation::Animation ( )

Definition at line 45 of file animation.cpp.

◆ ~Animation()

Graphics::Aurora::Animation::~Animation ( )

Definition at line 49 of file animation.cpp.

References nodeList.

Member Function Documentation

◆ addAnimNode()

void Graphics::Aurora::Animation::addAnimNode ( AnimNode node)

Definition at line 100 of file animation.cpp.

References Graphics::Aurora::AnimNode::getName(), nodeList, and nodeMap.

Referenced by Graphics::Aurora::Model_KotOR::readAnim(), and Graphics::Aurora::Model_NWN::readAnimBinary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLength()

float Graphics::Aurora::Animation::getLength ( ) const

Get the animations length.

Definition at line 66 of file animation.cpp.

References _length.

Referenced by Graphics::Aurora::AnimationChannel::playAnimation(), Graphics::Aurora::AnimationChannel::playAnimationCount(), and Graphics::Aurora::AnimationChannel::playDefaultAnimationInternal().

Here is the caller graph for this function:

◆ getName()

const Common::UString & Graphics::Aurora::Animation::getName ( ) const

Get the animation's name.

Definition at line 54 of file animation.cpp.

References _name.

◆ getNode() [1/2]

ModelNode * Graphics::Aurora::Animation::getNode ( const Common::UString node)

Get the specified node.

Definition at line 109 of file animation.cpp.

References nodeMap.

◆ getNode() [2/2]

const ModelNode * Graphics::Aurora::Animation::getNode ( const Common::UString node) const

Get the specified node.

Definition at line 117 of file animation.cpp.

References nodeMap.

◆ getNodes()

const std::list< AnimNode * > & Graphics::Aurora::Animation::getNodes ( ) const

Get all animation nodes.

Definition at line 125 of file animation.cpp.

References nodeList.

Referenced by Graphics::Aurora::AnimationChannel::makeModelNodeMap().

Here is the caller graph for this function:

◆ hasNode()

bool Graphics::Aurora::Animation::hasNode ( const Common::UString node) const

Does the specified node exist?

Definition at line 105 of file animation.cpp.

References nodeMap.

◆ interpolateOrientation()

void Graphics::Aurora::Animation::interpolateOrientation ( ModelNode animNode,
ModelNode target,
float  time 
) const
private

◆ interpolatePosition()

void Graphics::Aurora::Animation::interpolatePosition ( ModelNode animNode,
ModelNode target,
float  time,
float  scale,
bool  relative 
) const
private

◆ setLength()

void Graphics::Aurora::Animation::setLength ( float  length)

Definition at line 62 of file animation.cpp.

References _length.

Referenced by Graphics::Aurora::Model_KotOR::readAnim(), and Graphics::Aurora::Model_NWN::readAnimBinary().

Here is the caller graph for this function:

◆ setName()

void Graphics::Aurora::Animation::setName ( Common::UString name)

Definition at line 58 of file animation.cpp.

References _name.

Referenced by Graphics::Aurora::Model_KotOR::readAnim(), and Graphics::Aurora::Model_NWN::readAnimBinary().

Here is the caller graph for this function:

◆ setTransTime()

void Graphics::Aurora::Animation::setTransTime ( float  transtime)

Definition at line 70 of file animation.cpp.

References _transtime.

Referenced by Graphics::Aurora::Model_KotOR::readAnim(), and Graphics::Aurora::Model_NWN::readAnimBinary().

Here is the caller graph for this function:

◆ update()

void Graphics::Aurora::Animation::update ( Model model,
float  lastFrame,
float  nextFrame,
const std::vector< ModelNode *> &  modelNodeMap 
)

◆ updateSkinnedModel()

void Graphics::Aurora::Animation::updateSkinnedModel ( Model model)
private

Member Data Documentation

◆ _length

float Graphics::Aurora::Animation::_length
protected

Definition at line 92 of file animation.h.

Referenced by getLength(), and setLength().

◆ _name

Common::UString Graphics::Aurora::Animation::_name
protected

The model's name.

Definition at line 91 of file animation.h.

Referenced by getName(), setName(), and update().

◆ _transtime

float Graphics::Aurora::Animation::_transtime
protected

Definition at line 93 of file animation.h.

Referenced by setTransTime().

◆ nodeList

NodeList Graphics::Aurora::Animation::nodeList
protected

The nodes within the state.

Definition at line 86 of file animation.h.

Referenced by addAnimNode(), getNodes(), update(), and ~Animation().

◆ nodeMap

NodeMap Graphics::Aurora::Animation::nodeMap
protected

The nodes within the state, indexed by name.

Definition at line 87 of file animation.h.

Referenced by addAnimNode(), getNode(), and hasNode().

◆ rootNodes

NodeList Graphics::Aurora::Animation::rootNodes
protected

The nodes in the state without a parent.

Definition at line 89 of file animation.h.


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