Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes | List of all members
vl::ObjLoader Class Reference

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< ResourceDatabaseloadOBJ (VirtualFile *file)
 Loads a Wavefront OBJ file. More...
 
void loadObjMaterials (VirtualFile *file, std::vector< ObjMaterial > &materials)
 Loads a Wavefront MTL file. More...
 

Protected Attributes

std::vector< fvec4mCoords
 
std::vector< fvec3mNormals
 
std::vector< fvec3mTexCoords
 
std::map< std::string, ref< ObjMaterial > > mMaterials
 
std::vector< ref< ObjMesh > > mMeshes
 

Detailed Description

Loads a Wavefront OBJ file.

Definition at line 341 of file ioOBJ.hpp.

Member Function Documentation

◆ loadOBJ()

ref< ResourceDatabase > ObjLoader::loadOBJ ( VirtualFile file)

Loads a Wavefront OBJ file.

Parameters
fileThe OBJ file to be loaded

Definition at line 303 of file ioOBJ.cpp.

References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::Image::bitsPerPixel(), vl::VirtualFile::close(), vl::Image::convertFormat(), vl::Image::convertType(), vl::defFileSystem(), vl::Shader::disable(), vl::Geometry::drawCalls(), vl::EN_ALPHA_TEST, vl::EN_BLEND, vl::EN_CULL_FACE, vl::EN_DEPTH_TEST, vl::EN_LIGHTING, vl::Shader::enable(), vl::Log::error(), vl::String::extractPath(), vl::ObjMesh::face_type(), vl::ObjMesh::faceNormalIndex(), vl::ObjMesh::facePositionIndex(), vl::ObjMesh::faceTexCoordIndex(), vl::FU_GEQUAL, vl::ref< T >::get(), vl::Texture::getTexParameter(), vl::Shader::gocAlphaFunc(), vl::Shader::gocLightModel(), vl::Shader::gocMaterial(), vl::Shader::gocTextureImageUnit(), vl::Image::height(), vl::IF_RGBA, vl::BufferedStream< Element_Type, Chunk_Size >::inputFile(), vl::IT_UNSIGNED_BYTE, vl::ObjMaterial::ka(), vl::ObjMaterial::kd(), vl::ObjMaterial::ke(), vl::ObjMaterial::ks(), vl::loadImage(), vl::FileSystem::locateFile(), vl::ObjMaterial::map_d(), vl::ObjMaterial::map_Kd(), vl::ObjMaterial::ns(), NULL, vl::Object::objectName(), vl::OM_ReadOnly, vl::VirtualFile::open(), vl::VirtualFile::path(), vl::ObjTexture::path(), vl::Image::pixels(), vl::Texture::prepareTexture2D(), vl::Log::print(), vl::PT_TRIANGLES, vl::TextStream::readLine(), vl::Image::requiredMemory(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize(), vl::ResourceDatabase::resources(), vl::AlphaFunc::set(), vl::Material::setAmbient(), vl::Material::setDiffuse(), vl::Actor::setEffect(), vl::Material::setEmission(), vl::TexParameter::setMagFilter(), vl::ObjMesh::setMaterial(), vl::TexParameter::setMinFilter(), vl::Geometry::setNormalArray(), vl::Object::setObjectName(), vl::Material::setShininess(), vl::Material::setSpecular(), vl::Geometry::setTexCoordArray(), vl::TextureImageUnit::setTexture(), vl::LightModel::setTwoSide(), vl::Geometry::setVertexArray(), vl::Effect::shader(), vl::TF_RGBA, vl::String::toStdString(), vl::TPF_LINEAR, vl::TPF_LINEAR_MIPMAP_LINEAR, vl::ObjMaterial::tr(), vl::String::trim(), vl::String::trimStdString(), vl::ObjTexture::valid(), VL_CHECK, VL_TRAP, vl::Log::warning(), and vl::Image::width().

Referenced by vl::loadOBJ().

◆ loadObjMaterials()

void ObjLoader::loadObjMaterials ( VirtualFile file,
std::vector< ObjMaterial > &  materials 
)

◆ materials() [1/2]

const std::map< std::string, ref<ObjMaterial> >& vl::ObjLoader::materials ( ) const
inline

Definition at line 347 of file ioOBJ.hpp.

◆ materials() [2/2]

std::map< std::string, ref<ObjMaterial> >& vl::ObjLoader::materials ( )
inline

Definition at line 353 of file ioOBJ.hpp.

◆ meshes() [1/2]

const std::vector< ref<ObjMesh> >& vl::ObjLoader::meshes ( ) const
inline

Definition at line 348 of file ioOBJ.hpp.

◆ meshes() [2/2]

std::vector< ref<ObjMesh> >& vl::ObjLoader::meshes ( )
inline

Definition at line 354 of file ioOBJ.hpp.

References vl::loadOBJ().

◆ normalArray() [1/2]

const std::vector<fvec3>& vl::ObjLoader::normalArray ( ) const
inline

Definition at line 345 of file ioOBJ.hpp.

◆ normalArray() [2/2]

std::vector<fvec3>& vl::ObjLoader::normalArray ( )
inline

Definition at line 351 of file ioOBJ.hpp.

◆ texCoordsArray() [1/2]

const std::vector<fvec3>& vl::ObjLoader::texCoordsArray ( ) const
inline

Definition at line 346 of file ioOBJ.hpp.

◆ texCoordsArray() [2/2]

std::vector<fvec3>& vl::ObjLoader::texCoordsArray ( )
inline

Definition at line 352 of file ioOBJ.hpp.

◆ vertexArray() [1/2]

const std::vector<fvec4>& vl::ObjLoader::vertexArray ( ) const
inline

Definition at line 344 of file ioOBJ.hpp.

◆ vertexArray() [2/2]

std::vector<fvec4>& vl::ObjLoader::vertexArray ( )
inline

Definition at line 350 of file ioOBJ.hpp.

Member Data Documentation

◆ mCoords

std::vector<fvec4> vl::ObjLoader::mCoords
protected

Definition at line 366 of file ioOBJ.hpp.

◆ mMaterials

std::map< std::string, ref<ObjMaterial> > vl::ObjLoader::mMaterials
protected

Definition at line 369 of file ioOBJ.hpp.

◆ mMeshes

std::vector< ref<ObjMesh> > vl::ObjLoader::mMeshes
protected

Definition at line 370 of file ioOBJ.hpp.

◆ mNormals

std::vector<fvec3> vl::ObjLoader::mNormals
protected

Definition at line 367 of file ioOBJ.hpp.

◆ mTexCoords

std::vector<fvec3> vl::ObjLoader::mTexCoords
protected

Definition at line 368 of file ioOBJ.hpp.


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