mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Public Attributes | List of all members
ObjectLoader3ds Class Reference

Loads objects as meshes (i.e. triangle list) from 3ds files. More...

#include <ObjectLoader3ds.h>

Public Member Functions

 ObjectLoader3ds ()
 
 ~ObjectLoader3ds ()
 
bool LoadModel (const char *fileName)
 
void ReadSubChunk (FILE *fp, stChunk *pChunk)
 
void MoveToNextChunk (FILE *fp, stChunk *pChunk)
 
size_t GetNextString (FILE *fp, char *str)
 
void ReadChunk (FILE *fp, stChunk *pChunk)
 
void ReadMaterials (FILE *fp, stChunk *pChunk)
 
void ReadDiffuse (FILE *fp, stChunk *pChunk)
 
void ReadAmbient (FILE *fp, stChunk *pChunk)
 
void ReadSpecular (FILE *fp, stChunk *pChunk)
 
void ReadMeshMaterials (FILE *fp, stChunk *pChunk)
 
void ReadFaces (FILE *fp, stChunk *pChunk)
 
void ReadVertices (FILE *fp, stChunk *pChunk)
 Reads the list of vertices.
 
void ReadTexCoords (FILE *fp, stChunk *pChunk)
 Reads texture coordinates from a file. Everything else but textures is skipped.
 
void shutdown ()
 releases all created objects after all meshes have been loaded and processed.
 

Public Attributes

std::vector< stMeshmeshList
 
std::vector< stMaterialmaterialList
 
int totalMeshes
 
int totalMaterials
 

Detailed Description

Loads objects as meshes (i.e. triangle list) from 3ds files.

A loader that skips through the recoursively defined 3ds files. All unknown chunks are ignored, and only meshes are extracted. The meshes may contain texture coordinates and material information, such as color.

Definition at line 114 of file ObjectLoader3ds.h.

Constructor & Destructor Documentation

ObjectLoader3ds::ObjectLoader3ds ( )

Definition at line 14 of file ObjectLoader3ds.cpp.

ObjectLoader3ds::~ObjectLoader3ds ( )

Definition at line 18 of file ObjectLoader3ds.cpp.

Member Function Documentation

size_t ObjectLoader3ds::GetNextString ( FILE *  fp,
char *  str 
)

Definition at line 210 of file ObjectLoader3ds.cpp.

bool ObjectLoader3ds::LoadModel ( const char *  fileName)

Definition at line 22 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::MoveToNextChunk ( FILE *  fp,
stChunk pChunk 
)

Definition at line 202 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadAmbient ( FILE *  fp,
stChunk pChunk 
)

Definition at line 277 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadChunk ( FILE *  fp,
stChunk pChunk 
)

Definition at line 229 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadDiffuse ( FILE *  fp,
stChunk pChunk 
)

Definition at line 243 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadFaces ( FILE *  fp,
stChunk pChunk 
)

Definition at line 376 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadMaterials ( FILE *  fp,
stChunk pChunk 
)
void ObjectLoader3ds::ReadMeshMaterials ( FILE *  fp,
stChunk pChunk 
)

Definition at line 342 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadSpecular ( FILE *  fp,
stChunk pChunk 
)

Definition at line 311 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadSubChunk ( FILE *  fp,
stChunk pChunk 
)

Definition at line 80 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadTexCoords ( FILE *  fp,
stChunk pChunk 
)

Reads texture coordinates from a file. Everything else but textures is skipped.

Parameters
[in,out]fppointer to the file
[in,out]pChunkpointer to the current chunk

Definition at line 449 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::ReadVertices ( FILE *  fp,
stChunk pChunk 
)

Reads the list of vertices.

Parameters
[in,out]fppointer to the file
[in,out]pChunkpointer to the current chunk

Definition at line 418 of file ObjectLoader3ds.cpp.

void ObjectLoader3ds::shutdown ( )

releases all created objects after all meshes have been loaded and processed.

Definition at line 475 of file ObjectLoader3ds.cpp.

Member Data Documentation

std::vector<stMaterial> ObjectLoader3ds::materialList

Definition at line 144 of file ObjectLoader3ds.h.

std::vector<stMesh> ObjectLoader3ds::meshList

Definition at line 143 of file ObjectLoader3ds.h.

int ObjectLoader3ds::totalMaterials

Definition at line 146 of file ObjectLoader3ds.h.

int ObjectLoader3ds::totalMeshes

Definition at line 145 of file ObjectLoader3ds.h.


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