2#include "resources/Bounds.hpp"
3#include "resources/Buffer.hpp"
4#include "graphics/GPUTypes.hpp"
77 int saveAsObj(
const std::string & path,
bool defaultUVs);
82 const std::string &
name()
const;
135 std::unique_ptr<GPUMesh>
gpu;
Represent the smallest axis-aligne box containing a given object or region of space.
Definition: Bounds.hpp:28
General purpose GPU buffer, with different use types determining its memory type, visibility and acce...
Definition: Buffer.hpp:10
Store vertices and triangles data on the GPU, linked by an array object.
Definition: GPUObjects.hpp:125
Represents a geometric mesh composed of vertices, other attributes and triangles.
Definition: Mesh.hpp:15
int saveAsObj(const std::string &path, bool defaultUVs)
Definition: Mesh.cpp:510
BoundingBox computeBoundingBox()
Definition: Mesh.cpp:310
const Metrics & metrics() const
Definition: Mesh.cpp:570
bool hadNormals() const
Definition: Mesh.cpp:558
BoundingBox bbox
The mesh bounding box in model space.
Definition: Mesh.hpp:134
void clearGeometry()
Definition: Mesh.cpp:279
std::vector< unsigned int > indices
The triangular faces indices.
Definition: Mesh.hpp:132
void clean()
Definition: Mesh.cpp:289
std::unique_ptr< GPUMesh > gpu
The GPU buffers infos (optional).
Definition: Mesh.hpp:135
std::vector< glm::vec3 > colors
The vertex colors.
Definition: Mesh.hpp:130
const std::string & name() const
Definition: Mesh.cpp:554
std::vector< glm::vec3 > normals
The surface normals.
Definition: Mesh.hpp:127
bool hadColors() const
Definition: Mesh.cpp:566
std::string _name
Resource name.
Definition: Mesh.hpp:143
std::vector< glm::vec3 > positions
The 3D positions.
Definition: Mesh.hpp:126
Buffer & indexBuffer()
Definition: Mesh.cpp:305
Mesh & operator=(Mesh &&)
std::vector< glm::vec3 > bitangents
The surface bitangents.
Definition: Mesh.hpp:129
void updateMetrics()
Definition: Mesh.cpp:574
Mesh & operator=(const Mesh &)=delete
Buffer & vertexBuffer()
Definition: Mesh.cpp:300
void computeTangentsAndBitangents(bool force)
Definition: Mesh.cpp:356
void upload()
Definition: Mesh.cpp:274
void computeNormals()
Definition: Mesh.cpp:327
std::vector< glm::vec3 > tangents
The surface tangents.
Definition: Mesh.hpp:128
Load
The mesh loading preprocessing mode.
Definition: Mesh.hpp:19
@ Expanded
Duplicate vertices for every face.
@ Points
Load the vertices without any connectivity.
@ Indexed
Duplicate only vertices that are shared between faces with attributes with different values.
bool hadTexcoords() const
Definition: Mesh.cpp:562
Mesh(const Mesh &)=delete
Metrics _metrics
Resource stats.
Definition: Mesh.hpp:142
std::vector< glm::vec2 > texcoords
The texture coordinates.
Definition: Mesh.hpp:131
Detailed operation to perform when binding a texture (starting a renderpass).
Definition: GPUTypes.hpp:278
Information on a geometric mesh.
Definition: Mesh.hpp:26
size_t indices
Index count.
Definition: Mesh.hpp:33
size_t vertices
Vertex count.
Definition: Mesh.hpp:27
size_t colors
Color count.
Definition: Mesh.hpp:31
size_t texcoords
UV count.
Definition: Mesh.hpp:32
size_t normals
Normal count.
Definition: Mesh.hpp:28
size_t tangents
Tangent count.
Definition: Mesh.hpp:29
size_t bitangents
Bitangent count.
Definition: Mesh.hpp:30