xoreos
0.0.5
|
#include <animation.h>
Public Member Functions | |
Animation () | |
~Animation () | |
const Common::UString & | getName () 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... | |
ModelNode * | getNode (const Common::UString &node) |
Get the specified node. More... | |
const ModelNode * | getNode (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::iless > | NodeMap |
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... | |
Definition at line 50 of file animation.h.
|
protected |
Definition at line 83 of file animation.h.
|
protected |
Definition at line 84 of file animation.h.
Graphics::Aurora::Animation::Animation | ( | ) |
Definition at line 45 of file animation.cpp.
Graphics::Aurora::Animation::~Animation | ( | ) |
Definition at line 49 of file animation.cpp.
References nodeList.
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().
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().
const Common::UString & Graphics::Aurora::Animation::getName | ( | ) | const |
ModelNode * Graphics::Aurora::Animation::getNode | ( | const Common::UString & | node | ) |
const ModelNode * Graphics::Aurora::Animation::getNode | ( | const Common::UString & | node | ) | const |
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().
bool Graphics::Aurora::Animation::hasNode | ( | const Common::UString & | node | ) | const |
|
private |
Definition at line 198 of file animation.cpp.
References Graphics::Aurora::ModelNode::_orientationFrames, Graphics::Aurora::dotQuaternion(), M_PI, Graphics::Aurora::normQuaternion(), Graphics::Aurora::QuaternionKeyFrame::q, Common::rad2deg(), Graphics::Aurora::ModelNode::setBufferedOrientation(), Graphics::Aurora::QuaternionKeyFrame::time, Graphics::Aurora::QuaternionKeyFrame::x, Graphics::Aurora::QuaternionKeyFrame::y, and Graphics::Aurora::QuaternionKeyFrame::z.
Referenced by update().
|
private |
Definition at line 148 of file animation.cpp.
References Graphics::Aurora::ModelNode::_positionFrames, Graphics::Aurora::ModelNode::setBufferedPosition(), Graphics::Aurora::PositionKeyFrame::time, Graphics::Aurora::PositionKeyFrame::x, Graphics::Aurora::PositionKeyFrame::y, and Graphics::Aurora::PositionKeyFrame::z.
Referenced by update().
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().
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().
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().
void Graphics::Aurora::Animation::update | ( | Model * | model, |
float | lastFrame, | ||
float | nextFrame, | ||
const std::vector< ModelNode *> & | modelNodeMap | ||
) |
Update the model position and orientation.
Definition at line 74 of file animation.cpp.
References _name, Graphics::Aurora::ModelNode::_nodeNumber, Graphics::Aurora::ModelNode::_orientationFrames, Graphics::Aurora::ModelNode::_positionFrames, Graphics::Aurora::Model::_positionRelative, Graphics::Aurora::Model::_skinned, Graphics::Aurora::Model::getAnimationScale(), interpolateOrientation(), interpolatePosition(), nodeList, and updateSkinnedModel().
Referenced by Graphics::Aurora::AnimationChannel::manageAnimations().
|
private |
Transform vertices for each node of the specified model based on current animation.
Definition at line 251 of file animation.cpp.
References Graphics::Aurora::Model::_attachedModels, Graphics::Aurora::ModelNode::_invBindPose, Graphics::Aurora::ModelNode::_mesh, Graphics::Aurora::ModelNode::_name, Graphics::Aurora::ModelNode::_parent, Graphics::Aurora::Model::_skinned, Graphics::Aurora::ModelNode::_vertexCoordsBuffer, Graphics::Aurora::ModelNode::_vertexCoordsBuffered, Graphics::Aurora::ModelNode::Skin::boneMapping, Graphics::Aurora::ModelNode::Skin::boneMappingCount, Graphics::Aurora::ModelNode::Skin::boneMappingId, Graphics::Aurora::ModelNode::Skin::boneNodeMap, Graphics::Aurora::ModelNode::Skin::boneWeights, Graphics::Aurora::ModelNode::Mesh::data, Graphics::VertexBuffer::getCount(), Graphics::Aurora::Model::getNodes(), Graphics::Mesh::Mesh::getVertexBuffer(), Graphics::Aurora::ModelNode::MeshData::initialVertexCoords, inverse(), Graphics::Aurora::multiply(), Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Aurora::ModelNode::Mesh::skin, and Common::UString::stricmp().
Referenced by update().
|
protected |
Definition at line 92 of file animation.h.
Referenced by getLength(), and setLength().
|
protected |
The model's name.
Definition at line 91 of file animation.h.
|
protected |
Definition at line 93 of file animation.h.
Referenced by setTransTime().
|
protected |
The nodes within the state.
Definition at line 86 of file animation.h.
Referenced by addAnimNode(), getNodes(), update(), and ~Animation().
|
protected |
The nodes within the state, indexed by name.
Definition at line 87 of file animation.h.
Referenced by addAnimNode(), getNode(), and hasNode().
|
protected |
The nodes in the state without a parent.
Definition at line 89 of file animation.h.