Carpenter Engine
A C++ game engine with a build once run anywhere solution
|
A structure used to store mesh vertices. More...
#include <Mesh.hpp>
Public Member Functions | |
void | CalculateNormals (Vertex &v2, Vertex &v3) |
Calculates the normal vector of the vertices. | |
bool | operator== (const Vertex &rhs) |
Checks if two vertices are equal. | |
Public Attributes | |
float | x |
float | y |
float | z |
float | u |
float | v |
float | nx = 0.0f |
float | ny = 0.0f |
float | nz = 1.0f |
A structure used to store mesh vertices.
Each vertex has a position, texture coordinate, and normal vector which can be processed in shaders. Positions and coordinates are required. However, normal vectors are optional. If you don't provide a normal vector, the engine will compute one for you in respect to the triangle you create.
x | The x position of the vertex |
y | The y position of the vertex |
z | The z position of the vertex |
u | The u texture coordinate of the vertex |
v | The v texture coordinate of the vertex |
nx | The x component of the normal vector *(optional)* |
ny | The y component of the normal vector *(optional)* |
nz | The z component of the normal vector *(optional)* |
Calculates the normal vector of the vertices.
takes this vector this method is associated with and two other vertices to calculate the normal of the triangle. The normal vector is then stored in the three vertex structs.
v2 | The second vertex of the triangle |
v3 | The third vertex of the triangle |
bool Engine::Graphics::Vertex::operator== | ( | const Vertex & | rhs | ) |
Checks if two vertices are equal.