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

#include <modelnode.h>

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

Classes

struct  Dangly
 
struct  DanglyData
 
struct  Mesh
 
struct  MeshData
 
struct  Skin
 

Public Types

enum  EnvironmentMapMode { kModeEnvironmentBlendedUnder, kModeEnvironmentBlendedOver }
 The way the environment map is applied to a model node. More...
 

Public Member Functions

 ModelNode (Model &model)
 
virtual ~ModelNode ()
 
const Common::UStringgetName () const
 Get the node's name. More...
 
float getWidth () const
 Get the width of the node's bounding box. More...
 
float getHeight () const
 Get the height of the node's bounding box. More...
 
float getDepth () const
 Get the depth of the node's bounding box. More...
 
void setInvisible (bool invisible)
 Should the node never be rendered at all? More...
 
void setEnvironmentMap (const Common::UString &environmentMap="")
 Change the environment map on this model node. More...
 
void getPosition (float &x, float &y, float &z) const
 Get the position of the node. More...
 
void getRotation (float &x, float &y, float &z) const
 Get the rotation of the node. More...
 
void getOrientation (float &x, float &y, float &z, float &a) const
 Get the orientation of the node. More...
 
void getAbsolutePosition (float &x, float &y, float &z) const
 Get the position of the node after translate/rotate. More...
 
glm::mat4 getAbsolutePosition () const
 Get the position of the node after translate/rotate. More...
 
uint16 getNodeNumber () const
 
void setPosition (float x, float y, float z)
 Set the position of the node. More...
 
void setRotation (float x, float y, float z)
 Set the rotation of the node. More...
 
void setOrientation (float x, float y, float z, float a)
 Set the orientation of the node. More...
 
void move (float x, float y, float z)
 Move the node, relative to its current position. More...
 
void rotate (float x, float y, float z)
 Rotate the node, relative to its current rotation. More...
 
void setTextures (const std::vector< Common::UString > &textures)
 Set textures to the node. More...
 
void computeInverseBindPose ()
 
void computeAbsoluteTransform ()
 
float getAlpha ()
 Get the alpha (transparency) of the node. More...
 
void setAlpha (float alpha, bool isRecursive=true)
 Set the alpha (transparency) of the node. More...
 
float getScaleX ()
 
float getScaleY ()
 
float getScaleZ ()
 
ModelNodegetParent ()
 Get the node's parent. More...
 
const ModelNodegetParent () const
 Get the node's parent. More...
 
void setParent (ModelNode *parent)
 Set the node's parent. More...
 
std::list< ModelNode * > & getChildren ()
 Get the node's children. More...
 
MeshgetMesh () const
 
bool isInFrontOf (const ModelNode &node) const
 Is this node in front of that other node? More...
 
void inheritPosition (ModelNode &node) const
 
void inheritOrientation (ModelNode &node) const
 

Protected Member Functions

void loadTextures (const std::vector< Common::UString > &textures)
 
void createBound ()
 
void createCenter ()
 
void createAbsoluteBound ()
 
void createAbsoluteBound (Common::BoundingBox parentPosition)
 
void render (RenderPass pass)
 
void drawSkeleton (const glm::mat4 &parent, bool showInvisible)
 
void calcRenderTransform (const glm::mat4 &parentTransform)
 Calculate the transform used for rendering. More...
 
void renderImmediate (const glm::mat4 &parentTransform)
 
void queueRender (const glm::mat4 &parentTransform)
 
void lockFrame ()
 
void unlockFrame ()
 
void lockFrameIfVisible ()
 
void unlockFrameIfVisible ()
 
void setBufferedPosition (float x, float y, float z)
 
void setBufferedOrientation (float x, float y, float z, float angle)
 
void flushBuffers ()
 
TextureHandlegetTextures (uint32 &count)
 
TextureHandlegetEnvironmentMap (EnvironmentMapMode &mode)
 
void setMaterial (Shader::ShaderMaterial *material)
 
virtual void buildMaterial ()
 

Protected Attributes

Model_model
 The model this node belongs to. More...
 
ModelNode_parent
 The node's parent. More...
 
std::list< ModelNode * > _children
 The node's children. More...
 
Model_attachedModel
 The model that is attached to this node. More...
 
uint32 _level
 
Common::UString _name
 The node's name. More...
 
std::vector< Shader::ShaderRenderable_renderableArray
 Damn you bioware. More...
 
float _center [3]
 The node's center. More...
 
float _position [3]
 Position of the node. More...
 
float _rotation [3]
 Node rotation. More...
 
float _orientation [4]
 Orientation of the node. More...
 
float _scale [3]
 Scale of the node. More...
 
float _alpha
 Alpha of the node, used if no _mesh is present in this node. More...
 
std::vector< PositionKeyFrame_positionFrames
 Keyframes for position animation. More...
 
std::vector< QuaternionKeyFrame_orientationFrames
 Keyframes for orientation animation. More...
 
glm::mat4 _absolutePosition
 Position of the node after translate/rotate. More...
 
glm::mat4 _renderTransform
 
bool _render
 Render the node? More...
 
bool _dirtyRender
 Rendering information needs updating. More...
 
bool _dirtyMesh
 Mesh data needs updating. More...
 
Mesh_mesh
 
ModelNode_rootStateNode
 
Common::BoundingBox _boundBox
 
Common::BoundingBox _absoluteBoundBox
 
uint16 _nodeNumber
 
glm::mat4 _invBindPose
 Inverse bind pose matrix used for animations. More...
 
glm::mat4 _absoluteTransform
 Absolute transformation matrix used for animations. More...
 
float _positionBuffer [3]
 
bool _positionBuffered
 
float _orientationBuffer [4]
 
bool _orientationBuffered
 
std::vector< float > _vertexCoordsBuffer
 
bool _vertexCoordsBuffered
 
Shader::ShaderMaterial_material
 
Shader::ShaderRenderable_shaderRenderable
 

Private Member Functions

const Common::BoundingBoxgetAbsoluteBound () const
 
void orderChildren ()
 

Static Private Member Functions

static void renderGeometry (Mesh &mesh)
 
static void renderGeometryNormal (Mesh &mesh)
 
static void renderGeometryEnvMappedUnder (Mesh &mesh)
 
static void renderGeometryEnvMappedOver (Mesh &mesh)
 
static bool renderableMesh (Mesh *mesh)
 

Friends

class Model
 
class Animation
 
class AnimationChannel
 

Detailed Description

Definition at line 65 of file modelnode.h.

Member Enumeration Documentation

◆ EnvironmentMapMode

The way the environment map is applied to a model node.

Enumerator
kModeEnvironmentBlendedUnder 

Environment map first, then blend the diffuse textures in.

kModeEnvironmentBlendedOver 

Diffuse textures first, then blend the environment map in.

Definition at line 129 of file modelnode.h.

Constructor & Destructor Documentation

◆ ModelNode()

Graphics::Aurora::ModelNode::ModelNode ( Model model)

Definition at line 76 of file modelnode.cpp.

References _orientation, _orientationBuffer, _position, _positionBuffer, _rotation, and _scale.

◆ ~ModelNode()

Graphics::Aurora::ModelNode::~ModelNode ( )
virtual

Member Function Documentation

◆ buildMaterial()

void Graphics::Aurora::ModelNode::buildMaterial ( )
protectedvirtual

If there's no override of mesh, textures, or environment mapping, then don't bother to create any new renderables. Just make sure rootStateNode has some, and have the render queuing use the renderables from there instead. This isn't really a problem, as the per-modelnode data (modelview matrix in this case) is still supplied from _this object.

To get here, _mesh must exist and have some data. This is required to consider making a new renderable - otherwise, the renderable of the parent can be used directly. This may change depending what information the renderable is dependent on during creation. Important information in this case means texture or environment maps are overidden from any potential parent.

Seems that, regardless of _isTransparent, anything with shperical env mapping is opaque. This mostly comes from NWN, where it's seen that things marked as transparent actually shouldn't be. It's assumed this carries over to other game titles as well.

Sometimes the _textures handler array isn't matched up against what is properly loaded (missing files from disk). So do some brief sanity checks on this.

Reimplemented in Graphics::Aurora::ModelNode_Witcher, Graphics::Aurora::ModelNode_Jade, and Graphics::Aurora::ModelNode_KotOR.

Definition at line 1008 of file modelnode.cpp.

References _dirtyRender, _mesh, _model, _name, _render, _renderableArray, _rootStateNode, Graphics::Shader::ShaderDescriptor::addPass(), Graphics::Aurora::ModelNode::Mesh::alpha, Graphics::Shader::ShaderDescriptor::BLEND_DST_ALPHA, Graphics::Shader::ShaderDescriptor::BLEND_IGNORED, Graphics::Shader::ShaderDescriptor::BLEND_MULTIPLY, Graphics::Shader::ShaderDescriptor::BLEND_ONE, Graphics::Shader::ShaderDescriptor::BLEND_SRC_ALPHA, Graphics::Shader::ShaderDescriptor::build(), Graphics::Shader::ShaderDescriptor::connect(), Graphics::Aurora::ModelNode::Mesh::data, Graphics::Shader::ShaderDescriptor::declareInput(), Graphics::Shader::ShaderDescriptor::declareSampler(), Graphics::Aurora::TextureHandle::empty(), Common::UString::empty(), Graphics::Shader::ShaderDescriptor::ENV_CUBE, Graphics::Shader::ShaderDescriptor::ENV_SPHERE, Graphics::Aurora::ModelNode::MeshData::envMap, Graphics::Shader::ShaderDescriptor::FORCE_OPAQUE, Graphics::Shader::ShaderDescriptor::genName(), Graphics::VertexBuffer::getCount(), getEnvironmentMap(), Graphics::Aurora::Texture::getImage(), Graphics::Aurora::TextureHandle::getName(), Graphics::Aurora::Model::getNode(), Graphics::Aurora::Model::getState(), Graphics::Aurora::TextureHandle::getTexture(), getTextures(), Graphics::Shader::ShaderMaterial::getVariableData(), Graphics::Mesh::Mesh::getVertexBuffer(), GfxMan, Graphics::Shader::ShaderSampler::handle, Graphics::Aurora::ModelNode::Mesh::hasTransparencyHint, Graphics::Shader::ShaderDescriptor::INPUT_NORMAL0, Graphics::Shader::ShaderDescriptor::INPUT_POSITION0, Graphics::Shader::ShaderDescriptor::INPUT_UV0, Graphics::Shader::ShaderDescriptor::INPUT_UV_CUBE, Graphics::Shader::ShaderDescriptor::INPUT_UV_SPHERE, Graphics::ImageDecoder::isCubeMap(), Graphics::Aurora::ModelNode::Mesh::isTransparent, kModeEnvironmentBlendedOver, kModeEnvironmentBlendedUnder, Graphics::Shader::ShaderMaterial::MATERIAL_DECAL, Graphics::Shader::ShaderMaterial::MATERIAL_OPAQUE, Graphics::Shader::ShaderMaterial::MATERIAL_SPECIAL_BLEND, Graphics::Shader::ShaderMaterial::MATERIAL_TRANSPARENT, Graphics::Shader::ShaderMaterial::MATERIAL_TRANSPARENT_B, MaterialMan, Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Shader::ShaderDescriptor::SAMPLER_2D, Graphics::Shader::ShaderDescriptor::SAMPLER_CUBE, Graphics::Shader::ShaderDescriptor::SAMPLER_TEXTURE_0, Graphics::Shader::ShaderDescriptor::SAMPLER_TEXTURE_1, Graphics::Shader::ShaderDescriptor::SAMPLER_TEXTURE_2, Graphics::Shader::ShaderDescriptor::SAMPLER_TEXTURE_7, Graphics::Shader::ShaderMaterial::setFlags(), Graphics::Shader::SHADER_FRAGMENT, Graphics::Shader::SHADER_VERTEX, ShaderMan, SurfaceMan, Graphics::Shader::ShaderDescriptor::TEXTURE_DIFFUSE, Graphics::Shader::ShaderDescriptor::TEXTURE_LIGHTMAP, and Graphics::Aurora::ModelNode::MeshData::textures.

Referenced by Graphics::Aurora::ModelNode_Jade::buildMaterial(), Graphics::Aurora::ModelNode_KotOR::buildMaterial(), Graphics::Aurora::ModelNode_DragonAge::load(), Graphics::Aurora::ModelNode_NWN_ASCII::load(), queueRender(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), and renderImmediate().

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

◆ calcRenderTransform()

void Graphics::Aurora::ModelNode::calcRenderTransform ( const glm::mat4 &  parentTransform)
protected

Calculate the transform used for rendering.

Definition at line 692 of file modelnode.cpp.

References _orientation, _position, _renderTransform, _rotation, _scale, and Common::deg2rad().

Referenced by queueRender(), and renderImmediate().

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

◆ computeAbsoluteTransform()

void Graphics::Aurora::ModelNode::computeAbsoluteTransform ( )

Definition at line 921 of file modelnode.cpp.

References _absoluteTransform, _orientationBuffer, _parent, _positionBuffer, and Common::deg2rad().

Here is the call graph for this function:

◆ computeInverseBindPose()

void Graphics::Aurora::ModelNode::computeInverseBindPose ( )

◆ createAbsoluteBound() [1/2]

void Graphics::Aurora::ModelNode::createAbsoluteBound ( )
protected

Definition at line 450 of file modelnode.cpp.

Referenced by Graphics::Aurora::ModelNode_Sonic::createAbsoluteBound().

Here is the caller graph for this function:

◆ createAbsoluteBound() [2/2]

void Graphics::Aurora::ModelNode::createAbsoluteBound ( Common::BoundingBox  parentPosition)
protected

◆ createBound()

void Graphics::Aurora::ModelNode::createBound ( )
protected

◆ createCenter()

void Graphics::Aurora::ModelNode::createCenter ( )
protected

Definition at line 435 of file modelnode.cpp.

References _boundBox, _center, Common::BoundingBox::getMax(), and Common::BoundingBox::getMin().

Referenced by createBound().

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

◆ drawSkeleton()

void Graphics::Aurora::ModelNode::drawSkeleton ( const glm::mat4 &  parent,
bool  showInvisible 
)
protected

Definition at line 791 of file modelnode.cpp.

References _children, _orientation, _render, _scale, and Common::deg2rad().

Here is the call graph for this function:

◆ flushBuffers()

void Graphics::Aurora::ModelNode::flushBuffers ( )
protected

◆ getAbsoluteBound()

const Common::BoundingBox & Graphics::Aurora::ModelNode::getAbsoluteBound ( ) const
private

Definition at line 446 of file modelnode.cpp.

References _absoluteBoundBox.

◆ getAbsolutePosition() [1/2]

void Graphics::Aurora::ModelNode::getAbsolutePosition ( float &  x,
float &  y,
float &  z 
) const

Get the position of the node after translate/rotate.

Definition at line 200 of file modelnode.cpp.

References _absolutePosition, _model, and Graphics::Aurora::Model::_scale.

◆ getAbsolutePosition() [2/2]

glm::mat4 Graphics::Aurora::ModelNode::getAbsolutePosition ( ) const

Get the position of the node after translate/rotate.

Definition at line 206 of file modelnode.cpp.

References _absolutePosition, _model, and Graphics::Aurora::Model::_scale.

◆ getAlpha()

float Graphics::Aurora::ModelNode::getAlpha ( )

Get the alpha (transparency) of the node.

Definition at line 318 of file modelnode.cpp.

References _alpha, _mesh, and Graphics::Aurora::ModelNode::Mesh::alpha.

Referenced by queueRender(), and renderImmediate().

Here is the caller graph for this function:

◆ getChildren()

std::list< ModelNode * > & Graphics::Aurora::ModelNode::getChildren ( )

Get the node's children.

Definition at line 152 of file modelnode.cpp.

References _children.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::checkDuplicateNode().

Here is the caller graph for this function:

◆ getDepth()

float Graphics::Aurora::ModelNode::getDepth ( ) const

Get the depth of the node's bounding box.

Definition at line 168 of file modelnode.cpp.

References _boundBox, _model, Graphics::Aurora::Model::_scale, and Common::BoundingBox::getDepth().

Here is the call graph for this function:

◆ getEnvironmentMap()

TextureHandle * Graphics::Aurora::ModelNode::getEnvironmentMap ( EnvironmentMapMode mode)
protected

◆ getHeight()

float Graphics::Aurora::ModelNode::getHeight ( ) const

Get the height of the node's bounding box.

Definition at line 164 of file modelnode.cpp.

References _boundBox, _model, Graphics::Aurora::Model::_scale, and Common::BoundingBox::getHeight().

Here is the call graph for this function:

◆ getMesh()

ModelNode::Mesh * Graphics::Aurora::ModelNode::getMesh ( ) const

Definition at line 950 of file modelnode.cpp.

References _mesh, _model, _name, Common::UString::empty(), Graphics::Aurora::Model::getNode(), and Graphics::Aurora::Model::getState().

Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), and Graphics::Aurora::Model_KotOR::makeBoneNodeMap().

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

◆ getName()

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

Get the node's name.

Definition at line 156 of file modelnode.cpp.

References _name.

Referenced by Graphics::Aurora::AnimNode::AnimNode(), and Graphics::Aurora::AnimationChannel::makeModelNodeMap().

Here is the caller graph for this function:

◆ getNodeNumber()

uint16 Graphics::Aurora::ModelNode::getNodeNumber ( ) const

Definition at line 213 of file modelnode.cpp.

References _nodeNumber.

Referenced by Graphics::Aurora::Model::getNode(), and Graphics::Aurora::AnimationChannel::makeModelNodeMap().

Here is the caller graph for this function:

◆ getOrientation()

void Graphics::Aurora::ModelNode::getOrientation ( float &  x,
float &  y,
float &  z,
float &  a 
) const

Get the orientation of the node.

Definition at line 193 of file modelnode.cpp.

References _orientation.

◆ getParent() [1/2]

ModelNode * Graphics::Aurora::ModelNode::getParent ( )

Get the node's parent.

Definition at line 135 of file modelnode.cpp.

References _parent.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::checkDuplicateNode().

Here is the caller graph for this function:

◆ getParent() [2/2]

const ModelNode * Graphics::Aurora::ModelNode::getParent ( ) const

Get the node's parent.

Definition at line 139 of file modelnode.cpp.

References _parent.

◆ getPosition()

void Graphics::Aurora::ModelNode::getPosition ( float &  x,
float &  y,
float &  z 
) const

◆ getRotation()

void Graphics::Aurora::ModelNode::getRotation ( float &  x,
float &  y,
float &  z 
) const

Get the rotation of the node.

Definition at line 187 of file modelnode.cpp.

References _rotation.

◆ getScaleX()

float Graphics::Aurora::ModelNode::getScaleX ( )
inline

Definition at line 124 of file modelnode.h.

References _scale.

◆ getScaleY()

float Graphics::Aurora::ModelNode::getScaleY ( )
inline

Definition at line 125 of file modelnode.h.

References _scale.

◆ getScaleZ()

float Graphics::Aurora::ModelNode::getScaleZ ( )
inline

Definition at line 126 of file modelnode.h.

References _scale.

◆ getTextures()

TextureHandle * Graphics::Aurora::ModelNode::getTextures ( uint32 count)
protected

Definition at line 967 of file modelnode.cpp.

References _mesh, _model, _name, Graphics::Aurora::ModelNode::Mesh::data, Graphics::Aurora::Model::getNode(), getTextures(), and Graphics::Aurora::ModelNode::MeshData::textures.

Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), and getTextures().

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

◆ getWidth()

float Graphics::Aurora::ModelNode::getWidth ( ) const

Get the width of the node's bounding box.

Definition at line 160 of file modelnode.cpp.

References _boundBox, _model, Graphics::Aurora::Model::_scale, and Common::BoundingBox::getWidth().

Referenced by Engines::NWN::WidgetSlider::changePosition().

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

◆ inheritOrientation()

void Graphics::Aurora::ModelNode::inheritOrientation ( ModelNode node) const

Definition at line 268 of file modelnode.cpp.

References _orientation.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

Here is the caller graph for this function:

◆ inheritPosition()

void Graphics::Aurora::ModelNode::inheritPosition ( ModelNode node) const

Definition at line 262 of file modelnode.cpp.

References _position.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

Here is the caller graph for this function:

◆ isInFrontOf()

bool Graphics::Aurora::ModelNode::isInFrontOf ( const ModelNode node) const

Is this node in front of that other node?

Definition at line 172 of file modelnode.cpp.

References _model, _position, Graphics::Aurora::Model::getType(), and Graphics::Aurora::kModelTypeGUIFront.

Referenced by Graphics::Aurora::nodeComp().

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

◆ loadTextures()

void Graphics::Aurora::ModelNode::loadTextures ( const std::vector< Common::UString > &  textures)
protected

◆ lockFrame()

void Graphics::Aurora::ModelNode::lockFrame ( )
protected

Definition at line 826 of file modelnode.cpp.

References _model, and Graphics::Renderable::lockFrame().

Here is the call graph for this function:

◆ lockFrameIfVisible()

void Graphics::Aurora::ModelNode::lockFrameIfVisible ( )
protected

Definition at line 834 of file modelnode.cpp.

References _model, and Graphics::Renderable::lockFrameIfVisible().

Referenced by setOrientation(), setPosition(), setRotation(), setTextures(), and Graphics::Aurora::ModelNode_NWN2::setTint().

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

◆ move()

void Graphics::Aurora::ModelNode::move ( float  x,
float  y,
float  z 
)

Move the node, relative to its current position.

Definition at line 251 of file modelnode.cpp.

References getPosition(), and setPosition().

Referenced by Engines::NWN::WidgetSlider::changePosition(), Engines::NWN::CharPortrait::CharPortrait(), and Engines::NWN::WidgetCheckBox::WidgetCheckBox().

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

◆ orderChildren()

void Graphics::Aurora::ModelNode::orderChildren ( )
private

Definition at line 528 of file modelnode.cpp.

References _children, and Graphics::Aurora::nodeComp().

Referenced by setPosition().

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

◆ queueRender()

void Graphics::Aurora::ModelNode::queueRender ( const glm::mat4 &  parentTransform)
protected

Ignoring _render for now because it's being falsely set to false.

Do this regardless of if the modelnode is actually visible or not, to prevent stutter when things are first brought into view. Most things are loaded at the start of a level, so stutter won't be noticed then.

Todo:
Ideally there should be some kind of check in here to determine visibility. if the node isn't (camera) visible, then don't bother trying to render it.

Definition at line 750 of file modelnode.cpp.

References _attachedModel, _children, _dirtyRender, _renderableArray, _renderTransform, _rootStateNode, buildMaterial(), calcRenderTransform(), getAlpha(), Graphics::Aurora::Model::queueRender(), and RenderMan.

Here is the call graph for this function:

◆ render()

void Graphics::Aurora::ModelNode::render ( RenderPass  pass)
protected

◆ renderableMesh()

bool Graphics::Aurora::ModelNode::renderableMesh ( Mesh mesh)
staticprivate

Definition at line 636 of file modelnode.cpp.

References Graphics::Aurora::ModelNode::Mesh::data, and Graphics::Aurora::ModelNode::MeshData::rawMesh.

Referenced by render().

Here is the caller graph for this function:

◆ renderGeometry()

void Graphics::Aurora::ModelNode::renderGeometry ( ModelNode::Mesh mesh)
staticprivate

Definition at line 536 of file modelnode.cpp.

References renderGeometryNormal().

Referenced by render().

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

◆ renderGeometryEnvMappedOver()

void Graphics::Aurora::ModelNode::renderGeometryEnvMappedOver ( Mesh mesh)
staticprivate

◆ renderGeometryEnvMappedUnder()

void Graphics::Aurora::ModelNode::renderGeometryEnvMappedUnder ( Mesh mesh)
staticprivate

◆ renderGeometryNormal()

void Graphics::Aurora::ModelNode::renderGeometryNormal ( Mesh mesh)
staticprivate

Definition at line 540 of file modelnode.cpp.

References Graphics::Aurora::ModelNode::Mesh::data, Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Mesh::Mesh::renderImmediate(), TextureMan, and Graphics::Aurora::ModelNode::MeshData::textures.

Referenced by renderGeometry().

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

◆ renderImmediate()

void Graphics::Aurora::ModelNode::renderImmediate ( const glm::mat4 &  parentTransform)
protected

Ignoring _render for now because it's being falsely set to false.

Do this regardless of if the modelnode is actually visible or not, to prevent stutter when things are first brought into view. Most things are loaded at the start of a level, so stutter won't be noticed then.

Todo:
Ideally there should be some kind of check in here to determine visibility. if the node isn't (camera) visible, then don't bother trying to render it.

Definition at line 709 of file modelnode.cpp.

References _attachedModel, _children, _dirtyRender, _renderableArray, _renderTransform, _rootStateNode, buildMaterial(), calcRenderTransform(), getAlpha(), and Graphics::Aurora::Model::renderImmediate().

Here is the call graph for this function:

◆ rotate()

void Graphics::Aurora::ModelNode::rotate ( float  x,
float  y,
float  z 
)

Rotate the node, relative to its current rotation.

Definition at line 258 of file modelnode.cpp.

References _rotation, and setRotation().

Here is the call graph for this function:

◆ setAlpha()

void Graphics::Aurora::ModelNode::setAlpha ( float  alpha,
bool  isRecursive = true 
)

Set the alpha (transparency) of the node.

Definition at line 326 of file modelnode.cpp.

References _alpha, _children, _mesh, and Graphics::Aurora::ModelNode::Mesh::alpha.

◆ setBufferedOrientation()

void Graphics::Aurora::ModelNode::setBufferedOrientation ( float  x,
float  y,
float  z,
float  angle 
)
protected

Definition at line 849 of file modelnode.cpp.

References _orientationBuffer, and _orientationBuffered.

Referenced by Graphics::Aurora::Animation::interpolateOrientation().

Here is the caller graph for this function:

◆ setBufferedPosition()

void Graphics::Aurora::ModelNode::setBufferedPosition ( float  x,
float  y,
float  z 
)
protected

Definition at line 842 of file modelnode.cpp.

References _positionBuffer, and _positionBuffered.

Referenced by Graphics::Aurora::Animation::interpolatePosition().

Here is the caller graph for this function:

◆ setEnvironmentMap()

void Graphics::Aurora::ModelNode::setEnvironmentMap ( const Common::UString environmentMap = "")

◆ setInvisible()

void Graphics::Aurora::ModelNode::setInvisible ( bool  invisible)

Should the node never be rendered at all?

Definition at line 293 of file modelnode.cpp.

References _render.

Referenced by Engines::NWN::QuickbarButton::QuickbarButton(), and Engines::NWN::WidgetCheckBox::WidgetCheckBox().

Here is the caller graph for this function:

◆ setMaterial()

void Graphics::Aurora::ModelNode::setMaterial ( Shader::ShaderMaterial material)
protected

Definition at line 311 of file modelnode.cpp.

References _material, _shaderRenderable, and Graphics::Shader::ShaderRenderable::setMaterial().

Here is the call graph for this function:

◆ setOrientation()

void Graphics::Aurora::ModelNode::setOrientation ( float  x,
float  y,
float  z,
float  a 
)

Set the orientation of the node.

Definition at line 240 of file modelnode.cpp.

References _orientation, lockFrameIfVisible(), and unlockFrameIfVisible().

Here is the call graph for this function:

◆ setParent()

void Graphics::Aurora::ModelNode::setParent ( ModelNode parent)

◆ setPosition()

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

Set the position of the node.

Definition at line 217 of file modelnode.cpp.

References _model, _parent, _position, Graphics::Aurora::Model::_scale, lockFrameIfVisible(), orderChildren(), and unlockFrameIfVisible().

Referenced by move().

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

◆ setRotation()

void Graphics::Aurora::ModelNode::setRotation ( float  x,
float  y,
float  z 
)

Set the rotation of the node.

Definition at line 230 of file modelnode.cpp.

References _rotation, lockFrameIfVisible(), and unlockFrameIfVisible().

Referenced by rotate(), and Engines::NWN::CompassWidget::setRotation().

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

◆ setTextures()

void Graphics::Aurora::ModelNode::setTextures ( const std::vector< Common::UString > &  textures)

Set textures to the node.

Definition at line 297 of file modelnode.cpp.

References _mesh, _render, Graphics::Aurora::ModelNode::Mesh::data, loadTextures(), lockFrameIfVisible(), and unlockFrameIfVisible().

Referenced by Engines::NWN::CharSpells::makeSpellsList(), and Engines::NWN::CharPortrait::setMainTexture().

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

◆ unlockFrame()

void Graphics::Aurora::ModelNode::unlockFrame ( )
protected

Definition at line 830 of file modelnode.cpp.

References _model, and Graphics::Renderable::unlockFrame().

Here is the call graph for this function:

◆ unlockFrameIfVisible()

void Graphics::Aurora::ModelNode::unlockFrameIfVisible ( )
protected

Definition at line 838 of file modelnode.cpp.

References _model, and Graphics::Renderable::unlockFrameIfVisible().

Referenced by setOrientation(), setPosition(), setRotation(), setTextures(), and Graphics::Aurora::ModelNode_NWN2::setTint().

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

Definition at line 325 of file modelnode.h.

◆ AnimationChannel

friend class AnimationChannel
friend

Definition at line 326 of file modelnode.h.

◆ Model

friend class Model
friend

Definition at line 324 of file modelnode.h.

Member Data Documentation

◆ _absoluteBoundBox

Common::BoundingBox Graphics::Aurora::ModelNode::_absoluteBoundBox
protected

Definition at line 243 of file modelnode.h.

Referenced by createAbsoluteBound(), and getAbsoluteBound().

◆ _absolutePosition

glm::mat4 Graphics::Aurora::ModelNode::_absolutePosition
protected

Position of the node after translate/rotate.

Definition at line 232 of file modelnode.h.

Referenced by createAbsoluteBound(), and getAbsolutePosition().

◆ _absoluteTransform

glm::mat4 Graphics::Aurora::ModelNode::_absoluteTransform
protected

Absolute transformation matrix used for animations.

Definition at line 248 of file modelnode.h.

Referenced by computeAbsoluteTransform().

◆ _alpha

float Graphics::Aurora::ModelNode::_alpha
protected

Alpha of the node, used if no _mesh is present in this node.

Definition at line 226 of file modelnode.h.

Referenced by getAlpha(), and setAlpha().

◆ _attachedModel

Model* Graphics::Aurora::ModelNode::_attachedModel
protected

The model that is attached to this node.

Definition at line 212 of file modelnode.h.

Referenced by Graphics::Aurora::Model::attachModel(), createAbsoluteBound(), queueRender(), render(), renderImmediate(), setEnvironmentMap(), and ~ModelNode().

◆ _boundBox

Common::BoundingBox Graphics::Aurora::ModelNode::_boundBox
protected

◆ _center

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

The node's center.

Definition at line 220 of file modelnode.h.

Referenced by createCenter().

◆ _children

std::list<ModelNode *> Graphics::Aurora::ModelNode::_children
protected

◆ _dirtyMesh

bool Graphics::Aurora::ModelNode::_dirtyMesh
protected

Mesh data needs updating.

Definition at line 237 of file modelnode.h.

Referenced by flushBuffers(), and render().

◆ _dirtyRender

bool Graphics::Aurora::ModelNode::_dirtyRender
protected

Rendering information needs updating.

Definition at line 236 of file modelnode.h.

Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), loadTextures(), queueRender(), renderImmediate(), and setEnvironmentMap().

◆ _invBindPose

glm::mat4 Graphics::Aurora::ModelNode::_invBindPose
protected

Inverse bind pose matrix used for animations.

Definition at line 247 of file modelnode.h.

Referenced by computeInverseBindPose(), and Graphics::Aurora::Animation::updateSkinnedModel().

◆ _level

uint32 Graphics::Aurora::ModelNode::_level
protected

Definition at line 214 of file modelnode.h.

Referenced by setParent().

◆ _material

Shader::ShaderMaterial* Graphics::Aurora::ModelNode::_material
protected

Definition at line 259 of file modelnode.h.

Referenced by setMaterial().

◆ _mesh

Mesh* Graphics::Aurora::ModelNode::_mesh
protected

◆ _model

Model* Graphics::Aurora::ModelNode::_model
protected

◆ _name

Common::UString Graphics::Aurora::ModelNode::_name
protected

◆ _nodeNumber

uint16 Graphics::Aurora::ModelNode::_nodeNumber
protected

◆ _orientation

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

◆ _orientationBuffer

float Graphics::Aurora::ModelNode::_orientationBuffer[4]
protected

◆ _orientationBuffered

bool Graphics::Aurora::ModelNode::_orientationBuffered
protected

Definition at line 254 of file modelnode.h.

Referenced by flushBuffers(), and setBufferedOrientation().

◆ _orientationFrames

std::vector<QuaternionKeyFrame> Graphics::Aurora::ModelNode::_orientationFrames
protected

◆ _parent

ModelNode* Graphics::Aurora::ModelNode::_parent
protected

◆ _position

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

◆ _positionBuffer

float Graphics::Aurora::ModelNode::_positionBuffer[3]
protected

◆ _positionBuffered

bool Graphics::Aurora::ModelNode::_positionBuffered
protected

Definition at line 252 of file modelnode.h.

Referenced by flushBuffers(), and setBufferedPosition().

◆ _positionFrames

std::vector<PositionKeyFrame> Graphics::Aurora::ModelNode::_positionFrames
protected

◆ _render

bool Graphics::Aurora::ModelNode::_render
protected

◆ _renderableArray

std::vector<Shader::ShaderRenderable> Graphics::Aurora::ModelNode::_renderableArray
protected

Damn you bioware.

Definition at line 218 of file modelnode.h.

Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), queueRender(), and renderImmediate().

◆ _renderTransform

glm::mat4 Graphics::Aurora::ModelNode::_renderTransform
protected

Definition at line 233 of file modelnode.h.

Referenced by calcRenderTransform(), queueRender(), and renderImmediate().

◆ _rootStateNode

ModelNode* Graphics::Aurora::ModelNode::_rootStateNode
protected

◆ _rotation

float Graphics::Aurora::ModelNode::_rotation[3]
protected

Node rotation.

Definition at line 222 of file modelnode.h.

Referenced by calcRenderTransform(), createAbsoluteBound(), getRotation(), ModelNode(), render(), rotate(), and setRotation().

◆ _scale

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

◆ _shaderRenderable

Shader::ShaderRenderable* Graphics::Aurora::ModelNode::_shaderRenderable
protected

Definition at line 260 of file modelnode.h.

Referenced by setMaterial().

◆ _vertexCoordsBuffer

std::vector<float> Graphics::Aurora::ModelNode::_vertexCoordsBuffer
protected

Definition at line 255 of file modelnode.h.

Referenced by flushBuffers(), and Graphics::Aurora::Animation::updateSkinnedModel().

◆ _vertexCoordsBuffered

bool Graphics::Aurora::ModelNode::_vertexCoordsBuffered
protected

Definition at line 256 of file modelnode.h.

Referenced by flushBuffers(), and Graphics::Aurora::Animation::updateSkinnedModel().


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