cangine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cangine::Vertex Struct Reference

A single renderable vertex: position, color and texture coordinate. More...

#include <vertex.hpp>

Collaboration diagram for cangine::Vertex:
Collaboration graph
[legend]

Public Member Functions

constexpr Vertex () noexcept=default
 Constructs a vertex at the origin, black, with zero UV.
 
constexpr Vertex (float _x, float _y, float _z, const Color &c, const Vector2 &texCoord) noexcept
 Constructs a fully specified vertex.
 
constexpr Vertex (float _x, float _y, float _z, const Color &c) noexcept
 Constructs a colored vertex with a zero texture coordinate.
 
constexpr Vertex (float _x, float _y, float _z) noexcept
 Constructs a black vertex from explicit components.
 
constexpr Vertex (const Vector3 &v, const Color &c, const Vector2 &texCoord) noexcept
 Constructs a fully specified vertex from a position vector.
 
constexpr Vertex (const Vector3 &v, const Color &c) noexcept
 Constructs a colored vertex from a position vector.
 
constexpr Vertex (const Vector3 &v) noexcept
 Constructs a black vertex from a position vector.
 

Public Attributes

float x {0.0f}
 
float y {0.0f}
 
float z {0.0f}
 Position components.
 
Color color {Colors::BLACK}
 Vertex color.
 
Vector2 uv {0.0f, 0.0f}
 Texture coordinate.
 

Detailed Description

A single renderable vertex: position, color and texture coordinate.

Bundles everything the renderer needs per vertex. Provides constructors that accept either explicit float components or a Vector3 position, with color and UV defaulting to black / (0,0).

Constructor & Destructor Documentation

◆ Vertex() [1/7]

constexpr cangine::Vertex::Vertex ( )
constexprdefaultnoexcept

Constructs a vertex at the origin, black, with zero UV.

◆ Vertex() [2/7]

constexpr cangine::Vertex::Vertex ( float  _x,
float  _y,
float  _z,
const Color &  c,
const Vector2 &  texCoord 
)
inlineconstexprnoexcept

Constructs a fully specified vertex.

Parameters
_xPosition x component.
_yPosition y component.
_zPosition z component.
cVertex color.
texCoordTexture coordinate.

◆ Vertex() [3/7]

constexpr cangine::Vertex::Vertex ( float  _x,
float  _y,
float  _z,
const Color &  c 
)
inlineconstexprnoexcept

Constructs a colored vertex with a zero texture coordinate.

Parameters
_xPosition x component.
_yPosition y component.
_zPosition z component.
cVertex color.

◆ Vertex() [4/7]

constexpr cangine::Vertex::Vertex ( float  _x,
float  _y,
float  _z 
)
inlineconstexprnoexcept

Constructs a black vertex from explicit components.

Parameters
_xPosition x component.
_yPosition y component.
_zPosition z component.

◆ Vertex() [5/7]

constexpr cangine::Vertex::Vertex ( const Vector3 &  v,
const Color &  c,
const Vector2 &  texCoord 
)
inlineconstexprnoexcept

Constructs a fully specified vertex from a position vector.

Parameters
vPosition vector.
cVertex color.
texCoordTexture coordinate.

◆ Vertex() [6/7]

constexpr cangine::Vertex::Vertex ( const Vector3 &  v,
const Color &  c 
)
inlineconstexprnoexcept

Constructs a colored vertex from a position vector.

Parameters
vPosition vector.
cVertex color.

◆ Vertex() [7/7]

constexpr cangine::Vertex::Vertex ( const Vector3 &  v)
inlineconstexprnoexcept

Constructs a black vertex from a position vector.

Parameters
vPosition vector.

Member Data Documentation

◆ color

Color cangine::Vertex::color {Colors::BLACK}

Vertex color.

◆ uv

Vector2 cangine::Vertex::uv {0.0f, 0.0f}

Texture coordinate.

◆ x

float cangine::Vertex::x {0.0f}

◆ y

float cangine::Vertex::y {0.0f}

◆ z

float cangine::Vertex::z {0.0f}

Position components.


The documentation for this struct was generated from the following file: