Raftel Engine
 
Loading...
Searching...
No Matches
mesh.hpp File Reference

Defines the Vertex, Mesh, and MeshFactory for handling and rendering 3D mesh data. More...

#include <vector>
#include <string>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <raftel/material.hpp>
#include <raftel/shader.hpp>
#include <raftel/global_macros.hpp>
#include <raftel/engine.hpp>

Go to the source code of this file.

Classes

struct  Raftel::Vertex
 Represents a 3D vertex with attributes like position, normal, and texture coordinates. More...
 
class  Raftel::Mesh
 Represents a 3D mesh, including vertex data, indices, and materials. More...
 
class  Raftel::MeshFactory
 A factory class for creating and loading meshes. More...
 

Detailed Description

Defines the Vertex, Mesh, and MeshFactory for handling and rendering 3D mesh data.

Date
2025-03-10
Authors
Carlos Mazcuñán Blanes, Marc Folgado Balbás

This file contains definitions for the Vertex structure, the Mesh class, and the MeshFactory class. These are used to handle, load, and render 3D mesh data in a graphics application.

The Vertex structure represents a 3D vertex with attributes like position, normal, and texture coordinates.

The Mesh class is responsible for storing and rendering the mesh data, including handling materials and OpenGL buffers.

The MeshFactory class provides functionality to create and load meshes efficiently, using either single-threaded or multi-threaded operations.

Usage Example:

// Example of creating a Mesh and adding materials
auto mesh = Raftel::Mesh::Create("path/to/mesh.obj", true);
auto material = std::make_shared<Raftel::Material>();
mesh->addMaterial(material);
mesh->draw(shaderProgram);
static std::shared_ptr< Mesh > Create(const std::string &filePath, bool multithread)
Move constructor for the Mesh class.

Definition in file mesh.hpp.