1 #ifndef COMPONENTS_LOADERS_OBJLOADER_HPP 2 #define COMPONENTS_LOADERS_OBJLOADER_HPP 10 #include <unordered_map> 11 #include <tinyobjloader/tiny_obj_loader.h> 20 template<
typename T1,
typename T2,
typename T3>
21 using triple = ::std::tuple<T1, T2, T3>;
25 ::std::vector<::tinyobj::shape_t>
shapes_ {};
31 explicit OBJLoader(::std::istream& isObj, ::std::istream& isMtl);
44 ::std::function<::std::unique_ptr<::MobileRT::Sampler>()> lambda,
45 ::std::string filePath,
46 ::std::unordered_map<::std::string, ::MobileRT::Texture> texturesCache)
final;
50 const ::tinyobj::shape_t &index,
51 ::std::int32_t indexOffset,
55 const ::tinyobj::shape_t &shape,
56 ::std::int32_t indexOffset)
const;
59 ::std::unordered_map<::std::string, ::MobileRT::Texture> *
const texturesCache,
60 const ::std::string &filePath,
61 const ::std::string &texPath
70 ::std::uint32_t numberOfThreads,
72 const ::std::function<::std::unique_ptr<::MobileRT::Sampler>()> &lambda,
73 const ::std::string &filePath,
74 ::std::unordered_map<::std::string, ::MobileRT::Texture> *
const texturesCache,
75 ::std::mutex *
const mutex);
79 ::std::unordered_map<::std::string, ::MobileRT::Texture> *
const texturesCache,
80 ::std::string &&textureBinary,
82 const ::std::string &texPath);
87 const ::std::tuple<::glm::vec2, ::glm::vec2, ::glm::vec2> &texCoord);
91 #endif //COMPONENTS_LOADERS_OBJLOADER_HPP triple<::glm::vec3, ::glm::vec3, ::glm::vec3 > loadVertices(const ::tinyobj::shape_t &shape, ::std::int32_t indexOffset) const
Definition: OBJLoader.cpp:116
::std::vector<::tinyobj::shape_t > shapes_
Definition: OBJLoader.hpp:25
Definition: Orthographic.hpp:6
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
Definition: OBJLoader.cpp:154
Definition: OBJLoader.hpp:18
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
Definition: OBJLoader.cpp:74
::std::tuple< T1, T2, T3 > triple
Definition: OBJLoader.hpp:21
::tinyobj::attrib_t attrib_
Definition: OBJLoader.hpp:24
~OBJLoader() final
Definition: OBJLoader.cpp:502
Definition: ObjectLoader.hpp:16
Definition: Texture.hpp:16
OBJLoader & operator=(const OBJLoader &objLoader)=delete
const ::MobileRT::Texture & getTextureFromCache(::std::unordered_map<::std::string, ::MobileRT::Texture > *const texturesCache, const ::std::string &filePath, const ::std::string &texPath)
::std::vector<::tinyobj::material_t > materials_
Definition: OBJLoader.hpp:26
static triple<::glm::vec2, ::glm::vec2, ::glm::vec2 > normalizeTexCoord(const MobileRT::Texture &texture, const ::std::tuple<::glm::vec2, ::glm::vec2, ::glm::vec2 > &texCoord)
Definition: OBJLoader.cpp:193
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)
Definition: OBJLoader.cpp:276