#include <3dsloader.hh>
Collaboration diagram for CLoad3DS:

Public Methods | |
| CLoad3DS () | |
| bool | import3DS (t3DModel *pModel, char *strFileName) |
Private Methods | |
| int | getString (char *) |
| void | readChunk (tChunk *) |
| void | processNextChunk (t3DModel *pModel, tChunk *) |
| void | processNextObjectChunk (t3DModel *pModel, t3DObject *pObject, tChunk *) |
| void | processNextMaterialChunk (t3DModel *pModel, tChunk *) |
| void | readColorChunk (tMaterialInfo *pMaterial, tChunk *pChunk) |
| void | readVertices (t3DObject *pObject, tChunk *) |
| void | readVertexIndices (t3DObject *pObject, tChunk *) |
| void | readUVCoordinates (t3DObject *pObject, tChunk *) |
| void | readObjectMaterial (t3DModel *pModel, t3DObject *pObject, tChunk *pPreviousChunk) |
| void | computeNormals (t3DModel *pModel) |
| void | cleanUp () |
Private Attributes | |
| FILE * | m_FilePointer |
| tChunk * | m_CurrentChunk |
| tChunk * | m_TempChunk |
|
|
This file handles all of the code needed to load a .3DS file. Basically, how it works is, you load a chunk, then you check the chunk ID. Depending on the chunk ID, you load the information that is stored in that chunk. If you do not want to read that information, you read past it. You know how many bytes to read past the chunk because every chunk stores the length in bytes of that chunk. Definition at line 18 of file 3dsloader.cc. References m_CurrentChunk, and m_TempChunk. |
|
|
This function cleans up our allocated memory and closes the file Definition at line 72 of file 3dsloader.cc. References m_CurrentChunk, m_FilePointer, and m_TempChunk. Referenced by import3DS(). |
|
|
This function computes the normals and vertex normals of the objects Definition at line 584 of file 3dsloader.cc. References addVector(), cross(), divideVectorByScaler(), anoid::simple::i(), anoid::simple::j(), normalize(), t3DObject::numOfFaces, t3DModel::numOfObjects, t3DObject::numOfVerts, t3DObject::pFaces, t3DObject::pNormals, t3DModel::pObject, t3DObject::pVerts, and Vector(). Referenced by import3DS(). |
|
|
This function reads in a string of characters Definition at line 345 of file 3dsloader.cc. References m_FilePointer. Referenced by processNextChunk(), and readObjectMaterial(). |
|
||||||||||||
|
Reads the 3DS file with the filename strFileName and returns true or false depending of successfull reading Definition at line 29 of file 3dsloader.cc. References cleanUp(), computeNormals(), tChunk::ID, m_CurrentChunk, m_FilePointer, PRIMARY, processNextChunk(), and readChunk(). |
|
||||||||||||
|
This function reads the main sections of the .3DS file, then dives deeper with recursion Definition at line 83 of file 3dsloader.cc. References tChunk::bytesRead, EDITKEYFRAME, getString(), tChunk::ID, tChunk::length, m_CurrentChunk, m_FilePointer, m_TempChunk, MATERIAL, t3DModel::numOfMaterials, t3DModel::numOfObjects, OBJECT, OBJECTINFO, t3DModel::pMaterials, t3DModel::pObject, processNextMaterialChunk(), processNextObjectChunk(), readChunk(), VERSION, and anoid::main::version. Referenced by import3DS(). |
|
||||||||||||
|
This function handles all the information about the material (Texture) Definition at line 272 of file 3dsloader.cc. References tChunk::bytesRead, tChunk::ID, tChunk::length, m_CurrentChunk, m_FilePointer, MATDIFFUSE, MATMAP, MATMAPFILE, MATNAME, t3DModel::numOfMaterials, t3DModel::pMaterials, readChunk(), and readColorChunk(). Referenced by processNextChunk(). |
|
||||||||||||||||
|
This function handles all the information about the objects in the file Definition at line 204 of file 3dsloader.cc. References tChunk::bytesRead, tChunk::ID, tChunk::length, m_CurrentChunk, m_FilePointer, OBJECT_FACES, OBJECT_MATERIAL, OBJECT_MESH, OBJECT_UV, OBJECT_VERTICES, readChunk(), readObjectMaterial(), readUVCoordinates(), readVertexIndices(), and readVertices(). Referenced by processNextChunk(). |
|
|
reads the chunk ID and its length in bytes Definition at line 330 of file 3dsloader.cc. References tChunk::bytesRead, tChunk::ID, tChunk::length, and m_FilePointer. Referenced by import3DS(), processNextChunk(), processNextMaterialChunk(), processNextObjectChunk(), and readColorChunk(). |
|
||||||||||||
|
This function reads in the RGB color data Definition at line 368 of file 3dsloader.cc. References tChunk::bytesRead, tMaterialInfo::color, tChunk::length, m_FilePointer, m_TempChunk, and readChunk(). Referenced by processNextMaterialChunk(). |
|
||||||||||||||||
|
This function reads in the material name assigned to the object and sets the materialID Definition at line 462 of file 3dsloader.cc. References t3DObject::bHasTexture, tChunk::bytesRead, getString(), anoid::simple::i(), tChunk::length, m_FilePointer, t3DObject::materialID, t3DModel::numOfMaterials, and t3DModel::pMaterials. Referenced by processNextObjectChunk(). |
|
||||||||||||
|
This function reads in the UV coordinates for the object Definition at line 423 of file 3dsloader.cc. References tChunk::bytesRead, tChunk::length, m_FilePointer, t3DObject::numTexVertex, and t3DObject::pTexVerts. Referenced by processNextObjectChunk(). |
|
||||||||||||
|
This function reads in the indices for the vertex array Definition at line 384 of file 3dsloader.cc. References tChunk::bytesRead, anoid::simple::i(), anoid::simple::j(), m_FilePointer, t3DObject::numOfFaces, and t3DObject::pFaces. Referenced by processNextObjectChunk(). |
|
||||||||||||
|
This function reads in the vertices for the object Definition at line 441 of file 3dsloader.cc. References tChunk::bytesRead, tChunk::length, m_FilePointer, t3DObject::numOfVerts, and t3DObject::pVerts. Referenced by processNextObjectChunk(). |
|
|
Definition at line 97 of file 3dsloader.hh. Referenced by cleanUp(), CLoad3DS(), import3DS(), processNextChunk(), processNextMaterialChunk(), and processNextObjectChunk(). |
|
|
Definition at line 94 of file 3dsloader.hh. Referenced by cleanUp(), getString(), import3DS(), processNextChunk(), processNextMaterialChunk(), processNextObjectChunk(), readChunk(), readColorChunk(), readObjectMaterial(), readUVCoordinates(), readVertexIndices(), and readVertices(). |
|
|
Definition at line 98 of file 3dsloader.hh. Referenced by cleanUp(), CLoad3DS(), processNextChunk(), and readColorChunk(). |