Struct Vertex

Struct Documentation

struct Vertex

All data about a given vertex in a mesh.

Public Functions

inline Vertex(const glm::vec3 &position, const glm::vec2 &texCoords = glm::vec2(0.0f), const glm::vec3 &normal = glm::vec3(0.0f), const glm::vec4 &tangent = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f))

Create a new vertex.

Parameters:
  • position – The position in local space

  • texCoords – The texture coordinates (optional, defaults to {0, 0})

  • normal – The surface normal vector (optional, defaults to {0, 0, 0})

  • tangent – The surface tangent vector (optional, defaults to {0, 0, 0, 1}), stored as XYZ for vector and W for sign

Public Members

glm::vec3 position

The position in local space.

glm::vec2 texCoords

The texture coordinates.

glm::vec3 normal

The surface normal vector.

glm::vec4 tangent

The surface tangent vector (stored as XYZ for the vector and W for the tangent sign)