Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Loads a Wavefront OBJ file. More...
#include <ioOBJ.hpp>
Public Member Functions | |
const std::vector< fvec4 > & | vertexArray () const |
const std::vector< fvec3 > & | normalArray () const |
const std::vector< fvec3 > & | texCoordsArray () const |
const std::map< std::string, ref< ObjMaterial > > & | materials () const |
const std::vector< ref < ObjMesh > > & | meshes () const |
std::vector< fvec4 > & | vertexArray () |
std::vector< fvec3 > & | normalArray () |
std::vector< fvec3 > & | texCoordsArray () |
std::map< std::string, ref < ObjMaterial > > & | materials () |
std::vector< ref< ObjMesh > > & | meshes () |
ref< ResourceDatabase > | loadOBJ (VirtualFile *file) |
Loads a Wavefront OBJ file. | |
void | loadObjMaterials (VirtualFile *file, std::vector< ObjMaterial > &materials) |
Loads a Wavefront MTL file. | |
Protected Attributes | |
std::vector< fvec4 > | mCoords |
std::vector< fvec3 > | mNormals |
std::vector< fvec3 > | mTexCoords |
std::map< std::string, ref < ObjMaterial > > | mMaterials |
std::vector< ref< ObjMesh > > | mMeshes |
Loads a Wavefront OBJ file.
Definition at line 341 of file ioOBJ.hpp.
const std::vector<fvec4>& vl::ObjLoader::vertexArray | ( | ) | const [inline] |
const std::vector<fvec3>& vl::ObjLoader::normalArray | ( | ) | const [inline] |
const std::vector<fvec3>& vl::ObjLoader::texCoordsArray | ( | ) | const [inline] |
Definition at line 346 of file ioOBJ.hpp.
References mTexCoords.
const std::map< std::string, ref<ObjMaterial> >& vl::ObjLoader::materials | ( | ) | const [inline] |
Definition at line 347 of file ioOBJ.hpp.
References mMaterials.
std::vector<fvec4>& vl::ObjLoader::vertexArray | ( | ) | [inline] |
std::vector<fvec3>& vl::ObjLoader::normalArray | ( | ) | [inline] |
std::vector<fvec3>& vl::ObjLoader::texCoordsArray | ( | ) | [inline] |
Definition at line 352 of file ioOBJ.hpp.
References mTexCoords.
std::map< std::string, ref<ObjMaterial> >& vl::ObjLoader::materials | ( | ) | [inline] |
Definition at line 353 of file ioOBJ.hpp.
References mMaterials.
ref< ResourceDatabase > ObjLoader::loadOBJ | ( | VirtualFile * | file ) |
Loads a Wavefront OBJ file.
file | The OBJ file to be loaded |
Definition at line 303 of file ioOBJ.cpp.
References vl::defFileSystem(), vl::EN_ALPHA_TEST, vl::EN_BLEND, vl::EN_CULL_FACE, vl::EN_DEPTH_TEST, vl::EN_LIGHTING, vl::Log::error(), vl::String::extractPath(), vl::FU_GEQUAL, vl::ref< T >::get(), vl::IF_RGBA, vl::IT_UNSIGNED_BYTE, vl::loadImage(), loadObjMaterials(), vl::FileSystem::locateFile(), mCoords, mMaterials, mMeshes, mNormals, mTexCoords, NULL, vl::OM_ReadOnly, vl::VirtualFile::path(), vl::Log::print(), vl::PT_TRIANGLES, vl::TF_RGBA, vl::String::toStdString(), vl::TPF_LINEAR, vl::TPF_LINEAR_MIPMAP_LINEAR, vl::String::trim(), vl::String::trimStdString(), VL_CHECK, VL_TRAP, and vl::Log::warning().
Referenced by vl::loadOBJ().
void ObjLoader::loadObjMaterials | ( | VirtualFile * | file, |
std::vector< ObjMaterial > & | materials | ||
) |
Loads a Wavefront MTL file.
file | The MTL file to be loaded |
materials | Is filled with the loaded materials |
Definition at line 194 of file ioOBJ.cpp.
References vl::Vector3< T_Scalar >::b(), vl::String::empty(), vl::Log::error(), vl::String::field(), vl::Vector3< T_Scalar >::g(), vl::VirtualFile::path(), vl::Vector3< T_Scalar >::r(), vl::String::startsWith(), vl::String::toDouble(), vl::String::toFloat(), vl::String::toInt(), vl::String::toStdString(), and vl::String::trim().
Referenced by loadOBJ().
std::vector<fvec4> vl::ObjLoader::mCoords [protected] |
Definition at line 366 of file ioOBJ.hpp.
Referenced by loadOBJ(), and vertexArray().
std::vector<fvec3> vl::ObjLoader::mNormals [protected] |
Definition at line 367 of file ioOBJ.hpp.
Referenced by loadOBJ(), and normalArray().
std::vector<fvec3> vl::ObjLoader::mTexCoords [protected] |
Definition at line 368 of file ioOBJ.hpp.
Referenced by loadOBJ(), and texCoordsArray().
std::map< std::string, ref<ObjMaterial> > vl::ObjLoader::mMaterials [protected] |
Definition at line 369 of file ioOBJ.hpp.
Referenced by loadOBJ(), and materials().
std::vector< ref<ObjMesh> > vl::ObjLoader::mMeshes [protected] |