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

#include <model_jade.h>

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

Classes

struct  JadeMaterialData
 

Public Member Functions

 ModelNode_Jade (Model &model)
 
 ~ModelNode_Jade ()
 
void load (Model_Jade::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 readMesh (Model_Jade::ParserContext &ctx)
 
void readPlainIndices (Common::SeekableReadStream &stream, std::vector< uint16 > &indices, uint32 offset, uint32 count)
 
void readChunkedIndices (Common::SeekableReadStream &stream, std::vector< uint16 > &indices, uint32 offset, uint32 count)
 
void unfoldFaces (std::vector< uint16 > &indices, uint32 meshType)
 Unfolds triangle strips / fans into triangle lists. More...
 
void unfoldTriangleStrip (std::vector< uint16 > &indices)
 
void unfoldTriangleFan (std::vector< uint16 > &indices)
 
void createMesh (Model_Jade::ParserContext &ctx)
 
void readMaterialTextures (uint32 materialID, std::vector< Common::UString > &textures)
 Opens the resource for the materialID and parses it to return the 4 normal textures. More...
 

Private Attributes

JadeMaterialData _jadeMaterialData
 

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_jade.h.

Constructor & Destructor Documentation

◆ ModelNode_Jade()

Graphics::Aurora::ModelNode_Jade::ModelNode_Jade ( Model model)

Definition at line 296 of file model_jade.cpp.

Referenced by load().

Here is the caller graph for this function:

◆ ~ModelNode_Jade()

Graphics::Aurora::ModelNode_Jade::~ModelNode_Jade ( )

Definition at line 299 of file model_jade.cpp.

Member Function Documentation

◆ buildMaterial()

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

Reimplemented from Graphics::Aurora::ModelNode.

Definition at line 386 of file model_jade.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:

◆ createMesh()

void Graphics::Aurora::ModelNode_Jade::createMesh ( Model_Jade::ParserContext ctx)
private

◆ load()

void Graphics::Aurora::ModelNode_Jade::load ( Model_Jade::ParserContext ctx)

◆ readChunkedIndices()

void Graphics::Aurora::ModelNode_Jade::readChunkedIndices ( Common::SeekableReadStream stream,
std::vector< uint16 > &  indices,
uint32  offset,
uint32  count 
)
private

Definition at line 556 of file model_jade.cpp.

References MIN(), Common::SeekableReadStream::pos(), Common::ReadStream::readUint16LE(), Common::ReadStream::readUint32LE(), Common::SeekableReadStream::seek(), and Common::SeekableReadStream::skip().

Referenced by readMesh().

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

◆ readMaterialTextures()

void Graphics::Aurora::ModelNode_Jade::readMaterialTextures ( uint32  materialID,
std::vector< Common::UString > &  textures 
)
private

Opens the resource for the materialID and parses it to return the 4 normal textures.

TODO: Proper material support.

Definition at line 702 of file model_jade.cpp.

References _jadeMaterialData, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::ambientColor, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::blending1, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::blending2, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::bumpCoordMultiplier, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::bumpMapIsSpecular, Common::UString::c_str(), Graphics::Aurora::ModelNode_Jade::JadeMaterialData::cubeMultiplier, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::diffuseColor, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::doubleSided, Common::exceptionDispatcherWarning(), Graphics::Aurora::ModelNode_Jade::JadeMaterialData::falloff, Common::UString::format(), Common::kEncodingASCII, Aurora::kFileTypeMAB, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::opacity1, Graphics::Aurora::ModelNode_Jade::JadeMaterialData::opacity2, Common::ReadStream::readByte(), Common::ReadStream::readIEEEFloatLE(), Common::readStringFixed(), Common::ReadStream::readUint32LE(), Graphics::Aurora::ModelNode_Jade::JadeMaterialData::renderPathID, ResMan, Common::SeekableReadStream::skip(), Graphics::Aurora::ModelNode_Jade::JadeMaterialData::terrainCoordMultiplier, and Graphics::Aurora::ModelNode_Jade::JadeMaterialData::waterAlpha.

Referenced by readMesh().

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

◆ readMesh()

void Graphics::Aurora::ModelNode_Jade::readMesh ( Model_Jade::ParserContext ctx)
private

◆ readPlainIndices()

void Graphics::Aurora::ModelNode_Jade::readPlainIndices ( Common::SeekableReadStream stream,
std::vector< uint16 > &  indices,
uint32  offset,
uint32  count 
)
private

Definition at line 542 of file model_jade.cpp.

References Common::SeekableReadStream::pos(), Common::ReadStream::readUint16LE(), and Common::SeekableReadStream::seek().

Referenced by readMesh().

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

◆ unfoldFaces()

void Graphics::Aurora::ModelNode_Jade::unfoldFaces ( std::vector< uint16 > &  indices,
uint32  meshType 
)
private

Unfolds triangle strips / fans into triangle lists.

Definition at line 586 of file model_jade.cpp.

References Graphics::Aurora::ModelNode::_model, Graphics::Aurora::ModelNode::_name, Common::UString::c_str(), Graphics::Aurora::Model::getName(), unfoldTriangleFan(), unfoldTriangleStrip(), and warning().

Referenced by readMesh().

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

◆ unfoldTriangleFan()

void Graphics::Aurora::ModelNode_Jade::unfoldTriangleFan ( std::vector< uint16 > &  indices)
private

Definition at line 635 of file model_jade.cpp.

Referenced by unfoldFaces().

Here is the caller graph for this function:

◆ unfoldTriangleStrip()

void Graphics::Aurora::ModelNode_Jade::unfoldTriangleStrip ( std::vector< uint16 > &  indices)
private

Definition at line 611 of file model_jade.cpp.

Referenced by unfoldFaces().

Here is the caller graph for this function:

Member Data Documentation

◆ _jadeMaterialData

JadeMaterialData Graphics::Aurora::ModelNode_Jade::_jadeMaterialData
private

Definition at line 144 of file model_jade.h.

Referenced by readMaterialTextures().


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