My Project
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ParaEngine::CParaMeshXMLFile Class Reference

Para mesh XML file is a reference file for properly loading static mesh or parax mesh file. More...

#include <ParaMeshXMLFile.h>

Classes

class  CSubMesh
 sub LOD meshes. More...
 

Public Types

enum  ParaMeshXMLType { TYPE_MESH_LOD, TYPE_CHARACTER_LOD, TYPE_MESH_BSP, TYPE_MESH_GROUP }
 type of the mesh that this file represents. More...
 

Public Member Functions

bool LoadFromFile (const string &filename)
 load data from file to class data structure. More...
 
bool LoadFromFile (const string &filename, const string &parentDir)
 same as above, except that parent directory is specified. More...
 
bool LoadFromBuffer (const char *pData, int nSize)
 load data from file to class data structure. More...
 
void SetParentDirectory (const string &parentDir)
 set such as "model/", relative path will be appended with this one. More...
 
const string & GetParentDirectory ()
 get such as "model/", relative path will be appended with this one. More...
 
bool SaveToFile (const string &filename)
 save the content of this file to a given file. More...
 
ParaMeshXMLType GetType ()
 get the type of the mesh that this file represents. More...
 
int GetPrimaryShaderIndex ()
 see ParaEngine::TechniqueHandle. More...
 
int GetSubMeshCount ()
 get the number of sub meshes
 
CSubMeshGetSubMesh (int nIndex)
 get the sub mesh info at the given index. More...
 

Public Attributes

ParaMeshXMLType m_nType
 type of the mesh file. More...
 
int m_nPrimaryShader
 see ParaEngine::TechniqueHandle. More...
 
int m_nVersion
 file version
 
vector< CSubMeshm_SubMeshes
 sub meshes info. More...
 
string m_sParentDirectory
 such as "model/", relative path will be appended with this one. More...
 
bool m_bHasBoundingBox
 bounding box of the mesh: whether contains bounding box info
 
Vector3 m_vMinPos
 bounding box of the mesh: min point
 
Vector3 m_vMaxPos
 bounding box of the mesh: max point
 
CParameterBlock m_paramBlock
 effect parameter block with this asset. More...
 

Detailed Description

Para mesh XML file is a reference file for properly loading static mesh or parax mesh file.

It may contain LOD information, shader information (shader index is shader handle, params are all per asset effect parameters.), bounding box info, etc. sample ParaEngine mesh xml file: <mesh version="1" type="0"> <boundingbox minx="0" miny="0" minz="0" maxx="1" maxy="1" maxz="1/"> <shader index="3">

Parameters
0Texture/whitedot.dds
a10
b1
d0.1
e1,1
f1,1,1
g1,1,1
h1,0,0,0,1,0,0,0,1,0,0,0,

</shader> <submesh loddist="10" filename="LOD_10.x"> <submesh loddist="50" filename="LOD_50.x"> </mesh>

Member Enumeration Documentation

§ ParaMeshXMLType

type of the mesh that this file represents.

Member Function Documentation

§ GetParentDirectory()

const string& ParaEngine::CParaMeshXMLFile::GetParentDirectory ( )
inline

get such as "model/", relative path will be appended with this one.

§ GetPrimaryShaderIndex()

int ParaEngine::CParaMeshXMLFile::GetPrimaryShaderIndex ( )
inline

see ParaEngine::TechniqueHandle.

some common values are: -1: UNSPECIFIED. default from mesh. TECH_SIMPLE_MESH_NORMAL = 3 TECH_CHARACTER = 12

§ GetSubMesh()

CSubMesh* ParaEngine::CParaMeshXMLFile::GetSubMesh ( int  nIndex)
inline

get the sub mesh info at the given index.

§ GetType()

ParaMeshXMLType ParaEngine::CParaMeshXMLFile::GetType ( )
inline

get the type of the mesh that this file represents.

§ LoadFromBuffer()

bool ParaEngine::CParaMeshXMLFile::LoadFromBuffer ( const char *  pData,
int  nSize 
)

load data from file to class data structure.

sample ParaEngine mesh xml file <mesh version="1" type="0"> <boundingbox minx="0" miny="0" minz="0" maxx="1" maxy="1" maxz="1/"> <shader index="3/"> <submesh loddist="10" filename="LOD_10.x"> <submesh loddist="50" filename="LOD_50.x"> </mesh>

§ LoadFromFile() [1/2]

bool ParaEngine::CParaMeshXMLFile::LoadFromFile ( const string &  filename)

load data from file to class data structure.

Parent directory is automatically set to parent directory of filename.

§ LoadFromFile() [2/2]

bool ParaEngine::CParaMeshXMLFile::LoadFromFile ( const string &  filename,
const string &  parentDir 
)

same as above, except that parent directory is specified.

§ SaveToFile()

bool ParaEngine::CParaMeshXMLFile::SaveToFile ( const string &  filename)

save the content of this file to a given file.

Returns
false if failed.

§ SetParentDirectory()

void ParaEngine::CParaMeshXMLFile::SetParentDirectory ( const string &  parentDir)
inline

set such as "model/", relative path will be appended with this one.

Member Data Documentation

§ m_nPrimaryShader

int ParaEngine::CParaMeshXMLFile::m_nPrimaryShader

see ParaEngine::TechniqueHandle.

some common values are: -1: UNSPECIFIED. default from mesh. TECH_SIMPLE_MESH_NORMAL = 3 TECH_CHARACTER = 12

§ m_nType

ParaMeshXMLType ParaEngine::CParaMeshXMLFile::m_nType

type of the mesh file.

§ m_paramBlock

CParameterBlock ParaEngine::CParaMeshXMLFile::m_paramBlock

effect parameter block with this asset.

§ m_sParentDirectory

string ParaEngine::CParaMeshXMLFile::m_sParentDirectory

such as "model/", relative path will be appended with this one.

§ m_SubMeshes

vector<CSubMesh> ParaEngine::CParaMeshXMLFile::m_SubMeshes

sub meshes info.

Usually for different LOD information.


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