xoreos  0.0.5
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | List of all members
Graphics::Aurora::ModelNode_DragonAge Class Reference

#include <model_dragonage.h>

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

Classes

struct  MaterialObject
 An internal material object. More...
 
struct  MeshDeclaration
 An internal mesh declaration part. More...
 

Public Member Functions

 ModelNode_DragonAge (Model &model)
 
 ~ModelNode_DragonAge ()
 
void load (Model_DragonAge::ParserContext &ctx, const ::Aurora::GFF4Struct &nodeGFF)
 
- 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 Types

enum  MeshDeclUse {
  kMeshDeclUsePosition = 0, kMeshDeclUseBlendWeight = 1, kMeshDeclUseBlendIndices = 2, kMeshDeclUseNormal = 3,
  kMeshDeclUsePSize = 4, kMeshDeclUseTexCoord = 5, kMeshDeclUseTangent = 6, kMeshDeclUseBinormal = 7,
  kMeshDeclUseTessFactor = 8, kMeshDeclUsePositionT = 9, kMeshDeclUseColor = 10, kMeshDeclUseFog = 11,
  kMeshDeclUseDepth = 12, kMeshDeclUseSample = 13, kMeshDeclUseUnused = 0xFFFFFFFF
}
 Usage information for a mesh declaration part. More...
 
enum  MeshDeclType {
  kMeshDeclTypeFloat32_1 = 0, kMeshDeclTypeFloat32_2 = 1, kMeshDeclTypeFloat32_3 = 2, kMeshDeclTypeFloat32_4 = 3,
  kMeshDeclTypeColor = 4, kMeshDeclTypeUint8_4 = 5, kMeshDeclTypeSint16_2 = 6, kMeshDeclTypeSint16_4 = 7,
  kMeshDeclTypeUint8_4n = 8, kMeshDeclTypeSint16_2n = 9, kMeshDeclTypeSint16_4n = 10, kMeshDeclTypeUint16_2n = 11,
  kMeshDeclTypeUint16_4n = 12, kMeshDeclType1010102 = 13, kMeshDeclType1010102n = 14, kMeshDeclTypeFloat16_2 = 15,
  kMeshDeclTypeFloat16_4 = 16, kMeshDeclTypeUnused = 0xFFFFFFFF
}
 Type information for a mesh declaration part. More...
 
typedef std::list< MeshDeclarationMeshDeclarations
 

Private Member Functions

void readTransformation (const ::Aurora::GFF4Struct &nodeGFF)
 
void readChildren (Model_DragonAge::ParserContext &ctx, const ::Aurora::GFF4Struct &nodeGFF)
 
void readMesh (Model_DragonAge::ParserContext &ctx, const ::Aurora::GFF4Struct &meshGFF)
 
void sanityCheckMeshChunk (const ::Aurora::GFF4Struct &meshChunk)
 
void readMeshDecl (const ::Aurora::GFF4Struct &meshChunk, MeshDeclarations &meshDecl)
 
void createIndexBuffer (const ::Aurora::GFF4Struct &meshChunk, Common::SeekableReadStream &indexData)
 
void createVertexBuffer (const ::Aurora::GFF4Struct &meshChunk, Common::SeekableReadStream &vertexData, const MeshDeclarations &meshDecl)
 
void readMAO (const Common::UString &materialName, MaterialObject &material)
 Read a material object MAO, which can be encoded in either XML or GFF. More...
 
void readMAOGFF (Common::SeekableReadStream *maoStream, MaterialObject &material)
 Read a MAO encoded in a GFF file. More...
 
void readMAOXML (Common::SeekableReadStream *maoStream, MaterialObject &material, const Common::UString &fileName)
 Read a MAO encoded in an XML file. More...
 
void loadTextures (const std::vector< Common::UString > &textures, const MaterialObject &material)
 
void fixTexturesAlpha (const std::vector< Common::UString > &textures)
 
void fixTexturesHair (const std::vector< Common::UString > &textures)
 

Static Private Member Functions

static void read2Float32 (Common::ReadStream &stream, MeshDeclType type, float *&f)
 
static void read3Float32 (Common::ReadStream &stream, MeshDeclType type, float *&f)
 
static void read4Float32 (Common::ReadStream &stream, MeshDeclType type, float *&f)
 

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)
 
virtual void buildMaterial ()
 
- 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 93 of file model_dragonage.h.

Member Typedef Documentation

◆ MeshDeclarations

Definition at line 157 of file model_dragonage.h.

Member Enumeration Documentation

◆ MeshDeclType

Type information for a mesh declaration part.

Enumerator
kMeshDeclTypeFloat32_1 

1 32-bit float.

kMeshDeclTypeFloat32_2 

2 32-bit floats.

kMeshDeclTypeFloat32_3 

3 32-bit floats.

kMeshDeclTypeFloat32_4 

4 32-bit floats.

kMeshDeclTypeColor 

4-byte color.

kMeshDeclTypeUint8_4 

4 unsigned 8-bit integers.

kMeshDeclTypeSint16_2 

2 signed 16-bit integers.

kMeshDeclTypeSint16_4 

4 signed 16-bit integers.

kMeshDeclTypeUint8_4n 

4 normalized unsigned 8-bit integers.

kMeshDeclTypeSint16_2n 

2 normalized signed 16-bit integers.

kMeshDeclTypeSint16_4n 

4 normalized signed 16-bit integers.

kMeshDeclTypeUint16_2n 

2 normalized unsigned 16-bit integers.

kMeshDeclTypeUint16_4n 

4 normalized unsigned 16-bit integers.

kMeshDeclType1010102 

4 normalized unsigned integers of 10-bit, 10-bit, 10-bit, 2-bit.

kMeshDeclType1010102n 

4 unsigned integers of 10-bit, 10-bit, 10-bit, 2-bit.

kMeshDeclTypeFloat16_2 

2 16-bit floats.

kMeshDeclTypeFloat16_4 

4 16-bit floats.

kMeshDeclTypeUnused 

Definition at line 122 of file model_dragonage.h.

◆ MeshDeclUse

Usage information for a mesh declaration part.

Enumerator
kMeshDeclUsePosition 

Position.

kMeshDeclUseBlendWeight 

Blend weights.

kMeshDeclUseBlendIndices 

Blend indices.

kMeshDeclUseNormal 

Normal.

kMeshDeclUsePSize 

Point Size.

kMeshDeclUseTexCoord 

Texture coordinates.

kMeshDeclUseTangent 

Tangent vector.

kMeshDeclUseBinormal 

Binormal vector.

kMeshDeclUseTessFactor 

Tessellation factor.

kMeshDeclUsePositionT 

PositionT.

kMeshDeclUseColor 

Color channel.

kMeshDeclUseFog 

Fog value.

kMeshDeclUseDepth 

Depth.

kMeshDeclUseSample 

Sample.

kMeshDeclUseUnused 

Definition at line 102 of file model_dragonage.h.

Constructor & Destructor Documentation

◆ ModelNode_DragonAge()

Graphics::Aurora::ModelNode_DragonAge::ModelNode_DragonAge ( Model model)

Definition at line 270 of file model_dragonage.cpp.

Referenced by readChildren().

Here is the caller graph for this function:

◆ ~ModelNode_DragonAge()

Graphics::Aurora::ModelNode_DragonAge::~ModelNode_DragonAge ( )

Definition at line 273 of file model_dragonage.cpp.

Member Function Documentation

◆ createIndexBuffer()

void Graphics::Aurora::ModelNode_DragonAge::createIndexBuffer ( const ::Aurora::GFF4Struct meshChunk,
Common::SeekableReadStream indexData 
)
private

◆ createVertexBuffer()

void Graphics::Aurora::ModelNode_DragonAge::createVertexBuffer ( const ::Aurora::GFF4Struct meshChunk,
Common::SeekableReadStream vertexData,
const MeshDeclarations meshDecl 
)
private

◆ fixTexturesAlpha()

void Graphics::Aurora::ModelNode_DragonAge::fixTexturesAlpha ( const std::vector< Common::UString > &  textures)
private

◆ fixTexturesHair()

void Graphics::Aurora::ModelNode_DragonAge::fixTexturesHair ( const std::vector< Common::UString > &  textures)
private

◆ load()

void Graphics::Aurora::ModelNode_DragonAge::load ( Model_DragonAge::ParserContext ctx,
const ::Aurora::GFF4Struct nodeGFF 
)

◆ loadTextures()

void Graphics::Aurora::ModelNode_DragonAge::loadTextures ( const std::vector< Common::UString > &  textures,
const MaterialObject material 
)
private

◆ read2Float32()

void Graphics::Aurora::ModelNode_DragonAge::read2Float32 ( Common::ReadStream stream,
MeshDeclType  type,
float *&  f 
)
staticprivate

◆ read3Float32()

void Graphics::Aurora::ModelNode_DragonAge::read3Float32 ( Common::ReadStream stream,
MeshDeclType  type,
float *&  f 
)
staticprivate

◆ read4Float32()

void Graphics::Aurora::ModelNode_DragonAge::read4Float32 ( Common::ReadStream stream,
MeshDeclType  type,
float *&  f 
)
staticprivate

◆ readChildren()

void Graphics::Aurora::ModelNode_DragonAge::readChildren ( Model_DragonAge::ParserContext ctx,
const ::Aurora::GFF4Struct nodeGFF 
)
private

◆ readMAO()

void Graphics::Aurora::ModelNode_DragonAge::readMAO ( const Common::UString materialName,
MaterialObject material 
)
private

Read a material object MAO, which can be encoded in either XML or GFF.

Definition at line 826 of file model_dragonage.cpp.

References Common::StackException::add(), Common::UString::c_str(), Common::debugTag(), Aurora::kFileTypeMAO, Graphics::Aurora::kGFFID, Graphics::Aurora::kXMLID, Aurora::AuroraFile::readHeaderID(), readMAOGFF(), readMAOXML(), ResMan, Common::SeekableReadStream::seek(), and TypeMan.

Referenced by readMesh().

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

◆ readMAOGFF()

void Graphics::Aurora::ModelNode_DragonAge::readMAOGFF ( Common::SeekableReadStream maoStream,
MaterialObject material 
)
private

◆ readMAOXML()

void Graphics::Aurora::ModelNode_DragonAge::readMAOXML ( Common::SeekableReadStream maoStream,
MaterialObject material,
const Common::UString fileName 
)
private

◆ readMesh()

void Graphics::Aurora::ModelNode_DragonAge::readMesh ( Model_DragonAge::ParserContext ctx,
const ::Aurora::GFF4Struct meshGFF 
)
private

◆ readMeshDecl()

void Graphics::Aurora::ModelNode_DragonAge::readMeshDecl ( const ::Aurora::GFF4Struct meshChunk,
MeshDeclarations meshDecl 
)
private

◆ readTransformation()

void Graphics::Aurora::ModelNode_DragonAge::readTransformation ( const ::Aurora::GFF4Struct nodeGFF)
private

◆ sanityCheckMeshChunk()

void Graphics::Aurora::ModelNode_DragonAge::sanityCheckMeshChunk ( const ::Aurora::GFF4Struct meshChunk)
private

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