#include <Mesh.h>
|
| auto | uploadMeshToGPU () -> void |
| | Upload mesh data to gpu, when creating mesh, or loading from a file.
|
|
| std::string | _name |
| | the name of the mesh, used for serialization
|
| std::shared_ptr< VAO > | vao |
| | vertex attribute object, the "mesh" in opengl
|
| std::shared_ptr< IndexBuffer > | triangleBuffer |
| std::shared_ptr< VertexBuffer > | vertexBuffer |
| unsigned | spriteTilesCountU = 1 |
| | number of sprite tiles wide the image would be for this mesh
|
| unsigned | spriteTilesCountV = 1 |
| | number of sprite tiles high the image would be for this mesh
|
| std::vector< gfx::Vertex > | vertices |
| | local copy of the Vertexes uploaded to the gpu
|
| unsigned | frame = 0 |
| | frame of animation for calculating uv offsets, clamped to be valid for the sprite sheet size
|
| unsigned | maxFrames |
| | max number of frames that makes sense for the mesh, assuming a tilesheet of spriteTilesCountV by spriteTilesCountU
|
◆ Mesh() [1/3]
| Mesh::Mesh |
( |
unsigned | tilesWide = 1, |
|
|
unsigned | tilesHigh = 1 ) |
constructs a mesh.
the mesh is of size 1 / tilesWide x 1 / tilesHigh
- Parameters
-
| tilesWide | how many tiles wide the spritesheet is that this mesh works with |
| tilesHigh | how many tiles wide the spritesheet is that this mesh works with |
◆ ~Mesh()
◆ Mesh() [2/3]
| Mesh::Mesh |
( |
const Mesh & | other | ) |
|
|
default |
◆ Mesh() [3/3]
| Mesh::Mesh |
( |
Mesh && | other | ) |
|
|
defaultnoexcept |
◆ activate()
| auto Mesh::activate |
( |
| ) |
const->void |
◆ deactivate()
| auto Mesh::deactivate |
( |
| ) |
const->void |
◆ decrementFrame()
| auto Mesh::decrementFrame |
( |
| ) |
->void |
◆ draw() [1/2]
| auto Mesh::draw |
( |
const Shader & | shader | ) |
const->void |
◆ draw() [2/2]
| auto Mesh::draw |
( |
const Shader & | shader, |
|
|
const Texture & | texture ) const->void |
◆ getFrame()
| auto Mesh::getFrame |
( |
| ) |
const->unsigned |
get the frame of the mesh. frames go right to left, then top top bottom
◆ getMaxFrames()
| auto Mesh::getMaxFrames |
( |
| ) |
const->unsigned |
get the max number of frames of the mesh, based on the tiles wide and high of the mesh
◆ incrementFrame()
| auto Mesh::incrementFrame |
( |
| ) |
->void |
◆ load()
| auto Mesh::load |
( |
Stream & | stream | ) |
->void |
◆ name()
| auto Mesh::name |
( |
| ) |
const->conststd::string & |
|
nodiscard |
◆ operator=() [1/2]
| auto Mesh::operator= |
( |
const Mesh & | other | ) |
->Mesh &=default |
|
default |
◆ operator=() [2/2]
| auto Mesh::operator= |
( |
Mesh && | other | ) |
->Mesh &=default |
|
defaultnoexcept |
◆ save()
| auto Mesh::save |
( |
Stream & | stream | ) |
const->void |
◆ setFrame()
| auto Mesh::setFrame |
( |
unsigned | newFrameNum | ) |
->void |
Set the frame of the mesh, automatically calculates correct uv offset. Frames go right to left, then top to bottom.
◆ setName()
| auto Mesh::setName |
( |
const std::string & | name | ) |
->void |
◆ setObjectCamera()
| auto Mesh::setObjectCamera |
( |
const AffineMatrix & | camera | ) |
const->void |
◆ setObjectColor()
| auto Mesh::setObjectColor |
( |
const Vector4D & | color | ) |
const->void |
◆ setObjectProjection()
| auto Mesh::setObjectProjection |
( |
const AffineMatrix & | projection | ) |
const->void |
◆ setObjectTransform()
| auto Mesh::setObjectTransform |
( |
const AffineMatrix & | transform | ) |
const->void |
Sets the uniform for the object.
The shader that the object is to be rendered with must be active.
- Parameters
-
| transform | the transform to set |
◆ showMenu()
| auto Mesh::showMenu |
( |
| ) |
->void |
◆ uploadMeshToGPU()
| auto Mesh::uploadMeshToGPU |
( |
| ) |
->void |
|
private |
Upload mesh data to gpu, when creating mesh, or loading from a file.
◆ from_json
| auto from_json |
( |
const json & | j, |
|
|
Mesh & | a )->void |
|
friend |
◆ to_json
| auto to_json |
( |
json & | j, |
|
|
const Mesh & | a )->void |
|
friend |
◆ _name
the name of the mesh, used for serialization
◆ frame
frame of animation for calculating uv offsets, clamped to be valid for the sprite sheet size
◆ maxFrames
max number of frames that makes sense for the mesh, assuming a tilesheet of spriteTilesCountV by spriteTilesCountU
◆ spriteTilesCountU
| unsigned Mesh::spriteTilesCountU = 1 |
|
private |
number of sprite tiles wide the image would be for this mesh
◆ spriteTilesCountV
| unsigned Mesh::spriteTilesCountV = 1 |
|
private |
number of sprite tiles high the image would be for this mesh
◆ triangleBuffer
◆ vao
| std::shared_ptr<VAO> Mesh::vao |
|
private |
vertex attribute object, the "mesh" in opengl
◆ vertexBuffer
◆ vertices
local copy of the Vertexes uploaded to the gpu
The documentation for this class was generated from the following files:
- /home/egrazil/sites/Brunot/The House/source/Graphics/Mesh.h
- /home/egrazil/sites/Brunot/The House/source/Graphics/Mesh.cpp