xoreos  0.0.5
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Graphics::Aurora::Model Class Reference

#include <model.h>

Inheritance diagram for Graphics::Aurora::Model:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Aurora::Model:
Collaboration graph
[legend]

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::UStringgetName () 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::UStringgetState () 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...
 
ModelNodegetNode (const Common::UString &node)
 Get the specified node, from the current state. More...
 
const ModelNodegetNode (const Common::UString &node) const
 Get the specified node, from the current state. More...
 
ModelNodegetNode (const Common::UString &stateName, const Common::UString &node)
 Get the specified node, from the named state, if it exists. More...
 
const ModelNodegetNode (const Common::UString &stateName, const Common::UString &node) const
 Get the specified node, from the named state, if it exists. More...
 
ModelNodegetNode (uint16 nodeNumber)
 Get node by node number. More...
 
const ModelNodegetNode (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)
 
AnimationChannelgetAnimationChannel (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...
 
ModelgetAttachedModel (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::UStringgetTag () 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::ilessNodeMap
 
typedef std::map< Common::UString, Animation *, Common::UString::ilessAnimationMap
 
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 ()
 
AnimationgetAnimation (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 ()
 

Protected Attributes

ModelType _type
 The model's type. More...
 
Common::UString _fileName
 The model's file name. More...
 
Common::UString _name
 The model's name. More...
 
Common::UString _superModelName
 Name of the super model. More...
 
Model_superModel
 The actual super model. More...
 
StateList _stateList
 All states within this model. More...
 
StateMap _stateMap
 All states within this model, index by name. More...
 
State_currentState
 The current state. More...
 
std::list< Common::UString_stateNames
 All state names. More...
 
AnimationMap _animationMap
 Map of all animations in this model. More...
 
AnimationChannelMap _animationChannels
 
float _animationScale
 The scale of the animation. More...
 
float _scale [3]
 Model's scale. More...
 
float _orientation [4]
 Model's orientation. More...
 
float _position [3]
 Model's position. More...
 
float _center [3]
 Model's center. More...
 
glm::mat4 _absolutePosition
 
Common::BoundingBox _boundBox
 The model's bounding box. More...
 
Common::BoundingBox _absoluteBoundBox
 The model's box after translate/rotate. More...
 
bool _skinned
 
bool _positionRelative
 
Shader::ShaderRenderable _boundRenderable
 
glm::mat4 _boundTransform
 
- Protected Attributes inherited from Graphics::Renderable
QueueType _queueExists
 
QueueType _queueVisible
 
uint32 _id
 
bool _clickable
 
Common::UString _tag
 
double _distance
 The distance of the object from the viewer. More...
 

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
 

Detailed Description

Definition at line 63 of file model.h.

Member Typedef Documentation

◆ AnimationChannelMap

Definition at line 200 of file model.h.

◆ AnimationMap

Definition at line 199 of file model.h.

◆ NodeList

typedef std::list<ModelNode *> Graphics::Aurora::Model::NodeList
protected

Definition at line 197 of file model.h.

◆ NodeMap

Definition at line 198 of file model.h.

◆ StateList

typedef std::list<State *> Graphics::Aurora::Model::StateList
protected

Definition at line 212 of file model.h.

◆ StateMap

Definition at line 213 of file model.h.

Constructor & Destructor Documentation

◆ Model()

Graphics::Aurora::Model::Model ( ModelType  type = kModelTypeObject)

◆ ~Model()

Graphics::Aurora::Model::~Model ( )

Definition at line 92 of file model.cpp.

References _animationChannels, _animationMap, _stateList, and hide().

Here is the call graph for this function:

Member Function Documentation

◆ addAnimationChannel()

void Graphics::Aurora::Model::addAnimationChannel ( AnimationChannelName  name)

Definition at line 527 of file model.cpp.

References _animationChannels, and AnimationChannel.

Referenced by Model().

Here is the caller graph for this function:

◆ addDefaultAnimation()

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().

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

◆ advanceTime()

void Graphics::Aurora::Model::advanceTime ( float  dt)
virtual

Advance time (used by renderables with animations).

Reimplemented from Graphics::Renderable.

Definition at line 589 of file model.cpp.

References flushNodeBuffers(), and manageAnimations().

Here is the call graph for this function:

◆ attachModel()

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().

Here is the call graph for this function:

◆ calculateDistance()

void Graphics::Aurora::Model::calculateDistance ( )
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().

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

◆ clearDefaultAnimations()

void Graphics::Aurora::Model::clearDefaultAnimations ( )

Definition at line 545 of file model.cpp.

References _animationChannels, and Graphics::Aurora::AnimationChannel::clearDefaultAnimations().

Here is the call graph for this function:

◆ createAbsolutePosition()

void Graphics::Aurora::Model::createAbsolutePosition ( )
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().

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

◆ createBound()

void Graphics::Aurora::Model::createBound ( )
private

◆ createStateNamesList()

void Graphics::Aurora::Model::createStateNamesList ( std::list< Common::UString > *  stateNames = 0)
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().

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

◆ doDestroy()

void Graphics::Aurora::Model::doDestroy ( )
protectedvirtual

Implements Graphics::GLContainer.

Definition at line 803 of file model.cpp.

◆ doDrawBound()

void Graphics::Aurora::Model::doDrawBound ( )
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().

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

◆ doDrawSkeleton()

void Graphics::Aurora::Model::doDrawSkeleton ( )
protected

◆ doRebuild()

void Graphics::Aurora::Model::doRebuild ( )
protectedvirtual

Implements Graphics::GLContainer.

Definition at line 799 of file model.cpp.

◆ drawBound()

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.

◆ drawSkeleton()

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.

◆ finalize()

void Graphics::Aurora::Model::finalize ( )
protected

◆ flushNodeBuffers()

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().

Here is the caller graph for this function:

◆ getAbsolutePosition()

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.

◆ getAnimation()

Animation * Graphics::Aurora::Model::getAnimation ( const Common::UString anim)
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().

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

◆ getAnimationChannel()

AnimationChannel * Graphics::Aurora::Model::getAnimationChannel ( AnimationChannelName  name)

◆ getAnimationScale()

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().

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

◆ getAttachedModel()

Model * Graphics::Aurora::Model::getAttachedModel ( const Common::UString node)

Definition at line 611 of file model.cpp.

References _attachedModels.

◆ getDepth()

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().

Here is the call graph for this function:

◆ getHeight()

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().

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

◆ getName()

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().

Here is the caller graph for this function:

◆ getNode() [1/6]

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

◆ getNode() [2/6]

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.

Here is the call graph for this function:

◆ getNode() [3/6]

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.

Here is the call graph for this function:

◆ getNode() [4/6]

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.

Here is the call graph for this function:

◆ getNode() [5/6]

ModelNode * Graphics::Aurora::Model::getNode ( uint16  nodeNumber)

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.

Here is the call graph for this function:

◆ getNode() [6/6]

const ModelNode * Graphics::Aurora::Model::getNode ( uint16  nodeNumber) const

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.

Here is the call graph for this function:

◆ getNodes()

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().

Here is the caller graph for this function:

◆ getOrientation()

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.

◆ getPosition()

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().

Here is the caller graph for this function:

◆ getScale()

void Graphics::Aurora::Model::getScale ( float &  x,
float &  y,
float &  z 
) const

Get the current scale of the model.

Definition at line 193 of file model.cpp.

References _scale.

◆ getState()

const Common::UString & Graphics::Aurora::Model::getState ( ) const

◆ getStates()

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.

◆ getTooltipAnchor()

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().

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

◆ getType()

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().

Here is the caller graph for this function:

◆ getWidth()

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().

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

◆ hasAnimation()

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.

◆ hasNode()

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().

Here is the caller graph for this function:

◆ hide()

void Graphics::Aurora::Model::hide ( )
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().

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

◆ isIn() [1/3]

bool Graphics::Aurora::Model::isIn ( float  x,
float  y 
) const
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().

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

◆ isIn() [2/3]

bool Graphics::Aurora::Model::isIn ( float  x,
float  y,
float  z 
) const
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.

Here is the call graph for this function:

◆ isIn() [3/3]

bool Graphics::Aurora::Model::isIn ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
) const
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.

Here is the call graph for this function:

◆ manageAnimations()

void Graphics::Aurora::Model::manageAnimations ( float  dt)
private

Definition at line 620 of file model.cpp.

References _animationChannels, and _attachedModels.

Referenced by advanceTime().

Here is the caller graph for this function:

◆ move()

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().

Here is the call graph for this function:

◆ playAnimation()

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().

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

◆ playDefaultAnimation()

void Graphics::Aurora::Model::playDefaultAnimation ( )

Definition at line 555 of file model.cpp.

References _animationChannels, and Graphics::Aurora::AnimationChannel::playDefaultAnimation().

Here is the call graph for this function:

◆ queueDrawBound()

void Graphics::Aurora::Model::queueDrawBound ( )
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().

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

◆ queueRender()

void Graphics::Aurora::Model::queueRender ( const glm::mat4 &  parentTransform)
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().

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

◆ readArray()

template<typename T >
template void Graphics::Aurora::Model::readArray< float > ( Common::SeekableReadStream stream,
uint32  offset,
uint32  count,
std::vector< T > &  values 
)
static

◆ readArrayDef()

void Graphics::Aurora::Model::readArrayDef ( Common::SeekableReadStream stream,
uint32 offset,
uint32 count 
)
static

◆ readValue() [1/2]

void Graphics::Aurora::Model::readValue ( Common::SeekableReadStream stream,
uint32 value 
)
static

Definition at line 878 of file model.cpp.

References Common::ReadStream::readUint32LE().

Referenced by readArray().

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

◆ readValue() [2/2]

void Graphics::Aurora::Model::readValue ( Common::SeekableReadStream stream,
float &  value 
)
static

Definition at line 882 of file model.cpp.

References Common::ReadStream::readIEEEFloatLE().

Here is the call graph for this function:

◆ render()

void Graphics::Aurora::Model::render ( RenderPass  pass)
virtual

◆ renderImmediate()

void Graphics::Aurora::Model::renderImmediate ( const glm::mat4 &  parentTransform)
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().

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

◆ rotate()

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().

Here is the call graph for this function:

◆ scale()

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().

Here is the call graph for this function:

◆ setEnvironmentMap()

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().

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

◆ setOrientation()

void Graphics::Aurora::Model::setOrientation ( float  x,
float  y,
float  z,
float  angle 
)

◆ setPosition()

void Graphics::Aurora::Model::setPosition ( float  x,
float  y,
float  z 
)

◆ setScale()

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().

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

◆ setSkinned()

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().

Here is the caller graph for this function:

◆ setState()

void Graphics::Aurora::Model::setState ( const Common::UString name = "")

◆ show()

void Graphics::Aurora::Model::show ( )
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().

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

Friends And Related Function Documentation

◆ Animation

friend class Animation
friend

◆ AnimationChannel

friend class AnimationChannel
friend

Definition at line 309 of file model.h.

Referenced by addAnimationChannel().

◆ AnimationThread

friend class AnimationThread
friend

Definition at line 308 of file model.h.

◆ ModelNode

friend class ModelNode
friend

Definition at line 306 of file model.h.

Member Data Documentation

◆ _absoluteBoundBox

Common::BoundingBox Graphics::Aurora::Model::_absoluteBoundBox
protected

◆ _absolutePosition

glm::mat4 Graphics::Aurora::Model::_absolutePosition
protected

◆ _animationChannels

AnimationChannelMap Graphics::Aurora::Model::_animationChannels
protected

◆ _animationMap

AnimationMap Graphics::Aurora::Model::_animationMap
protected

◆ _animationScale

float Graphics::Aurora::Model::_animationScale
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().

◆ _attachedModels

std::map<Common::UString, Model *> Graphics::Aurora::Model::_attachedModels
private

◆ _boundBox

Common::BoundingBox Graphics::Aurora::Model::_boundBox
protected

◆ _boundRenderable

Shader::ShaderRenderable Graphics::Aurora::Model::_boundRenderable
protected

Definition at line 274 of file model.h.

Referenced by doDrawBound(), Model(), and queueDrawBound().

◆ _boundTransform

glm::mat4 Graphics::Aurora::Model::_boundTransform
protected

Definition at line 275 of file model.h.

Referenced by queueDrawBound().

◆ _center

float Graphics::Aurora::Model::_center[3]
protected

Model's center.

Definition at line 241 of file model.h.

Referenced by calculateDistance(), createBound(), Graphics::Aurora::Model_Sonic::createBound(), and Model().

◆ _currentState

State* Graphics::Aurora::Model::_currentState
protected

◆ _drawBound

bool Graphics::Aurora::Model::_drawBound
private

Definition at line 278 of file model.h.

Referenced by doDrawBound(), drawBound(), and queueDrawBound().

◆ _drawSkeleton

bool Graphics::Aurora::Model::_drawSkeleton
private

Definition at line 279 of file model.h.

Referenced by doDrawSkeleton(), and drawSkeleton().

◆ _drawSkeletonInvisible

bool Graphics::Aurora::Model::_drawSkeletonInvisible
private

Definition at line 280 of file model.h.

Referenced by doDrawSkeleton(), and drawSkeleton().

◆ _fileName

Common::UString Graphics::Aurora::Model::_fileName
protected

◆ _name

Common::UString Graphics::Aurora::Model::_name
protected

◆ _orientation

float Graphics::Aurora::Model::_orientation[4]
protected

◆ _position

float Graphics::Aurora::Model::_position[3]
protected

◆ _positionRelative

bool Graphics::Aurora::Model::_positionRelative
protected

◆ _scale

float Graphics::Aurora::Model::_scale[3]
protected

◆ _skinned

bool Graphics::Aurora::Model::_skinned
protected

◆ _stateList

StateList Graphics::Aurora::Model::_stateList
protected

◆ _stateMap

StateMap Graphics::Aurora::Model::_stateMap
protected

◆ _stateNames

std::list<Common::UString> Graphics::Aurora::Model::_stateNames
protected

All state names.

Definition at line 229 of file model.h.

Referenced by createStateNamesList(), and getStates().

◆ _superModel

Model* Graphics::Aurora::Model::_superModel
protected

◆ _superModelName

Common::UString Graphics::Aurora::Model::_superModelName
protected

◆ _type

ModelType Graphics::Aurora::Model::_type
protected

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