xoreos
0.0.5
|
#include <model.h>
Classes | |
struct | State |
A model state. More... | |
Public Member Functions | |
Model (ModelType type=kModelTypeObject) | |
~Model () | |
void | show () |
Show the object. More... | |
void | hide () |
Hide the object. More... | |
ModelType | getType () const |
Return the model's type. More... | |
const Common::UString & | getName () const |
Get the model's name. More... | |
float | getWidth () const |
Get the width of the model's bounding box. More... | |
float | getHeight () const |
Get the height of the model's bounding box. More... | |
float | getDepth () const |
Get the depth of the model's bounding box. More... | |
void | drawBound (bool enabled) |
Should a bounding box be drawn around this model? More... | |
void | drawSkeleton (bool enabled, bool showInvisible) |
Should a skeleton showing the nodes and their relation be drawn inside the model? More... | |
void | setEnvironmentMap (const Common::UString &environmentMap="") |
Change the environment map on this model. More... | |
void | setSkinned (bool skinned) |
Set the flag if the model has skinned animations. More... | |
bool | isIn (float x, float y) const |
Is that point within the model's bounding box? More... | |
bool | isIn (float x, float y, float z) const |
Is that point within the model's bounding box? More... | |
bool | isIn (float x1, float y1, float z1, float x2, float y2, float z2) const |
Does the line from x1.y1.z1 to x2.y2.z2 intersect with model's bounding box? More... | |
void | getScale (float &x, float &y, float &z) const |
Get the current scale of the model. More... | |
void | getOrientation (float &x, float &y, float &z, float &angle) const |
Get the current orientation of the model. More... | |
void | getPosition (float &x, float &y, float &z) const |
Get the current position of the model. More... | |
void | getAbsolutePosition (float &x, float &y, float &z) const |
Get the position of the node after translate/rotate. More... | |
void | setScale (float x, float y, float z) |
Set the current scale of the model. More... | |
void | setOrientation (float x, float y, float z, float angle) |
Set the current orientation of the model. More... | |
void | setPosition (float x, float y, float z) |
Set the current position of the model. More... | |
void | scale (float x, float y, float z) |
Scale the model, relative to its current scale. More... | |
void | rotate (float x, float y, float z, float angle) |
Rotate the model, relative to its current orientation. More... | |
void | move (float x, float y, float z) |
Move the model, relative to its current position. More... | |
void | getTooltipAnchor (float &x, float &y, float &z) const |
Get the point where the feedback tooltip is anchored. More... | |
const std::list< Common::UString > & | getStates () const |
Return a list of all animation state names. More... | |
void | setState (const Common::UString &name="") |
Set the current animation state. More... | |
const Common::UString & | getState () const |
Return the name of the current state. More... | |
bool | hasNode (const Common::UString &node) const |
Does the specified node exist in the current state? More... | |
ModelNode * | getNode (const Common::UString &node) |
Get the specified node, from the current state. More... | |
const ModelNode * | getNode (const Common::UString &node) const |
Get the specified node, from the current state. More... | |
ModelNode * | getNode (const Common::UString &stateName, const Common::UString &node) |
Get the specified node, from the named state, if it exists. More... | |
const ModelNode * | getNode (const Common::UString &stateName, const Common::UString &node) const |
Get the specified node, from the named state, if it exists. More... | |
ModelNode * | getNode (uint16 nodeNumber) |
Get node by node number. More... | |
const ModelNode * | getNode (uint16 nodeNumber) const |
Get node by node number. More... | |
const std::list< ModelNode * > & | getNodes () |
Get all nodes in the current state. More... | |
void | attachModel (const Common::UString &nodeName, Model *model) |
Add another model as a child to the named node. More... | |
bool | hasAnimation (const Common::UString &anim) const |
Does this model have this named animation? More... | |
float | getAnimationScale (const Common::UString &anim) |
Determine what animation scaling applies. More... | |
void | addAnimationChannel (AnimationChannelName name) |
AnimationChannel * | getAnimationChannel (AnimationChannelName name) |
void | clearDefaultAnimations () |
void | addDefaultAnimation (const Common::UString &anim, uint8 probability) |
void | playDefaultAnimation () |
void | playAnimation (const Common::UString &anim, bool restart=true, float length=0.0f, float speed=1.0f) |
void | calculateDistance () |
Calculate the object's distance. More... | |
void | render (RenderPass pass) |
Render the object. More... | |
void | renderImmediate (const glm::mat4 &parentTransform) |
For shader based systems, don't sort anything, render this right_now. More... | |
void | queueRender (const glm::mat4 &parentTransform) |
Queue the object for later rendering. More... | |
void | advanceTime (float dt) |
Advance time (used by renderables with animations). More... | |
void | flushNodeBuffers () |
Apply buffered changes to model nodes position and geometry. More... | |
Model * | getAttachedModel (const Common::UString &node) |
Public Member Functions inherited from Graphics::GLContainer | |
GLContainer () | |
~GLContainer () | |
void | rebuild () |
void | destroy () |
Public Member Functions inherited from Graphics::Queueable | |
Queueable () | |
virtual | ~Queueable () |
Public Member Functions inherited from Graphics::Renderable | |
Renderable (RenderableType type) | |
~Renderable () | |
bool | operator< (const Queueable &q) const |
double | getDistance () const |
Get the distance of the object from the viewer. More... | |
uint32 | getID () const |
Get the object's unique ID. More... | |
bool | isClickable () const |
Is the object clickable? More... | |
void | setClickable (bool clickable) |
Set the object's clickable state. More... | |
const Common::UString & | getTag () const |
Get the object's tag. More... | |
void | setTag (const Common::UString &tag) |
Set the object's tag. More... | |
bool | isVisible () const |
Is the object visible? More... | |
Static Public Member Functions | |
static void | readValue (Common::SeekableReadStream &stream, uint32 &value) |
static void | readValue (Common::SeekableReadStream &stream, float &value) |
static void | readArrayDef (Common::SeekableReadStream &stream, uint32 &offset, uint32 &count) |
template<typename T > | |
static void | readArray (Common::SeekableReadStream &stream, uint32 offset, uint32 count, std::vector< T > &values) |
Protected Types | |
typedef std::list< ModelNode * > | NodeList |
typedef std::map< Common::UString, ModelNode *, Common::UString::iless > | NodeMap |
typedef std::map< Common::UString, Animation *, Common::UString::iless > | AnimationMap |
typedef std::map< AnimationChannelName, AnimationChannel * > | AnimationChannelMap |
typedef std::list< State * > | StateList |
typedef std::map< Common::UString, State * > | StateMap |
Protected Member Functions | |
void | queueDrawBound () |
void | doDrawBound () |
void | doDrawSkeleton () |
Animation * | getAnimation (const Common::UString &anim) |
Get the animation from its name. More... | |
void | finalize () |
Finalize the loading procedure. More... | |
void | doRebuild () |
void | doDestroy () |
Protected Member Functions inherited from Graphics::Queueable | |
bool | isInQueue (QueueType queue) const |
void | addToQueue (QueueType queue) |
void | removeFromQueue (QueueType queue) |
void | lockQueue (QueueType queue) |
void | unlockQueue (QueueType queue) |
void | sortQueue (QueueType queue) |
Protected Member Functions inherited from Graphics::Renderable | |
void | resort () |
void | lockFrame () |
void | unlockFrame () |
void | lockFrameIfVisible () |
void | unlockFrameIfVisible () |
Private Member Functions | |
void | createStateNamesList (std::list< Common::UString > *stateNames=0) |
Create the list of all state names. More... | |
void | createBound () |
Create the model's bounding box. More... | |
void | createAbsolutePosition () |
void | manageAnimations (float dt) |
Private Attributes | |
bool | _drawBound |
bool | _drawSkeleton |
bool | _drawSkeletonInvisible |
std::map< Common::UString, Model * > | _attachedModels |
Friends | |
class | ModelNode |
class | Animation |
class | AnimationThread |
class | AnimationChannel |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Graphics::Aurora::Model::Model | ( | ModelType | type = kModelTypeObject | ) |
Definition at line 61 of file model.cpp.
References _animationScale, _boundRenderable, _center, _orientation, _position, _scale, addAnimationChannel(), Graphics::Aurora::kAnimationChannelAll, MaterialMan, MeshMan, Graphics::Shader::ShaderRenderable::setMaterial(), Graphics::Shader::ShaderRenderable::setMesh(), Graphics::Shader::ShaderRenderable::setSurface(), and SurfaceMan.
Graphics::Aurora::Model::~Model | ( | ) |
Definition at line 92 of file model.cpp.
References _animationChannels, _animationMap, _stateList, and hide().
void Graphics::Aurora::Model::addAnimationChannel | ( | AnimationChannelName | name | ) |
Definition at line 527 of file model.cpp.
References _animationChannels, and AnimationChannel.
Referenced by Model().
void Graphics::Aurora::Model::addDefaultAnimation | ( | const Common::UString & | anim, |
uint8 | probability | ||
) |
Definition at line 550 of file model.cpp.
References _animationChannels, and Graphics::Aurora::AnimationChannel::addDefaultAnimation().
Referenced by Graphics::Aurora::Model_NWN::populateDefaultAnimations().
|
virtual |
Advance time (used by renderables with animations).
Reimplemented from Graphics::Renderable.
Definition at line 589 of file model.cpp.
References flushNodeBuffers(), and manageAnimations().
void Graphics::Aurora::Model::attachModel | ( | const Common::UString & | nodeName, |
Model * | model | ||
) |
Add another model as a child to the named node.
Definition at line 479 of file model.cpp.
References Graphics::Aurora::ModelNode::_attachedModel, _attachedModels, createBound(), and getNode().
|
virtual |
Calculate the object's distance.
Implements Graphics::Renderable.
Definition at line 565 of file model.cpp.
References _absolutePosition, _center, Graphics::Renderable::_distance, _position, _type, ABS(), CameraMan, and Graphics::Aurora::kModelTypeGUIFront.
Referenced by setOrientation(), setPosition(), and setScale().
void Graphics::Aurora::Model::clearDefaultAnimations | ( | ) |
Definition at line 545 of file model.cpp.
References _animationChannels, and Graphics::Aurora::AnimationChannel::clearDefaultAnimations().
|
private |
Definition at line 303 of file model.cpp.
References _absoluteBoundBox, _absolutePosition, _boundBox, _orientation, _position, _scale, Common::BoundingBox::absolutize(), Common::deg2rad(), and Common::BoundingBox::transform().
Referenced by finalize(), setOrientation(), setPosition(), and setScale().
|
private |
Create the model's bounding box.
Definition at line 848 of file model.cpp.
References _absoluteBoundBox, _absolutePosition, _boundBox, _center, _currentState, Common::BoundingBox::absolutize(), Common::BoundingBox::add(), Common::BoundingBox::clear(), Common::BoundingBox::getMax(), Common::BoundingBox::getMin(), Graphics::Aurora::Model::State::rootNodes, and Common::BoundingBox::transform().
Referenced by attachModel(), Graphics::Aurora::ModelNode::createAbsoluteBound(), finalize(), Graphics::Aurora::AnimationChannel::manageAnimations(), and setState().
|
private |
Create the list of all state names.
Definition at line 826 of file model.cpp.
References _stateList, _stateNames, _superModel, and createStateNamesList().
Referenced by createStateNamesList(), and finalize().
|
protectedvirtual |
Implements Graphics::GLContainer.
|
protected |
Definition at line 716 of file model.cpp.
References _absolutePosition, _boundBox, _boundRenderable, _drawBound, Common::BoundingBox::getMin(), and Graphics::Shader::ShaderRenderable::renderImmediate().
Referenced by Graphics::Aurora::Model_Sonic::render(), and render().
|
protected |
Definition at line 779 of file model.cpp.
References _currentState, _drawSkeleton, _drawSkeletonInvisible, _type, Graphics::Aurora::kModelTypeObject, and Graphics::Aurora::Model::State::rootNodes.
Referenced by Graphics::Aurora::Model_Sonic::render(), and render().
|
protectedvirtual |
Implements Graphics::GLContainer.
void Graphics::Aurora::Model::drawBound | ( | bool | enabled | ) |
Should a bounding box be drawn around this model?
Definition at line 174 of file model.cpp.
References _drawBound.
void Graphics::Aurora::Model::drawSkeleton | ( | bool | enabled, |
bool | showInvisible | ||
) |
Should a skeleton showing the nodes and their relation be drawn inside the model?
Definition at line 178 of file model.cpp.
References _drawSkeleton, and _drawSkeletonInvisible.
|
protected |
Finalize the loading procedure.
Definition at line 807 of file model.cpp.
References _animationChannels, _currentState, _stateList, createAbsolutePosition(), createBound(), createStateNamesList(), and setState().
Referenced by Graphics::Aurora::Model_DragonAge::Model_DragonAge(), Graphics::Aurora::Model_Jade::Model_Jade(), Graphics::Aurora::Model_KotOR::Model_KotOR(), Graphics::Aurora::Model_NWN::Model_NWN(), Graphics::Aurora::Model_NWN2::Model_NWN2(), Graphics::Aurora::Model_Sonic::Model_Sonic(), and Graphics::Aurora::Model_Witcher::Model_Witcher().
void Graphics::Aurora::Model::flushNodeBuffers | ( | ) |
Apply buffered changes to model nodes position and geometry.
Definition at line 594 of file model.cpp.
References _attachedModels, _currentState, and Graphics::Aurora::Model::State::nodeList.
Referenced by advanceTime().
void Graphics::Aurora::Model::getAbsolutePosition | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
Get the position of the node after translate/rotate.
Definition at line 213 of file model.cpp.
References _absolutePosition.
|
protected |
Get the animation from its name.
Definition at line 496 of file model.cpp.
References _animationMap, _superModel, and getAnimation().
Referenced by Graphics::Aurora::AnimationChannel::addDefaultAnimation(), getAnimation(), Graphics::Aurora::AnimationChannel::playAnimation(), Graphics::Aurora::AnimationChannel::playAnimationCount(), and Graphics::Aurora::Model_NWN::populateDefaultAnimations().
AnimationChannel * Graphics::Aurora::Model::getAnimationChannel | ( | AnimationChannelName | name | ) |
Definition at line 537 of file model.cpp.
References _animationChannels.
Referenced by Engines::KotOR2::Creature::playDefaultHeadAnimation(), Engines::KotOR::Creature::playDefaultHeadAnimation(), Engines::KotOR2::Creature::playHeadAnimation(), and Engines::KotOR::Creature::playHeadAnimation().
float Graphics::Aurora::Model::getAnimationScale | ( | const Common::UString & | anim | ) |
Determine what animation scaling applies.
Definition at line 513 of file model.cpp.
References _animationMap, _animationScale, _superModel, and getAnimationScale().
Referenced by getAnimationScale(), and Graphics::Aurora::Animation::update().
Model * Graphics::Aurora::Model::getAttachedModel | ( | const Common::UString & | node | ) |
Definition at line 611 of file model.cpp.
References _attachedModels.
float Graphics::Aurora::Model::getDepth | ( | ) | const |
Get the depth of the model's bounding box.
Definition at line 170 of file model.cpp.
References _boundBox, _scale, and Common::BoundingBox::getDepth().
float Graphics::Aurora::Model::getHeight | ( | ) | const |
Get the height of the model's bounding box.
Definition at line 166 of file model.cpp.
References _boundBox, _scale, and Common::BoundingBox::getHeight().
Referenced by Engines::NWN::ModelWidget::getHeight().
const Common::UString & Graphics::Aurora::Model::getName | ( | ) | const |
Get the model's name.
Definition at line 125 of file model.cpp.
References _name.
Referenced by Graphics::Aurora::ModelNode_NWN_Binary::checkDuplicateNode(), and Graphics::Aurora::ModelNode_Jade::unfoldFaces().
ModelNode * Graphics::Aurora::Model::getNode | ( | const Common::UString & | node | ) |
Get the specified node, from the current state.
Definition at line 379 of file model.cpp.
References _currentState, _superModel, getNode(), and Graphics::Aurora::Model::State::nodeMap.
Referenced by attachModel(), Graphics::Aurora::ModelNode_Witcher::buildMaterial(), Graphics::Aurora::ModelNode::buildMaterial(), Graphics::Aurora::ModelNode::createAbsoluteBound(), Engines::NWN::WidgetListBox::createScrollbar(), Graphics::Aurora::ModelNode::getEnvironmentMap(), Graphics::Aurora::ModelNode::getMesh(), Engines::NWN::ModelWidget::getNode(), getNode(), Engines::NWN::WidgetListBox::getProperties(), Graphics::Aurora::ModelNode::getTextures(), Graphics::Aurora::ModelNode_NWN_Binary::load(), Graphics::Aurora::Model_KotOR::makeBoneNodeMap(), Graphics::Aurora::AnimationChannel::makeModelNodeMap(), Graphics::Aurora::ModelNode::render(), Engines::NWN::CompassWidget::setRotation(), Engines::NWN::WidgetEditBox::setTitle(), Engines::NWN::WidgetCheckBox::WidgetCheckBox(), and Engines::NWN::WidgetSlider::WidgetSlider().
const ModelNode * Graphics::Aurora::Model::getNode | ( | const Common::UString & | node | ) | const |
Get the specified node, from the current state.
Definition at line 394 of file model.cpp.
References _currentState, _superModel, getNode(), and Graphics::Aurora::Model::State::nodeMap.
ModelNode * Graphics::Aurora::Model::getNode | ( | const Common::UString & | stateName, |
const Common::UString & | node | ||
) |
Get the specified node, from the named state, if it exists.
Definition at line 409 of file model.cpp.
References _stateMap, _superModel, getNode(), and Graphics::Aurora::Model::State::nodeMap.
const ModelNode * Graphics::Aurora::Model::getNode | ( | const Common::UString & | stateName, |
const Common::UString & | node | ||
) | const |
Get the specified node, from the named state, if it exists.
Definition at line 427 of file model.cpp.
References _stateMap, _superModel, getNode(), and Graphics::Aurora::Model::State::nodeMap.
Get node by node number.
Definition at line 445 of file model.cpp.
References _currentState, Graphics::Aurora::ModelNode::getNodeNumber(), and Graphics::Aurora::Model::State::nodeList.
Get node by node number.
Definition at line 458 of file model.cpp.
References _currentState, Graphics::Aurora::ModelNode::getNodeNumber(), and Graphics::Aurora::Model::State::nodeList.
const std::list< ModelNode * > & Graphics::Aurora::Model::getNodes | ( | ) |
Get all nodes in the current state.
Definition at line 472 of file model.cpp.
References _currentState, Graphics::Aurora::kEmptyNodeList, and Graphics::Aurora::Model::State::nodeList.
Referenced by Graphics::Aurora::Model_KotOR::makeBoneNodeMap(), and Graphics::Aurora::Animation::updateSkinnedModel().
void Graphics::Aurora::Model::getOrientation | ( | float & | x, |
float & | y, | ||
float & | z, | ||
float & | angle | ||
) | const |
Get the current orientation of the model.
Definition at line 199 of file model.cpp.
References _orientation.
void Graphics::Aurora::Model::getPosition | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
Get the current position of the model.
Definition at line 207 of file model.cpp.
References _position.
Referenced by Graphics::Aurora::AnimationThread::getNumIterationsToSkip().
void Graphics::Aurora::Model::getScale | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
const Common::UString & Graphics::Aurora::Model::getState | ( | ) | const |
Return the name of the current state.
Definition at line 361 of file model.cpp.
References _currentState, Graphics::Aurora::kNoState, and Graphics::Aurora::Model::State::name.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), Graphics::Aurora::ModelNode::buildMaterial(), Graphics::Aurora::ModelNode::getMesh(), Engines::NWN::WidgetButton::isPressed(), and Graphics::Aurora::ModelNode::render().
const std::list< Common::UString > & Graphics::Aurora::Model::getStates | ( | ) | const |
Return a list of all animation state names.
Definition at line 320 of file model.cpp.
References _stateNames.
void Graphics::Aurora::Model::getTooltipAnchor | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
Get the point where the feedback tooltip is anchored.
Definition at line 293 of file model.cpp.
References _absoluteBoundBox, _absolutePosition, and Common::BoundingBox::getDepth().
Referenced by Engines::NWN::Tooltip::getParentPosition().
ModelType Graphics::Aurora::Model::getType | ( | ) | const |
Return the model's type.
Definition at line 121 of file model.cpp.
References _type.
Referenced by Graphics::Aurora::ModelNode::isInFrontOf().
float Graphics::Aurora::Model::getWidth | ( | ) | const |
Get the width of the model's bounding box.
Definition at line 162 of file model.cpp.
References _boundBox, _scale, and Common::BoundingBox::getWidth().
Referenced by Engines::NWN::ModelWidget::getWidth().
bool Graphics::Aurora::Model::hasAnimation | ( | const Common::UString & | anim | ) | const |
Does this model have this named animation?
Definition at line 509 of file model.cpp.
References _animationMap.
bool Graphics::Aurora::Model::hasNode | ( | const Common::UString & | node | ) | const |
Does the specified node exist in the current state?
Definition at line 368 of file model.cpp.
References _currentState, and Graphics::Aurora::Model::State::nodeMap.
Referenced by Engines::NWN::WidgetListBox::getProperties().
|
virtual |
Hide the object.
Reimplemented from Graphics::Renderable.
Definition at line 116 of file model.cpp.
References GfxMan, and Graphics::Renderable::hide().
Referenced by Engines::NWN::ModelWidget::hide(), setState(), Engines::NWN::FadeModel::updateFade(), and ~Model().
|
virtual |
Is that point within the model's bounding box?
Reimplemented from Graphics::Renderable.
Definition at line 129 of file model.cpp.
References _absoluteBoundBox, _boundBox, _position, _scale, _type, Common::BoundingBox::getHeight(), Common::BoundingBox::getWidth(), Common::BoundingBox::isIn(), and Graphics::Aurora::kModelTypeGUIFront.
Referenced by isIn().
|
virtual |
Is that point within the model's bounding box?
Reimplemented from Graphics::Renderable.
Definition at line 148 of file model.cpp.
References _absoluteBoundBox, _type, Common::BoundingBox::isIn(), isIn(), and Graphics::Aurora::kModelTypeGUIFront.
|
virtual |
Does the line from x1.y1.z1 to x2.y2.z2 intersect with model's bounding box?
Reimplemented from Graphics::Renderable.
Definition at line 155 of file model.cpp.
References _absoluteBoundBox, _type, Common::BoundingBox::isIn(), and Graphics::Aurora::kModelTypeGUIFront.
|
private |
Definition at line 620 of file model.cpp.
References _animationChannels, and _attachedModels.
Referenced by advanceTime().
void Graphics::Aurora::Model::move | ( | float | x, |
float | y, | ||
float | z | ||
) |
Move the model, relative to its current position.
Definition at line 289 of file model.cpp.
References _position, and setPosition().
void Graphics::Aurora::Model::playAnimation | ( | const Common::UString & | anim, |
bool | restart = true , |
||
float | length = 0.0f , |
||
float | speed = 1.0f |
||
) |
Definition at line 560 of file model.cpp.
References _animationChannels, and Graphics::Aurora::AnimationChannel::playAnimation().
Referenced by Engines::KotOR::ClassSelectionMenu::setupClassSubScene().
void Graphics::Aurora::Model::playDefaultAnimation | ( | ) |
Definition at line 555 of file model.cpp.
References _animationChannels, and Graphics::Aurora::AnimationChannel::playDefaultAnimation().
|
protected |
Definition at line 696 of file model.cpp.
References _absolutePosition, _boundBox, _boundRenderable, _boundTransform, _drawBound, Common::BoundingBox::getMin(), and RenderMan.
Referenced by queueRender(), and renderImmediate().
|
virtual |
Queue the object for later rendering.
Reimplemented from Graphics::Renderable.
Definition at line 681 of file model.cpp.
References _absolutePosition, _currentState, queueDrawBound(), and Graphics::Aurora::Model::State::rootNodes.
Referenced by Graphics::Aurora::ModelNode::queueRender().
|
static |
Definition at line 902 of file model.cpp.
References readValue(), and Common::SeekableReadStream::seek().
Referenced by Graphics::Aurora::Model_KotOR::load(), Graphics::Aurora::Model_Jade::load(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN_Binary::load(), and Graphics::Aurora::Model_NWN::loadBinary().
|
static |
Definition at line 886 of file model.cpp.
References Common::ReadStream::readUint32LE(), and warning().
Referenced by Graphics::Aurora::Model_KotOR::load(), Graphics::Aurora::Model_Jade::load(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN_Binary::load(), Graphics::Aurora::Model_NWN::loadBinary(), Graphics::Aurora::Model_KotOR::readAnim(), Graphics::Aurora::ModelNode_NWN_Binary::readAnim(), Graphics::Aurora::Model_NWN::readAnimBinary(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), and Graphics::Aurora::ModelNode_Witcher::readTexturePaint().
|
static |
Definition at line 878 of file model.cpp.
References Common::ReadStream::readUint32LE().
Referenced by readArray().
|
static |
Definition at line 882 of file model.cpp.
References Common::ReadStream::readIEEEFloatLE().
|
virtual |
Render the object.
Implements Graphics::Renderable.
Reimplemented in Graphics::Aurora::Model_Sonic.
Definition at line 632 of file model.cpp.
References _currentState, _orientation, _position, _scale, doDrawBound(), doDrawSkeleton(), Graphics::kRenderPassAll, Graphics::kRenderPassOpaque, Graphics::kRenderPassTransparent, pass, Graphics::Aurora::Model::State::rootNodes, and TextureMan.
Referenced by Engines::NWN::NewGameFog::render(), Engines::NWN::FadeModel::render(), and Graphics::Aurora::ModelNode::render().
|
virtual |
For shader based systems, don't sort anything, render this right_now.
Reimplemented from Graphics::Renderable.
Definition at line 666 of file model.cpp.
References _absolutePosition, _currentState, queueDrawBound(), and Graphics::Aurora::Model::State::rootNodes.
Referenced by Engines::NWN::NewGameFog::renderImmediate(), and Graphics::Aurora::ModelNode::renderImmediate().
void Graphics::Aurora::Model::rotate | ( | float | x, |
float | y, | ||
float | z, | ||
float | angle | ||
) |
Rotate the model, relative to its current orientation.
Definition at line 269 of file model.cpp.
References _orientation, Common::deg2rad(), Common::rad2deg(), and setOrientation().
void Graphics::Aurora::Model::scale | ( | float | x, |
float | y, | ||
float | z | ||
) |
Scale the model, relative to its current scale.
Definition at line 265 of file model.cpp.
References _scale, and setScale().
void Graphics::Aurora::Model::setEnvironmentMap | ( | const Common::UString & | environmentMap = "" | ) |
Change the environment map on this model.
Definition at line 183 of file model.cpp.
References _stateList, Graphics::Renderable::lockFrameIfVisible(), and Graphics::Renderable::unlockFrameIfVisible().
Referenced by Graphics::Aurora::ModelNode::setEnvironmentMap().
void Graphics::Aurora::Model::setOrientation | ( | float | x, |
float | y, | ||
float | z, | ||
float | angle | ||
) |
Set the current orientation of the model.
Definition at line 234 of file model.cpp.
References _orientation, calculateDistance(), createAbsolutePosition(), Graphics::Renderable::lockFrameIfVisible(), Graphics::Renderable::resort(), and Graphics::Renderable::unlockFrameIfVisible().
Referenced by Engines::DragonAge::Room::loadLayout(), Engines::DragonAge2::Room::loadLayout(), Engines::NWN::Area::loadTiles(), rotate(), and Engines::NWN::CompassWidget::setRotation().
void Graphics::Aurora::Model::setPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the current position of the model.
Definition at line 250 of file model.cpp.
References _position, calculateDistance(), createAbsolutePosition(), Graphics::Renderable::lockFrameIfVisible(), Graphics::Renderable::resort(), and Graphics::Renderable::unlockFrameIfVisible().
Referenced by Engines::DragonAge::Room::loadLayout(), Engines::DragonAge2::Room::loadLayout(), Engines::NWN2::Area::loadTileModels(), Engines::NWN::Area::loadTiles(), move(), and Engines::NWN::ModelWidget::setPosition().
void Graphics::Aurora::Model::setScale | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the current scale of the model.
Definition at line 219 of file model.cpp.
References _scale, calculateDistance(), createAbsolutePosition(), Graphics::Renderable::lockFrameIfVisible(), Graphics::Renderable::resort(), and Graphics::Renderable::unlockFrameIfVisible().
Referenced by Engines::DragonAge::Room::loadLayout(), Engines::DragonAge2::Room::loadLayout(), and scale().
void Graphics::Aurora::Model::setSkinned | ( | bool | skinned | ) |
Set the flag if the model has skinned animations.
Definition at line 616 of file model.cpp.
References _skinned.
Referenced by Graphics::Aurora::ModelNode_KotOR::load().
void Graphics::Aurora::Model::setState | ( | const Common::UString & | name = "" | ) |
Set the current animation state.
Definition at line 324 of file model.cpp.
References _currentState, _stateList, _stateMap, createBound(), hide(), Graphics::Renderable::isVisible(), Graphics::Renderable::lockFrame(), show(), and Graphics::Renderable::unlockFrame().
Referenced by Engines::NWN::WidgetButton::enter(), finalize(), Engines::NWN::WidgetClose::leave(), Engines::NWN::WidgetButton::leave(), Engines::NWN::WidgetClose::mouseDown(), Engines::NWN::WidgetButton::mouseDown(), Engines::NWN::WidgetClose::mouseUp(), Engines::NWN::WidgetButton::mouseUp(), Engines::NWN::WidgetButton::setDisabled(), Engines::NWN::WidgetButton::setMode(), Engines::NWN::WidgetButton::setPressed(), Engines::NWN::WidgetCheckBox::updateModel(), Engines::NWN::WidgetButton::WidgetButton(), and Engines::NWN::WidgetCheckBox::WidgetCheckBox().
|
virtual |
Show the object.
Reimplemented from Graphics::Renderable.
Definition at line 111 of file model.cpp.
References GfxMan, and Graphics::Renderable::show().
Referenced by Engines::NWN::FadeModel::fadeIn(), setState(), and Engines::NWN::ModelWidget::show().
|
friend |
Definition at line 307 of file model.h.
Referenced by Graphics::Aurora::Model_KotOR::readAnim(), and Graphics::Aurora::Model_NWN::readAnimBinary().
|
friend |
Definition at line 309 of file model.h.
Referenced by addAnimationChannel().
|
friend |
|
protected |
The model's box after translate/rotate.
Definition at line 248 of file model.h.
Referenced by Graphics::Aurora::ModelNode::createAbsoluteBound(), createAbsolutePosition(), createBound(), Graphics::Aurora::Model_Sonic::createBound(), getTooltipAnchor(), and isIn().
|
protected |
Definition at line 243 of file model.h.
Referenced by calculateDistance(), Graphics::Aurora::ModelNode::createAbsoluteBound(), createAbsolutePosition(), createBound(), Graphics::Aurora::Model_Sonic::createBound(), doDrawBound(), getAbsolutePosition(), getTooltipAnchor(), queueDrawBound(), queueRender(), Engines::NWN::NewGameFog::renderImmediate(), and renderImmediate().
|
protected |
Definition at line 233 of file model.h.
Referenced by addAnimationChannel(), addDefaultAnimation(), clearDefaultAnimations(), finalize(), getAnimationChannel(), manageAnimations(), playAnimation(), playDefaultAnimation(), and ~Model().
|
protected |
Map of all animations in this model.
Definition at line 231 of file model.h.
Referenced by getAnimation(), getAnimationScale(), hasAnimation(), Graphics::Aurora::Model_KotOR::readAnim(), Graphics::Aurora::Model_NWN::readAnimBinary(), and ~Model().
|
protected |
The scale of the animation.
Definition at line 235 of file model.h.
Referenced by getAnimationScale(), Graphics::Aurora::Model_NWN::loadASCII(), Graphics::Aurora::Model_NWN::loadBinary(), and Model().
|
private |
Definition at line 282 of file model.h.
Referenced by attachModel(), flushNodeBuffers(), getAttachedModel(), Graphics::Aurora::AnimationChannel::makeModelNodeMap(), manageAnimations(), and Graphics::Aurora::Animation::updateSkinnedModel().
|
protected |
The model's bounding box.
Definition at line 246 of file model.h.
Referenced by createAbsolutePosition(), createBound(), Graphics::Aurora::Model_Sonic::createBound(), doDrawBound(), getDepth(), getHeight(), getWidth(), isIn(), and queueDrawBound().
|
protected |
Definition at line 274 of file model.h.
Referenced by doDrawBound(), Model(), and queueDrawBound().
|
protected |
Definition at line 275 of file model.h.
Referenced by queueDrawBound().
|
protected |
Model's center.
Definition at line 241 of file model.h.
Referenced by calculateDistance(), createBound(), Graphics::Aurora::Model_Sonic::createBound(), and Model().
|
protected |
The current state.
Definition at line 227 of file model.h.
Referenced by Graphics::Aurora::Model_Witcher::addState(), Graphics::Aurora::Model_KotOR::addState(), Graphics::Aurora::Model_NWN2::addState(), Graphics::Aurora::Model_NWN::addState(), Graphics::Aurora::Model_DragonAge::addState(), Graphics::Aurora::Model_Jade::addState(), Graphics::Aurora::Model_Sonic::addState(), createBound(), doDrawSkeleton(), finalize(), flushNodeBuffers(), getNode(), getNodes(), getState(), hasNode(), Graphics::Aurora::AnimationChannel::makeModelNodeMap(), queueRender(), Graphics::Aurora::Model_Sonic::render(), render(), Engines::NWN::NewGameFog::renderImmediate(), renderImmediate(), Graphics::Aurora::AnimationChannel::setCurrentAnimation(), and setState().
|
private |
Definition at line 278 of file model.h.
Referenced by doDrawBound(), drawBound(), and queueDrawBound().
|
private |
Definition at line 279 of file model.h.
Referenced by doDrawSkeleton(), and drawSkeleton().
|
private |
Definition at line 280 of file model.h.
Referenced by doDrawSkeleton(), and drawSkeleton().
|
protected |
The model's file name.
Definition at line 218 of file model.h.
Referenced by Graphics::Aurora::Model_Jade::load(), Graphics::Aurora::Model_NWN::loadASCII(), Graphics::Aurora::Model_NWN::loadBinary(), Graphics::Aurora::Model_DragonAge::Model_DragonAge(), Graphics::Aurora::Model_Jade::Model_Jade(), Graphics::Aurora::Model_KotOR::Model_KotOR(), Graphics::Aurora::Model_NWN::Model_NWN(), Graphics::Aurora::Model_NWN2::Model_NWN2(), Graphics::Aurora::Model_Sonic::Model_Sonic(), and Graphics::Aurora::Model_Witcher::Model_Witcher().
|
protected |
The model's name.
Definition at line 220 of file model.h.
Referenced by Graphics::Aurora::Model_Sonic::findStackBones(), getName(), Graphics::Aurora::Model_Witcher::load(), Graphics::Aurora::Model_KotOR::load(), Graphics::Aurora::Model_DragonAge::load(), Graphics::Aurora::Model_Jade::load(), Graphics::Aurora::Model_NWN::loadASCII(), Graphics::Aurora::Model_NWN::loadBinary(), Graphics::Aurora::Model_Sonic::parseBoneCommands(), Graphics::Aurora::Model_KotOR::readAnim(), Graphics::Aurora::Model_NWN::readAnimBinary(), and Graphics::Aurora::Model_Sonic::readModelHeader().
|
protected |
Model's orientation.
Definition at line 238 of file model.h.
Referenced by Graphics::Aurora::ModelNode::createAbsoluteBound(), createAbsolutePosition(), getOrientation(), Model(), Graphics::Aurora::Model_Sonic::render(), render(), Engines::NWN::NewGameFog::renderImmediate(), rotate(), and setOrientation().
|
protected |
Model's position.
Definition at line 239 of file model.h.
Referenced by calculateDistance(), Graphics::Aurora::ModelNode::createAbsoluteBound(), createAbsolutePosition(), getPosition(), isIn(), Model(), move(), Graphics::Aurora::Model_Sonic::render(), render(), Engines::NWN::NewGameFog::renderImmediate(), and setPosition().
|
protected |
Definition at line 251 of file model.h.
Referenced by Graphics::Aurora::Model_KotOR::Model_KotOR(), and Graphics::Aurora::Animation::update().
|
protected |
Model's scale.
Definition at line 237 of file model.h.
Referenced by Graphics::Aurora::ModelNode::createAbsoluteBound(), createAbsolutePosition(), Graphics::Aurora::ModelNode::flushBuffers(), Graphics::Aurora::ModelNode::getAbsolutePosition(), Graphics::Aurora::ModelNode::getDepth(), getDepth(), Graphics::Aurora::ModelNode::getHeight(), getHeight(), Graphics::Aurora::ModelNode::getPosition(), getScale(), Graphics::Aurora::ModelNode::getWidth(), getWidth(), isIn(), Model(), Graphics::Aurora::Model_NWN::Model_NWN(), Engines::NWN::NewGameFog::NewGameFog(), Graphics::Aurora::Model_Sonic::render(), render(), Engines::NWN::NewGameFog::renderImmediate(), scale(), Graphics::Aurora::ModelNode::setPosition(), and setScale().
|
protected |
Definition at line 250 of file model.h.
Referenced by Graphics::Aurora::Model_KotOR::Model_KotOR(), setSkinned(), Graphics::Aurora::Animation::update(), and Graphics::Aurora::Animation::updateSkinnedModel().
|
protected |
All states within this model.
Definition at line 225 of file model.h.
Referenced by Graphics::Aurora::Model_Witcher::addState(), Graphics::Aurora::Model_KotOR::addState(), Graphics::Aurora::Model_NWN2::addState(), Graphics::Aurora::Model_NWN::addState(), Graphics::Aurora::Model_DragonAge::addState(), Graphics::Aurora::Model_Jade::addState(), Graphics::Aurora::Model_Sonic::addState(), createStateNamesList(), finalize(), setEnvironmentMap(), setState(), Graphics::Aurora::Model_NWN2::setTint(), Graphics::Aurora::Model_NWN2::setTintFloor(), Graphics::Aurora::Model_NWN2::setTintWalls(), and ~Model().
|
protected |
All states within this model, index by name.
Definition at line 226 of file model.h.
Referenced by Graphics::Aurora::Model_Witcher::addState(), Graphics::Aurora::Model_KotOR::addState(), Graphics::Aurora::Model_NWN2::addState(), Graphics::Aurora::Model_NWN::addState(), Graphics::Aurora::Model_DragonAge::addState(), Graphics::Aurora::Model_Jade::addState(), Graphics::Aurora::Model_Sonic::addState(), getNode(), Graphics::Aurora::Model_KotOR::readAnim(), and setState().
|
protected |
All state names.
Definition at line 229 of file model.h.
Referenced by createStateNamesList(), and getStates().
|
protected |
The actual super model.
Definition at line 223 of file model.h.
Referenced by createStateNamesList(), getAnimation(), getAnimationScale(), getNode(), Graphics::Aurora::Model_KotOR::loadSuperModel(), Graphics::Aurora::Model_NWN::loadSuperModel(), and Graphics::Aurora::AnimationChannel::makeModelNodeMap().
|
protected |
Name of the super model.
Definition at line 222 of file model.h.
Referenced by Graphics::Aurora::Model_KotOR::load(), Graphics::Aurora::Model_NWN::loadASCII(), Graphics::Aurora::Model_NWN::loadBinary(), Graphics::Aurora::Model_KotOR::loadSuperModel(), and Graphics::Aurora::Model_NWN::loadSuperModel().
|
protected |
The model's type.
Definition at line 216 of file model.h.
Referenced by calculateDistance(), doDrawSkeleton(), getType(), isIn(), Graphics::Aurora::Model_KotOR::loadSuperModel(), Graphics::Aurora::Model_NWN::loadSuperModel(), and Graphics::Aurora::Model_NWN::Model_NWN().