Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The A3DSLoader class loads an Autodesk 3DS file and generates a vector of A3DSObject and A3DSMaterial objects. More...
#include <io3DS.hpp>
Public Member Functions | |
A3DSLoader () | |
bool | parse3DS (VirtualFile *file) |
Public Attributes | |
std::vector< A3DSObject > | mObjects |
std::vector< A3DSMaterial > | mMaterials |
Protected Member Functions | |
fvec3 | readVec3 () |
fvec3 | readColByte3 () |
fvec3 | readColFloat3 () |
String | readLine () |
float | readWordPercent () |
float | readFloatPercent () |
void | readChunk () |
bool | skipChunk () |
void | read_3D_EDITOR_CHUNK () |
fvec3 | readColChunk () |
float | readPercentChunk () |
void | read_MATERIAL_BLOCK () |
A3DSTexture | readMapChunk () |
void | read_OBJECT_BLOCK () |
void | read_TRIANGULAR_MESH () |
Protected Attributes | |
VirtualFile * | mInputFile |
unsigned short | mChunkId |
unsigned int | mChunkLen |
bool | mCorrupted |
The A3DSLoader class loads an Autodesk 3DS file and generates a vector of A3DSObject and A3DSMaterial objects.
Definition at line 202 of file io3DS.hpp.
bool A3DSLoader::parse3DS | ( | VirtualFile * | file ) |
Definition at line 633 of file io3DS.cpp.
References vl::VirtualFile::close(), vl::VirtualFile::endOfFile(), vl::Log::error(), ID_3D_EDITOR_CHUNK, ID_3DS_VERSION, ID_MAIN_CHUNK, mChunkId, mCorrupted, mInputFile, vl::OM_ReadOnly, vl::VirtualFile::open(), vl::VirtualFile::path(), vl::Log::print(), read_3D_EDITOR_CHUNK(), readChunk(), vl::VirtualFile::readUInt32(), and skipChunk().
Referenced by vl::load3DS().
fvec3 A3DSLoader::readVec3 | ( | ) | [protected] |
Definition at line 109 of file io3DS.cpp.
References mInputFile, vl::VirtualFile::readFloat(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
Referenced by read_TRIANGULAR_MESH().
fvec3 A3DSLoader::readColByte3 | ( | ) | [protected] |
Definition at line 118 of file io3DS.cpp.
References vl::Vector3< T_Scalar >::b(), vl::Vector3< T_Scalar >::g(), mInputFile, vl::Vector3< T_Scalar >::r(), and vl::VirtualFile::readUInt8().
Referenced by readColChunk().
fvec3 A3DSLoader::readColFloat3 | ( | ) | [protected] |
Definition at line 127 of file io3DS.cpp.
References vl::Vector3< T_Scalar >::b(), vl::Vector3< T_Scalar >::g(), mInputFile, vl::Vector3< T_Scalar >::r(), and vl::VirtualFile::readFloat().
Referenced by readColChunk().
String A3DSLoader::readLine | ( | ) | [protected] |
Definition at line 136 of file io3DS.cpp.
References mInputFile, and vl::VirtualFile::readUInt8().
Referenced by read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), and readMapChunk().
float A3DSLoader::readWordPercent | ( | ) | [protected] |
Definition at line 148 of file io3DS.cpp.
References mInputFile, and vl::VirtualFile::readUInt16().
Referenced by readPercentChunk().
float A3DSLoader::readFloatPercent | ( | ) | [protected] |
Definition at line 153 of file io3DS.cpp.
References mInputFile, and vl::VirtualFile::readFloat().
Referenced by readPercentChunk().
void A3DSLoader::readChunk | ( | ) | [protected] |
Definition at line 158 of file io3DS.cpp.
References mChunkId, mChunkLen, mInputFile, vl::VirtualFile::readUInt16(), and vl::VirtualFile::readUInt32().
Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and readPercentChunk().
bool A3DSLoader::skipChunk | ( | ) | [protected] |
Definition at line 164 of file io3DS.cpp.
References vl::Log::error(), mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, and vl::VirtualFile::seekCur().
Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), and readMapChunk().
void A3DSLoader::read_3D_EDITOR_CHUNK | ( | ) | [protected] |
Definition at line 177 of file io3DS.cpp.
References vl::Log::error(), ID_MATERIAL_BLOCK, ID_OBJECT_BLOCK, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), readChunk(), vl::VirtualFile::size(), and skipChunk().
Referenced by parse3DS().
fvec3 A3DSLoader::readColChunk | ( | ) | [protected] |
Definition at line 209 of file io3DS.cpp.
References vl::Log::error(), ID_COLOR_24, ID_COLOR_F, ID_LIN_COLOR_24, ID_LIN_COLOR_F, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), readChunk(), readColByte3(), readColFloat3(), and vl::VirtualFile::size().
Referenced by read_MATERIAL_BLOCK().
float A3DSLoader::readPercentChunk | ( | ) | [protected] |
Definition at line 246 of file io3DS.cpp.
References ID_FLOAT_PERCENTAGE, ID_INT_PERCENTAGE, mChunkId, readChunk(), readFloatPercent(), and readWordPercent().
Referenced by read_MATERIAL_BLOCK().
void A3DSLoader::read_MATERIAL_BLOCK | ( | ) | [protected] |
Definition at line 263 of file io3DS.cpp.
References vl::Log::error(), ID_MAT_AMBIENT, ID_MAT_DIFFUSE, ID_MAT_SHININESS_PERCENT, ID_MAT_SHININESS_STRENGTH_PERCENT, ID_MAT_SPECULAR, ID_MAT_TEXMAP, ID_MAT_TEXMAP2, ID_MAT_TRANSPARENCY, ID_MAT_TWO_SIDE, ID_MATERIAL_NAME, vl::A3DSMaterial::mAmbient, mChunkId, mChunkLen, mCorrupted, vl::A3DSMaterial::mDiffuse, vl::A3DSMaterial::mDoubleSided, mInputFile, vl::A3DSMaterial::mMaterialName, mMaterials, mObjects, vl::A3DSMaterial::mShininess, vl::A3DSMaterial::mShininessStrength, vl::A3DSMaterial::mSpecular, vl::A3DSMaterial::mTexture1, vl::A3DSMaterial::mTexture2, vl::A3DSMaterial::mTransparency, vl::VirtualFile::position(), readChunk(), readColChunk(), readLine(), readMapChunk(), readPercentChunk(), vl::VirtualFile::size(), and skipChunk().
Referenced by read_3D_EDITOR_CHUNK().
A3DSTexture A3DSLoader::readMapChunk | ( | ) | [protected] |
Definition at line 353 of file io3DS.cpp.
References vl::defFileSystem(), vl::Log::error(), vl::String::extractPath(), ID_MAT_MAP_ROTATION, ID_MAT_MAP_TILING, ID_MAT_MAPNAME, ID_MAT_UOFFSET, ID_MAT_USCALE, ID_MAT_VOFFSET, ID_MAT_VSCALE, vl::FileSystem::locateFile(), mChunkId, mChunkLen, mCorrupted, vl::A3DSTexture::mFileName, mInputFile, mMaterials, mObjects, vl::A3DSTexture::mOpt_decal, vl::A3DSTexture::mOpt_ignore_alpha, vl::A3DSTexture::mOpt_mirror, vl::A3DSTexture::mOpt_negative, vl::A3DSTexture::mOpt_one_channel_tint, vl::A3DSTexture::mOpt_rgb_tint, vl::A3DSTexture::mOpt_summed_area, vl::A3DSTexture::mOpt_tile, vl::A3DSTexture::mOpt_use_alpha, vl::A3DSTexture::mRotation, vl::A3DSTexture::mUOffset, vl::A3DSTexture::mUScale, vl::A3DSTexture::mVOffset, vl::A3DSTexture::mVScale, vl::VirtualFile::path(), vl::VirtualFile::position(), readChunk(), vl::VirtualFile::readFloat(), readLine(), vl::VirtualFile::readUInt16(), vl::VirtualFile::size(), and skipChunk().
Referenced by read_MATERIAL_BLOCK().
void A3DSLoader::read_OBJECT_BLOCK | ( | ) | [protected] |
Definition at line 442 of file io3DS.cpp.
References vl::Log::error(), ID_TRIANGULAR_MESH, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), read_TRIANGULAR_MESH(), readChunk(), readLine(), vl::VirtualFile::size(), and skipChunk().
Referenced by read_3D_EDITOR_CHUNK().
void A3DSLoader::read_TRIANGULAR_MESH | ( | ) | [protected] |
Definition at line 478 of file io3DS.cpp.
References vl::Log::error(), ID_FACE_LIST, ID_FACE_MATERIAL_LIST, ID_LOCAL_COORDS_SYSTEM, ID_MAPPING_COORDS, ID_SMOOTHING_GROUP_LIST, ID_VERTEX_LIST, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), vl::VirtualFile::read(), readChunk(), vl::VirtualFile::readFloat(), readLine(), vl::VirtualFile::readUInt16(), vl::VirtualFile::readUInt32(), readVec3(), vl::Vector2< T_Scalar >::s(), vl::Matrix4< T_Scalar >::setT(), vl::Matrix4< T_Scalar >::setX(), vl::Matrix4< T_Scalar >::setY(), vl::Matrix4< T_Scalar >::setZ(), vl::VirtualFile::size(), skipChunk(), and vl::Vector2< T_Scalar >::t().
Referenced by read_OBJECT_BLOCK().
std::vector<A3DSObject> vl::A3DSLoader::mObjects |
Definition at line 226 of file io3DS.hpp.
Referenced by vl::load3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and skipChunk().
std::vector<A3DSMaterial> vl::A3DSLoader::mMaterials |
Definition at line 227 of file io3DS.hpp.
Referenced by vl::load3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and skipChunk().
VirtualFile* vl::A3DSLoader::mInputFile [protected] |
Definition at line 230 of file io3DS.hpp.
Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readChunk(), readColByte3(), readColChunk(), readColFloat3(), readFloatPercent(), readLine(), readMapChunk(), readVec3(), readWordPercent(), and skipChunk().
unsigned short vl::A3DSLoader::mChunkId [protected] |
Definition at line 231 of file io3DS.hpp.
Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readChunk(), readColChunk(), readMapChunk(), and readPercentChunk().
unsigned int vl::A3DSLoader::mChunkLen [protected] |
Definition at line 232 of file io3DS.hpp.
Referenced by read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readChunk(), readColChunk(), readMapChunk(), and skipChunk().
bool vl::A3DSLoader::mCorrupted [protected] |
Definition at line 233 of file io3DS.hpp.
Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and skipChunk().