xoreos  0.0.5
Public Member Functions | Private Member Functions | List of all members
Graphics::Aurora::ModelNode_KotOR Class Reference

#include <model_kotor.h>

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

Public Member Functions

 ModelNode_KotOR (Model &model)
 
 ~ModelNode_KotOR ()
 
void load (Model_KotOR::ParserContext &ctx)
 
void buildMaterial ()
 
- Public Member Functions inherited from Graphics::Aurora::ModelNode
 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
 

Private Member Functions

void readNodeControllers (Model_KotOR::ParserContext &ctx, uint32 offset, uint32 count, std::vector< float > &dataFloat, std::vector< uint32 > &dataInt)
 
void readPositionController (uint8 columnCount, uint16 rowCount, uint16 timeIndex, uint16 dataIndex, std::vector< float > &data)
 
void readOrientationController (uint8 columnCount, uint16 rowCount, uint16 timeIndex, uint16 dataIndex, std::vector< float > &dataFloat, std::vector< uint32 > &dataInt)
 
void readMesh (Model_KotOR::ParserContext &ctx)
 
void readSkin (Model_KotOR::ParserContext &ctx)
 

Additional Inherited Members

- Public Types inherited from Graphics::Aurora::ModelNode
enum  EnvironmentMapMode { kModeEnvironmentBlendedUnder, kModeEnvironmentBlendedOver }
 The way the environment map is applied to a model node. More...
 
- Protected Member Functions inherited from Graphics::Aurora::ModelNode
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)
 
- Protected Attributes inherited from Graphics::Aurora::ModelNode
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
 

Detailed Description

Definition at line 98 of file model_kotor.h.

Constructor & Destructor Documentation

◆ ModelNode_KotOR()

Graphics::Aurora::ModelNode_KotOR::ModelNode_KotOR ( Model model)

Definition at line 416 of file model_kotor.cpp.

Referenced by load().

Here is the caller graph for this function:

◆ ~ModelNode_KotOR()

Graphics::Aurora::ModelNode_KotOR::~ModelNode_KotOR ( )

Definition at line 420 of file model_kotor.cpp.

Member Function Documentation

◆ buildMaterial()

void Graphics::Aurora::ModelNode_KotOR::buildMaterial ( )
virtual

Reimplemented from Graphics::Aurora::ModelNode.

Definition at line 610 of file model_kotor.cpp.

References Graphics::Aurora::ModelNode::buildMaterial().

Referenced by load().

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

◆ load()

void Graphics::Aurora::ModelNode_KotOR::load ( Model_KotOR::ParserContext ctx)

Because meshes need to be unique right now, at least until animation can use vertex shaders instead of vertex data duplication, need to generate a unique name for the mesh and add it to the mesh manager. This is important; the mesh manager is responsible for later deleting it.

Definition at line 423 of file model_kotor.cpp.

References Graphics::Aurora::ModelNode::_mesh, Graphics::Aurora::ModelNode::_model, Graphics::Aurora::ModelNode::_name, Graphics::Aurora::ModelNode::_nodeNumber, Graphics::Aurora::ModelNode::_orientation, Graphics::Aurora::ModelNode::_orientationBuffer, Graphics::Aurora::ModelNode::_position, Graphics::Aurora::ModelNode::_positionBuffer, buildMaterial(), Graphics::Aurora::ModelNode::Mesh::data, Common::generateIDRandomString(), GfxMan, Graphics::Mesh::Mesh::init(), kNodeFlagHasAABB, kNodeFlagHasAnim, kNodeFlagHasDangly, kNodeFlagHasEmitter, kNodeFlagHasLight, kNodeFlagHasMesh, kNodeFlagHasReference, kNodeFlagHasSkin, load(), Graphics::Aurora::Model_KotOR::ParserContext::mdl, Graphics::Aurora::Model_KotOR::ParserContext::mdlName, MeshMan, ModelNode_KotOR(), Graphics::Aurora::Model_KotOR::ParserContext::names, Graphics::Aurora::Model_KotOR::ParserContext::nodes, Graphics::Aurora::Model_KotOR::ParserContext::offModelData, Common::rad2deg(), Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Aurora::Model::readArray(), Graphics::Aurora::Model::readArrayDef(), Common::ReadStream::readIEEEFloatLE(), readMesh(), readNodeControllers(), readSkin(), Common::ReadStream::readUint16LE(), Common::SeekableReadStream::seek(), Graphics::Mesh::Mesh::setName(), Graphics::Aurora::ModelNode::setParent(), Graphics::Aurora::Model::setSkinned(), Common::SeekableReadStream::skip(), and Graphics::Aurora::Model_KotOR::ParserContext::state.

Referenced by Graphics::Aurora::Model_KotOR::load(), load(), and Graphics::Aurora::Model_KotOR::readAnim().

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

◆ readMesh()

void Graphics::Aurora::ModelNode_KotOR::readMesh ( Model_KotOR::ParserContext ctx)
private

Definition at line 681 of file model_kotor.cpp.

References Graphics::Aurora::ModelNode::_mesh, Graphics::Aurora::ModelNode::_render, Graphics::Aurora::ModelNode::Mesh::ambient, Graphics::Aurora::ModelNode::createBound(), Graphics::Aurora::ModelNode::Mesh::data, Graphics::Aurora::ModelNode::Mesh::diffuse, Common::UString::empty(), Graphics::Aurora::ModelNode::MeshData::envMapMode, Graphics::IndexBuffer::getData(), Graphics::VertexBuffer::getData(), Graphics::Mesh::Mesh::getIndexBuffer(), Graphics::Mesh::Mesh::getVertexBuffer(), Graphics::Aurora::ModelNode::Mesh::hasTransparencyHint, Graphics::Aurora::ModelNode::MeshData::initialVertexCoords, Common::kEncodingASCII, Graphics::Aurora::ModelNode::kModeEnvironmentBlendedOver, Graphics::Aurora::Model_KotOR::ParserContext::kotor2, Graphics::Aurora::ModelNode::loadTextures(), Graphics::Aurora::Model_KotOR::ParserContext::mdl, Graphics::Aurora::Model_KotOR::ParserContext::mdx, Graphics::Aurora::Model_KotOR::ParserContext::mdxStructSize, Graphics::Aurora::Model_KotOR::ParserContext::offModelData, Graphics::Aurora::Model_KotOR::ParserContext::offNodeData, Common::P, Common::SeekableReadStream::pos(), Graphics::Aurora::ModelNode::MeshData::rawMesh, Graphics::Aurora::Model::readArrayDef(), Common::ReadStream::readByte(), Common::ReadStream::readIEEEFloatLE(), Common::readStringFixed(), Common::ReadStream::readUint16LE(), Common::ReadStream::readUint32LE(), Graphics::Aurora::ModelNode::Mesh::render, Common::SeekableReadStream::seek(), Graphics::IndexBuffer::setSize(), Graphics::VertexBuffer::setVertexDeclInterleave(), Graphics::Aurora::ModelNode::Mesh::shadow, Common::SeekableReadStream::skip(), Graphics::Aurora::ModelNode::Mesh::specular, Graphics::Aurora::Model_KotOR::ParserContext::texture, Graphics::Aurora::ModelNode::Mesh::transparencyHint, Graphics::Aurora::Model_KotOR::ParserContext::vertexCount, Graphics::VNORMAL, Graphics::VPOSITION, Graphics::VTCOORD, and warning().

Referenced by load().

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

◆ readNodeControllers()

void Graphics::Aurora::ModelNode_KotOR::readNodeControllers ( Model_KotOR::ParserContext ctx,
uint32  offset,
uint32  count,
std::vector< float > &  dataFloat,
std::vector< uint32 > &  dataInt 
)
private

◆ readOrientationController()

void Graphics::Aurora::ModelNode_KotOR::readOrientationController ( uint8  columnCount,
uint16  rowCount,
uint16  timeIndex,
uint16  dataIndex,
std::vector< float > &  dataFloat,
std::vector< uint32 > &  dataInt 
)
private

◆ readPositionController()

void Graphics::Aurora::ModelNode_KotOR::readPositionController ( uint8  columnCount,
uint16  rowCount,
uint16  timeIndex,
uint16  dataIndex,
std::vector< float > &  data 
)
private

◆ readSkin()

void Graphics::Aurora::ModelNode_KotOR::readSkin ( Model_KotOR::ParserContext ctx)
private

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