Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Loading an OBJ file

OBJLoader is a class that loads and parses OBJ files.

OBJLoader is a class that loads and parses OBJ files.It utilizes the TinyObjLoader library to read the contents of an OBJ file and extract mesh data such as vertices, normals, texture coordinates, and indices. The loaded data is stored in a Component::Mesh object, which can be retrieved using the GetMesh() method.

try {
Object::OBJLoader loader("path/to/model.obj");
} catch (const Object::OBJLoaderError &e) {
std::cerr << e.what() << std::endl;
}
Definition OBJLoaderError.hpp:48
const char * what() const override
Definition OBJLoaderError.hpp:52
Definition OBJLoader.hpp:71
Component::Mesh GetMesh()
Retrieves the loaded mesh data.
Definition OBJLoader.cpp:28
Mesh structure.
Definition Mesh.hpp:40

an OBJ file