The Mesh class represents a 3D model.
More...
#include <mesh.hpp>
The Mesh class represents a 3D model.
A mesh is a collection of vertices, indices and textures that represent a 3D model. The mesh can be drawn using a shader and calling the Draw method.
Definition at line 83 of file mesh.hpp.
◆ Mesh()
| Mesh::Mesh |
( |
std::vector< Types::Vertex > | vertices, |
|
|
std::vector< unsigned int > | indices, |
|
|
std::vector< Types::Texture > | textures, |
|
|
GLint | wrapping = GL_REPEAT, |
|
|
GLint | filtering_min = GL_NEAREST, |
|
|
GLint | filtering_mag = GL_LINEAR, |
|
|
GLboolean | hasMipmap = GL_TRUE, |
|
|
GLint | mipmap_min = GL_LINEAR_MIPMAP_LINEAR, |
|
|
GLint | mipmap_max = GL_LINEAR ) |
Construct a new Mesh object.
- Parameters
-
| vertices | Vertices of the mesh |
| indices | Indices of the mesh |
| textures | Textures of the mesh |
| wrapping | Type of texture wrapping |
| filtering_min | Minifying texture filtering |
| filtering_mag | Magnifying texture filtering |
| hasMipmap | Should the texture have a mipmap? |
| mipmap_min | Type of mipmap minifying texture filtering |
| mipmap_mag | Type of mipmap magnifying texture filtering |
Definition at line 36 of file mesh.cpp.
◆ Draw()
| void Mesh::Draw |
( |
Types::ShaderName | shader_name | ) |
|
Draw the mesh.
- Parameters
-
| shader_name | Shader to use to draw the mesh |
Definition at line 58 of file mesh.cpp.
◆ filtering_mag
| GLint Brenta::Mesh::filtering_mag |
Magnifying texture filtering.
Type of texture filtering used when magnifying (scaling up) a texture. Options are:
- GL_NEAREST: select the closest color to the texture coordinate
- GL_LINEAR: interpolates the neighbouring pixels to get an approximate color.
Definition at line 138 of file mesh.hpp.
◆ filtering_min
| GLint Brenta::Mesh::filtering_min |
Minifying texture filtering.
Type of texture filtering used when minifying (scaling down) a texture. Options are:
- GL_NEAREST: select the closest color to the texture coordinate
- GL_LINEAR: interpolates the neighbouring pixels to get an approximate color.
Definition at line 128 of file mesh.hpp.
◆ hasMipmap
| GLboolean Brenta::Mesh::hasMipmap |
Should the texture have a mipmap?
Definition at line 142 of file mesh.hpp.
◆ indices
| std::vector<unsigned int> Brenta::Mesh::indices |
indices of the mesh
Indicies are used to reduce the memory footprint required to represent a 3D model. They are indices in the vertex array and there can be multiple indices for a vertex.
Definition at line 98 of file mesh.hpp.
◆ mipmap_mag
| GLint Brenta::Mesh::mipmap_mag |
Type of mipmap magnifying texture filtering.
Type of texture filtering used when magnifying (scaling up) a texture with mipmaps. Options are:
- GL_NEAREST: select the closest color to the texture coordinate
- GL_LINEAR: interpolates the neighbouring pixels to get an approximate color.
- GL_NEAREST_MIPMAP_NEAREST: selects the mipmap that most closely matches the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value.
- GL_LINEAR_MIPMAP_NEAREST: selects the mipmap that most closely matches the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value.
- GL_NEAREST_MIPMAP_LINEAR: selects the two mipmaps that most closely match the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
- GL_LINEAR_MIPMAP_LINEAR: selects the two mipmaps that most closely match the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
Definition at line 206 of file mesh.hpp.
◆ mipmap_min
| GLint Brenta::Mesh::mipmap_min |
Type of mipmap minifying texture filtering.
Type of texture filtering used when minifying (scaling down) a texture with mipmaps. Options are:
- GL_NEAREST: select the closest color to the texture coordinate
- GL_LINEAR: interpolates the neighbouring pixels to get an approximate color.
- GL_NEAREST_MIPMAP_NEAREST: selects the mipmap that most closely matches the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value.
- GL_LINEAR_MIPMAP_NEAREST: selects the mipmap that most closely matches the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value.
- GL_NEAREST_MIPMAP_LINEAR: selects the two mipmaps that most closely match the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
- GL_LINEAR_MIPMAP_LINEAR: selects the two mipmaps that most closely match the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
Definition at line 174 of file mesh.hpp.
◆ textures
textures of the mesh
Definition at line 102 of file mesh.hpp.
◆ vertices
vertices of the mesh
Definition at line 89 of file mesh.hpp.
◆ wrapping
| GLint Brenta::Mesh::wrapping |
Type of texture wrapping.
Options are:
- GL_REPEAT: The default behavior for textures. Repeats the texture image.
- GL_MIRRORED_REPEAT: Same as GL_REPEAT but mirrors the image with each repeat.
- GL_CLAMP_TO_EDGE: Clamps the coordinates between 0 and 1. The result is that higher coordinates become clamped to the edge, resulting in a stretched edge pattern.
- GL_CLAMP_TO_BORDER: Coordinates outside the range are now given a user-specified border color.
Definition at line 118 of file mesh.hpp.
The documentation for this class was generated from the following files: