MobileRT
1.0
A multi platform C++ CPU progressive Ray Tracer.
|
#include <OBJLoader.hpp>
Public Member Functions | |
OBJLoader ()=delete | |
OBJLoader (::std::istream &isObj, ::std::istream &isMtl) | |
OBJLoader (const OBJLoader &objLoader)=delete | |
OBJLoader (OBJLoader &&objLoader) noexcept=delete | |
~OBJLoader () final | |
OBJLoader & | operator= (const OBJLoader &objLoader)=delete |
OBJLoader & | operator= (OBJLoader &&objLoader) noexcept=delete |
bool | fillScene (::MobileRT::Scene *scene, ::std::function<::std::unique_ptr<::MobileRT::Sampler >()> lambda, ::std::string filePath, ::std::unordered_map<::std::string, ::MobileRT::Texture > texturesCache) final |
![]() | |
ObjectLoader ()=default | |
ObjectLoader (const ObjectLoader &objectLoader)=delete | |
ObjectLoader (ObjectLoader &&objectLoader) noexcept=delete | |
virtual | ~ObjectLoader () |
ObjectLoader & | operator= (const ObjectLoader &objectLoader)=delete |
ObjectLoader & | operator= (ObjectLoader &&objectLoader) noexcept=delete |
bool | isProcessed () const |
virtual bool | fillScene (Scene *scene, ::std::function<::std::unique_ptr< Sampler >()> lambda, ::std::string filePath, ::std::unordered_map<::std::string, ::MobileRT::Texture > texturesCache)=0 |
Static Public Member Functions | |
static const ::MobileRT::Texture & | getTextureFromCache (::std::unordered_map<::std::string, ::MobileRT::Texture > *const texturesCache, ::std::string &&textureBinary, long size, const ::std::string &texPath) |
Private Types | |
template<typename T1 , typename T2 , typename T3 > | |
using | triple = ::std::tuple< T1, T2, T3 > |
Private Member Functions | |
triple<::glm::vec3, ::glm::vec3, ::glm::vec3 > | loadNormal (const ::tinyobj::shape_t &index, ::std::int32_t indexOffset, const triple<::glm::vec3, ::glm::vec3, ::glm::vec3 > &vertex) const |
triple<::glm::vec3, ::glm::vec3, ::glm::vec3 > | loadVertices (const ::tinyobj::shape_t &shape, ::std::int32_t indexOffset) const |
const ::MobileRT::Texture & | getTextureFromCache (::std::unordered_map<::std::string, ::MobileRT::Texture > *const texturesCache, const ::std::string &filePath, const ::std::string &texPath) |
void | fillSceneThreadWork (::std::uint32_t threadId, ::std::uint32_t numberOfThreads, ::MobileRT::Scene *const scene, const ::std::function<::std::unique_ptr<::MobileRT::Sampler >()> &lambda, const ::std::string &filePath, ::std::unordered_map<::std::string, ::MobileRT::Texture > *const texturesCache, ::std::mutex *const mutex) |
Static Private Member Functions | |
static triple<::glm::vec2, ::glm::vec2, ::glm::vec2 > | normalizeTexCoord (const MobileRT::Texture &texture, const ::std::tuple<::glm::vec2, ::glm::vec2, ::glm::vec2 > &texCoord) |
Private Attributes | |
::tinyobj::attrib_t | attrib_ {} |
::std::vector<::tinyobj::shape_t > | shapes_ {} |
::std::vector<::tinyobj::material_t > | materials_ {} |
Additional Inherited Members | |
![]() | |
bool | isProcessed_ {false} |
::std::int32_t | numberTriangles_ {-1} |
A class which loads a scene from an OBJ file and fills the scene with the loaded geometry.
|
private |
|
explicitdelete |
|
explicit |
|
delete |
|
deletenoexcept |
|
final |
The destructor.
|
final |
|
private |
Fill the scene with the loaded triangles.
This method is called by the fillScene method with multiple threads.
Fill the scene with the loaded triangles.
|
private |
|
static |
|
private |
Helper method that loads a normal from the tinyobjloader library structure.
shape | The shape structure from the tinyobj library. |
indexOffset | The indices of the normals in the tinyobjloader structure. |
vertex | The vertices' values of the triangle. |
|
private |
Helper method that loads the vertices' values.
shape | The shape structure from the tinyobj library. |
indexOffset | The indices of the normals in the tinyobjloader structure. |
|
staticprivate |
Helper method that normalizes the texture coordinates.
texture | The texture of the texture coordinates. |
texCoord | The texture coordinates to normalize. |
|
private |
|
private |
|
private |