xoreos
0.0.5
|
#include <modelnode.h>
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::UString & | getName () 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 () |
ModelNode * | getParent () |
Get the node's parent. More... | |
const ModelNode * | getParent () 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... | |
Mesh * | getMesh () 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 () |
TextureHandle * | getTextures (uint32 &count) |
TextureHandle * | getEnvironmentMap (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::BoundingBox & | getAbsoluteBound () 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 |
Definition at line 65 of file modelnode.h.
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.
Graphics::Aurora::ModelNode::ModelNode | ( | Model & | model | ) |
Definition at line 76 of file modelnode.cpp.
References _orientation, _orientationBuffer, _position, _positionBuffer, _rotation, and _scale.
|
virtual |
Definition at line 114 of file modelnode.cpp.
References _attachedModel, _mesh, Graphics::Aurora::ModelNode::Mesh::dangly, Graphics::Aurora::ModelNode::Dangly::data, Graphics::Aurora::ModelNode::Mesh::data, and Graphics::Aurora::ModelNode::Mesh::skin.
|
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().
|
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().
void Graphics::Aurora::ModelNode::computeAbsoluteTransform | ( | ) |
Definition at line 921 of file modelnode.cpp.
References _absoluteTransform, _orientationBuffer, _parent, _positionBuffer, and Common::deg2rad().
void Graphics::Aurora::ModelNode::computeInverseBindPose | ( | ) |
Definition at line 891 of file modelnode.cpp.
References _invBindPose, _orientationFrames, _parent, _positionFrames, inverse(), Graphics::Aurora::QuaternionKeyFrame::q, Graphics::Aurora::PositionKeyFrame::x, Graphics::Aurora::QuaternionKeyFrame::x, Graphics::Aurora::PositionKeyFrame::y, Graphics::Aurora::QuaternionKeyFrame::y, Graphics::Aurora::PositionKeyFrame::z, and Graphics::Aurora::QuaternionKeyFrame::z.
Referenced by Graphics::Aurora::Model_KotOR::makeBoneNodeMap().
|
protected |
Definition at line 450 of file modelnode.cpp.
Referenced by Graphics::Aurora::ModelNode_Sonic::createAbsoluteBound().
|
protected |
Definition at line 456 of file modelnode.cpp.
References _absoluteBoundBox, Graphics::Aurora::Model::_absoluteBoundBox, _absolutePosition, Graphics::Aurora::Model::_absolutePosition, _attachedModel, _boundBox, _children, _model, _name, _orientation, Graphics::Aurora::Model::_orientation, _position, Graphics::Aurora::Model::_position, _rotation, _scale, Graphics::Aurora::Model::_scale, Common::BoundingBox::absolutize(), Common::BoundingBox::add(), Graphics::Aurora::Model::createBound(), Common::deg2rad(), Common::BoundingBox::empty(), Graphics::Aurora::Model::getNode(), Common::BoundingBox::getOrigin(), Common::BoundingBox::rotate(), Common::BoundingBox::scale(), and Common::BoundingBox::translate().
|
protected |
Definition at line 405 of file modelnode.cpp.
References _boundBox, _mesh, Common::BoundingBox::add(), Common::BoundingBox::clear(), createCenter(), Graphics::Aurora::ModelNode::Mesh::data, Graphics::VertexBuffer::getCount(), Graphics::Mesh::Mesh::getVertexBuffer(), Graphics::VertexBuffer::getVertexDecl(), Graphics::Aurora::ModelNode::MeshData::rawMesh, and Graphics::VPOSITION.
Referenced by Graphics::Aurora::ModelNode_Jade::createMesh(), Graphics::Aurora::ModelNode_DragonAge::load(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Graphics::Aurora::ModelNode_NWN_ASCII::processMesh(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), and Graphics::Aurora::ModelNode_Witcher::readTexturePaint().
|
protected |
Definition at line 435 of file modelnode.cpp.
References _boundBox, _center, Common::BoundingBox::getMax(), and Common::BoundingBox::getMin().
Referenced by createBound().
|
protected |
Definition at line 791 of file modelnode.cpp.
References _children, _orientation, _render, _scale, and Common::deg2rad().
|
protected |
Definition at line 857 of file modelnode.cpp.
References _dirtyMesh, _mesh, _model, _orientation, _orientationBuffer, _orientationBuffered, _position, _positionBuffer, _positionBuffered, Graphics::Aurora::Model::_scale, _vertexCoordsBuffer, _vertexCoordsBuffered, Graphics::Aurora::ModelNode::Mesh::data, Graphics::VertexBuffer::getCount(), Graphics::VertexBuffer::getData(), Graphics::VertexBuffer::getSize(), Graphics::Mesh::Mesh::getVertexBuffer(), and Graphics::Aurora::ModelNode::MeshData::rawMesh.
|
private |
Definition at line 446 of file modelnode.cpp.
References _absoluteBoundBox.
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.
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.
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().
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().
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().
|
protected |
Definition at line 988 of file modelnode.cpp.
References _mesh, _model, _name, Graphics::Aurora::ModelNode::Mesh::data, Graphics::Aurora::TextureHandle::empty(), Graphics::Aurora::ModelNode::MeshData::envMap, Graphics::Aurora::ModelNode::MeshData::envMapMode, getEnvironmentMap(), and Graphics::Aurora::Model::getNode().
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), and getEnvironmentMap().
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().
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().
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().
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().
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.
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().
const ModelNode * Graphics::Aurora::ModelNode::getParent | ( | ) | const |
void Graphics::Aurora::ModelNode::getPosition | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
Get the position of the node.
Definition at line 181 of file modelnode.cpp.
References _model, _position, and Graphics::Aurora::Model::_scale.
Referenced by Engines::NWN::CharAppearance::adjustButtons(), Engines::NWN::CharPortrait::CharPortrait(), Engines::NWN::WidgetListBox::createScrollbar(), Engines::KotOR2::Creature::getCameraHeight(), Engines::KotOR::Creature::getCameraHeight(), Engines::NWN::WidgetListBox::getProperties(), move(), Engines::NWN::WidgetEditBox::setTitle(), and Engines::NWN::CharDomain::updateChosenDomains().
void Graphics::Aurora::ModelNode::getRotation | ( | float & | x, |
float & | y, | ||
float & | z | ||
) | const |
|
inline |
Definition at line 124 of file modelnode.h.
References _scale.
|
inline |
Definition at line 125 of file modelnode.h.
References _scale.
|
inline |
Definition at line 126 of file modelnode.h.
References _scale.
|
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().
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().
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().
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().
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().
|
protected |
Definition at line 340 of file modelnode.cpp.
References _dirtyRender, _mesh, _render, Graphics::Aurora::ModelNode::Mesh::data, Common::UString::empty(), Graphics::Aurora::ModelNode::MeshData::envMap, Common::exceptionDispatcherWarning(), Graphics::Aurora::ModelNode::Mesh::hasTransparencyHint, Graphics::Aurora::ModelNode::Mesh::isTransparent, TextureMan, Graphics::Aurora::ModelNode::MeshData::textures, Graphics::Aurora::ModelNode::Mesh::transparencyHint, and Common::UString::trim().
Referenced by Graphics::Aurora::ModelNode_Jade::createMesh(), Graphics::Aurora::ModelNode_DragonAge::fixTexturesAlpha(), Graphics::Aurora::ModelNode_DragonAge::fixTexturesHair(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Graphics::Aurora::ModelNode_DragonAge::loadTextures(), Graphics::Aurora::ModelNode_NWN_ASCII::processMesh(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), Graphics::Aurora::ModelNode_Witcher::readTexturePaint(), and setTextures().
|
protected |
Definition at line 826 of file modelnode.cpp.
References _model, and Graphics::Renderable::lockFrame().
|
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().
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().
|
private |
Definition at line 528 of file modelnode.cpp.
References _children, and Graphics::Aurora::nodeComp().
Referenced by setPosition().
|
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.
Definition at line 750 of file modelnode.cpp.
References _attachedModel, _children, _dirtyRender, _renderableArray, _renderTransform, _rootStateNode, buildMaterial(), calcRenderTransform(), getAlpha(), Graphics::Aurora::Model::queueRender(), and RenderMan.
|
protected |
Definition at line 640 of file modelnode.cpp.
References _attachedModel, _children, _dirtyMesh, _mesh, _model, _name, _orientation, _position, _render, _rotation, _scale, Graphics::Aurora::ModelNode::Mesh::data, Common::UString::empty(), Graphics::Aurora::Model::getNode(), Graphics::Aurora::Model::getState(), Graphics::Mesh::Mesh::getVertexBuffer(), Graphics::Aurora::ModelNode::Mesh::isTransparent, Graphics::kRenderPassOpaque, Graphics::kRenderPassTransparent, pass, Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Aurora::Model::render(), renderableMesh(), renderGeometry(), and Graphics::VertexBuffer::updateGL().
|
staticprivate |
Definition at line 636 of file modelnode.cpp.
References Graphics::Aurora::ModelNode::Mesh::data, and Graphics::Aurora::ModelNode::MeshData::rawMesh.
Referenced by render().
|
staticprivate |
Definition at line 536 of file modelnode.cpp.
References renderGeometryNormal().
Referenced by render().
|
staticprivate |
Definition at line 587 of file modelnode.cpp.
References Graphics::Aurora::ModelNode::Mesh::data, Graphics::Aurora::ModelNode::MeshData::envMap, Graphics::Aurora::TextureManager::kModeDiffuse, Graphics::Aurora::TextureManager::kModeEnvironmentMapReflective, Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Mesh::Mesh::render(), Graphics::Mesh::Mesh::renderBind(), Graphics::Mesh::Mesh::renderUnbind(), TextureMan, and Graphics::Aurora::ModelNode::MeshData::textures.
|
staticprivate |
Definition at line 560 of file modelnode.cpp.
References Graphics::Aurora::ModelNode::Mesh::data, Graphics::Aurora::ModelNode::MeshData::envMap, Graphics::Aurora::TextureManager::kModeDiffuse, Graphics::Aurora::TextureManager::kModeEnvironmentMapReflective, Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Mesh::Mesh::render(), Graphics::Mesh::Mesh::renderBind(), Graphics::Mesh::Mesh::renderUnbind(), TextureMan, and Graphics::Aurora::ModelNode::MeshData::textures.
|
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().
|
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.
Definition at line 709 of file modelnode.cpp.
References _attachedModel, _children, _dirtyRender, _renderableArray, _renderTransform, _rootStateNode, buildMaterial(), calcRenderTransform(), getAlpha(), and Graphics::Aurora::Model::renderImmediate().
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().
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.
|
protected |
Definition at line 849 of file modelnode.cpp.
References _orientationBuffer, and _orientationBuffered.
Referenced by Graphics::Aurora::Animation::interpolateOrientation().
|
protected |
Definition at line 842 of file modelnode.cpp.
References _positionBuffer, and _positionBuffered.
Referenced by Graphics::Aurora::Animation::interpolatePosition().
void Graphics::Aurora::ModelNode::setEnvironmentMap | ( | const Common::UString & | environmentMap = "" | ) |
Change the environment map on this model node.
Definition at line 275 of file modelnode.cpp.
References _attachedModel, _dirtyRender, _mesh, Graphics::Aurora::TextureHandle::clear(), Graphics::Aurora::ModelNode::Mesh::data, Common::UString::empty(), Graphics::Aurora::ModelNode::MeshData::envMap, Graphics::Aurora::Model::setEnvironmentMap(), and TextureMan.
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().
|
protected |
Definition at line 311 of file modelnode.cpp.
References _material, _shaderRenderable, and Graphics::Shader::ShaderRenderable::setMaterial().
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().
void Graphics::Aurora::ModelNode::setParent | ( | ModelNode * | parent | ) |
Set the node's parent.
Definition at line 143 of file modelnode.cpp.
References _children, _level, and _parent.
Referenced by Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_NWN_Binary::load(), Graphics::Aurora::ModelNode_NWN_ASCII::load(), Graphics::Aurora::ModelNode_Sonic::load(), and Graphics::Aurora::ModelNode_DragonAge::readChildren().
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().
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().
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().
|
protected |
Definition at line 830 of file modelnode.cpp.
References _model, and Graphics::Renderable::unlockFrame().
|
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().
|
friend |
Definition at line 325 of file modelnode.h.
|
friend |
Definition at line 326 of file modelnode.h.
|
friend |
Definition at line 324 of file modelnode.h.
|
protected |
Definition at line 243 of file modelnode.h.
Referenced by createAbsoluteBound(), and getAbsoluteBound().
|
protected |
Position of the node after translate/rotate.
Definition at line 232 of file modelnode.h.
Referenced by createAbsoluteBound(), and getAbsolutePosition().
|
protected |
Absolute transformation matrix used for animations.
Definition at line 248 of file modelnode.h.
Referenced by computeAbsoluteTransform().
|
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().
|
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().
|
protected |
Definition at line 242 of file modelnode.h.
Referenced by createAbsoluteBound(), createBound(), createCenter(), getDepth(), getHeight(), and getWidth().
|
protected |
|
protected |
The node's children.
Definition at line 210 of file modelnode.h.
Referenced by createAbsoluteBound(), drawSkeleton(), getChildren(), orderChildren(), queueRender(), render(), renderImmediate(), setAlpha(), and setParent().
|
protected |
Mesh data needs updating.
Definition at line 237 of file modelnode.h.
Referenced by flushBuffers(), and render().
|
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().
|
protected |
Inverse bind pose matrix used for animations.
Definition at line 247 of file modelnode.h.
Referenced by computeInverseBindPose(), and Graphics::Aurora::Animation::updateSkinnedModel().
|
protected |
Definition at line 214 of file modelnode.h.
Referenced by setParent().
|
protected |
Definition at line 259 of file modelnode.h.
Referenced by setMaterial().
|
protected |
Definition at line 239 of file modelnode.h.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), createBound(), Graphics::Aurora::ModelNode_DragonAge::createIndexBuffer(), Graphics::Aurora::ModelNode_Jade::createMesh(), Graphics::Aurora::ModelNode_NWN2::createTint(), Graphics::Aurora::ModelNode_DragonAge::createVertexBuffer(), flushBuffers(), getAlpha(), getEnvironmentMap(), getMesh(), getTextures(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_DragonAge::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_NWN_ASCII::load(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), loadTextures(), Graphics::Aurora::ModelNode_NWN_ASCII::processMesh(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), Graphics::Aurora::ModelNode_Jade::readMesh(), Graphics::Aurora::ModelNode_DragonAge::readMesh(), Graphics::Aurora::ModelNode_KotOR::readSkin(), Graphics::Aurora::ModelNode_Witcher::readTexturePaint(), Graphics::Aurora::ModelNode_NWN2::removeTint(), render(), setAlpha(), setEnvironmentMap(), setTextures(), Graphics::Aurora::ModelNode_NWN2::setTint(), Graphics::Aurora::Animation::updateSkinnedModel(), and ~ModelNode().
|
protected |
The model this node belongs to.
Definition at line 207 of file modelnode.h.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), Graphics::Aurora::ModelNode_NWN_Binary::checkDuplicateNode(), createAbsoluteBound(), flushBuffers(), getAbsolutePosition(), getDepth(), getEnvironmentMap(), getHeight(), getMesh(), getPosition(), getTextures(), getWidth(), isInFrontOf(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN_Binary::load(), Graphics::Aurora::ModelNode_Sonic::load(), lockFrame(), lockFrameIfVisible(), Graphics::Aurora::ModelNode_DragonAge::readChildren(), render(), setPosition(), Graphics::Aurora::ModelNode_Jade::unfoldFaces(), unlockFrame(), and unlockFrameIfVisible().
|
protected |
The node's name.
Definition at line 216 of file modelnode.h.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), createAbsoluteBound(), getEnvironmentMap(), getMesh(), getName(), getTextures(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_DragonAge::load(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN_Binary::load(), Graphics::Aurora::ModelNode_NWN_ASCII::load(), Graphics::Aurora::ModelNode_Sonic::load(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), render(), Graphics::Aurora::ModelNode_Jade::unfoldFaces(), and Graphics::Aurora::Animation::updateSkinnedModel().
|
protected |
Definition at line 245 of file modelnode.h.
Referenced by getNodeNumber(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN_Binary::load(), and Graphics::Aurora::Animation::update().
|
protected |
Orientation of the node.
Definition at line 223 of file modelnode.h.
Referenced by calcRenderTransform(), createAbsoluteBound(), drawSkeleton(), flushBuffers(), getOrientation(), inheritOrientation(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN_ASCII::load(), Graphics::Aurora::ModelNode_Sonic::load(), ModelNode(), Graphics::Aurora::ModelNode_Witcher::readNodeControllers(), Graphics::Aurora::ModelNode_NWN_Binary::readNodeControllers(), Graphics::Aurora::ModelNode_DragonAge::readTransformation(), render(), and setOrientation().
|
protected |
Definition at line 253 of file modelnode.h.
Referenced by computeAbsoluteTransform(), flushBuffers(), Graphics::Aurora::ModelNode_KotOR::load(), ModelNode(), Graphics::Aurora::ModelNode_NWN_Binary::readNodeControllers(), and setBufferedOrientation().
|
protected |
Definition at line 254 of file modelnode.h.
Referenced by flushBuffers(), and setBufferedOrientation().
|
protected |
Keyframes for orientation animation.
Definition at line 229 of file modelnode.h.
Referenced by computeInverseBindPose(), Graphics::Aurora::Animation::interpolateOrientation(), Graphics::Aurora::ModelNode_NWN_Binary::readNodeControllers(), Graphics::Aurora::ModelNode_KotOR::readOrientationController(), and Graphics::Aurora::Animation::update().
|
protected |
The node's parent.
Definition at line 209 of file modelnode.h.
Referenced by computeAbsoluteTransform(), computeInverseBindPose(), getParent(), setParent(), setPosition(), and Graphics::Aurora::Animation::updateSkinnedModel().
|
protected |
Position of the node.
Definition at line 221 of file modelnode.h.
Referenced by calcRenderTransform(), createAbsoluteBound(), flushBuffers(), getPosition(), inheritPosition(), isInFrontOf(), Graphics::Aurora::ModelNode_Jade::load(), Graphics::Aurora::ModelNode_KotOR::load(), Graphics::Aurora::ModelNode_NWN_ASCII::load(), Graphics::Aurora::ModelNode_Sonic::load(), ModelNode(), Graphics::Aurora::ModelNode_Witcher::readNodeControllers(), Graphics::Aurora::ModelNode_NWN_Binary::readNodeControllers(), Graphics::Aurora::ModelNode_DragonAge::readTransformation(), render(), and setPosition().
|
protected |
Definition at line 251 of file modelnode.h.
Referenced by computeAbsoluteTransform(), flushBuffers(), Graphics::Aurora::ModelNode_KotOR::load(), ModelNode(), Graphics::Aurora::ModelNode_NWN_Binary::readNodeControllers(), and setBufferedPosition().
|
protected |
Definition at line 252 of file modelnode.h.
Referenced by flushBuffers(), and setBufferedPosition().
|
protected |
Keyframes for position animation.
Definition at line 228 of file modelnode.h.
Referenced by computeInverseBindPose(), Graphics::Aurora::Animation::interpolatePosition(), Graphics::Aurora::ModelNode_NWN_Binary::readNodeControllers(), Graphics::Aurora::ModelNode_KotOR::readPositionController(), and Graphics::Aurora::Animation::update().
|
protected |
Render the node?
Definition at line 235 of file modelnode.h.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), Graphics::Aurora::ModelNode_Jade::createMesh(), drawSkeleton(), Graphics::Aurora::ModelNode_Witcher::load(), Graphics::Aurora::ModelNode_Sonic::load(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), loadTextures(), Graphics::Aurora::ModelNode_NWN_ASCII::processMesh(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), Graphics::Aurora::ModelNode_DragonAge::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readNodeControllers(), Graphics::Aurora::ModelNode_Witcher::readTexturePaint(), render(), setInvisible(), and setTextures().
|
protected |
Damn you bioware.
Definition at line 218 of file modelnode.h.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), queueRender(), and renderImmediate().
|
protected |
Definition at line 233 of file modelnode.h.
Referenced by calcRenderTransform(), queueRender(), and renderImmediate().
|
protected |
Definition at line 240 of file modelnode.h.
Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), buildMaterial(), queueRender(), and renderImmediate().
|
protected |
Node rotation.
Definition at line 222 of file modelnode.h.
Referenced by calcRenderTransform(), createAbsoluteBound(), getRotation(), ModelNode(), render(), rotate(), and setRotation().
|
protected |
Scale of the node.
Definition at line 224 of file modelnode.h.
Referenced by calcRenderTransform(), createAbsoluteBound(), drawSkeleton(), getScaleX(), getScaleY(), getScaleZ(), Graphics::Aurora::ModelNode_Sonic::load(), ModelNode(), and render().
|
protected |
Definition at line 260 of file modelnode.h.
Referenced by setMaterial().
|
protected |
Definition at line 255 of file modelnode.h.
Referenced by flushBuffers(), and Graphics::Aurora::Animation::updateSkinnedModel().
|
protected |
Definition at line 256 of file modelnode.h.
Referenced by flushBuffers(), and Graphics::Aurora::Animation::updateSkinnedModel().