A wrapper around a shared_ptr to a GraphicsEngine's shape.
More...
#include <mesh.h>
|
static auto | id_value () -> uint64_t & |
| Used for assigning new shape name in the graphics engine.
|
|
static int | getVertexRange (GraphicsEngine::VAOAttrib attributes) |
| Get the number of floats needed to store a vertex.
|
|
|
GraphicsEngine::VAOAttrib | attributes |
| determines what data holds, whether it's position, normal, uv, or color, or any combination of them.
|
|
int | vertexRange |
| how many floats does it take to store 1 vertex. Varies depending on the attributes chosen. Should be equal to 3*(?pos + ?norm + ?color) + 2(?uv).
|
|
std::shared_ptr< GraphicsEngine::Shape > | mesh |
|
std::vector< float > | data |
| packed vertex data
|
|
A wrapper around a shared_ptr to a GraphicsEngine's shape.
◆ StandardType
Different types of meshes loaded into the graphics engine.
Enumerator |
---|
Quad | |
Cone | |
Cube | |
Sphere | |
Cylinder | |
◆ Mesh() [1/4]
Construct a new Mesh object.
◆ Mesh() [2/4]
Construct a new Mesh object using a standard mesh type. These are default objects in the engine.
- See also
- StandardType
- Parameters
-
type | the type of the shape of the mesh. |
◆ Mesh() [3/4]
Saga::Mesh::Mesh |
( |
const std::string & |
filepath | ) |
|
Construct a new Mesh object loaded from the specific filename. Does not support instancing out of the gate.
- Parameters
-
filepath | the filepath of the mesh to load. This must be an .obj file format, and the path is relative to the root of the project. |
◆ Mesh() [4/4]
Saga::Mesh::Mesh |
( |
std::vector< float > |
data, |
|
|
GraphicsEngine::VAOAttrib |
attributes |
|
) |
| |
Construct a new Mesh object using the mesh data.
- Parameters
-
data | coordinates of the mesh, in POS | NORMAL form. |
◆ getPos()
glm::vec3 Saga::Mesh::getPos |
( |
int |
index | ) |
|
◆ getTrianglesCnt()
int Saga::Mesh::getTrianglesCnt |
( |
| ) |
|
◆ getVertexRange()
int Saga::Mesh::getVertexRange |
( |
GraphicsEngine::VAOAttrib |
attributes | ) |
|
|
static |
Get the number of floats needed to store a vertex.
- Parameters
-
attributes | the attributes we need to store for a single vertex. |
- Returns
- int number of floats used to store a vertex. Generally, position costs 3 floats, so does color and normal. uv coordinates costs two to store.
◆ id_value()
static auto Saga::Mesh::id_value |
( |
| ) |
-> uint64_t & |
|
inlinestatic |
Used for assigning new shape name in the graphics engine.
- Returns
- uint64_t& a new, unique integer.
◆ operator const std::shared_ptr< GraphicsEngine::Shape > &()
Saga::Mesh::operator const std::shared_ptr< GraphicsEngine::Shape > & |
( |
| ) |
const |
|
inline |
◆ attributes
GraphicsEngine::VAOAttrib Saga::Mesh::attributes |
determines what data holds, whether it's position, normal, uv, or color, or any combination of them.
◆ data
std::vector<float> Saga::Mesh::data |
◆ mesh
std::shared_ptr<GraphicsEngine::Shape> Saga::Mesh::mesh |
◆ vertexRange
int Saga::Mesh::vertexRange |
how many floats does it take to store 1 vertex. Varies depending on the attributes chosen. Should be equal to 3*(?pos + ?norm + ?color) + 2(?uv).
The documentation for this struct was generated from the following files: