Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
Vertex Struct Reference

Represents a single vertex in a 3D model, containing position, normal, and UV coordinates. More...

#include <Mesh.hpp>

Public Member Functions

 Vertex (const glm::vec3 &pos={}, const glm::vec3 &n={}, const glm::vec2 &u={}, const glm::ivec4 &bones=glm::ivec4(0), const glm::vec4 &weights=glm::vec4(0.0f))
 Construct a new Vertex object.

Static Public Member Functions

static VkVertexInputBindingDescription getBindingDescription ()
 Retrieves the Vulkan vertex input binding description.
static std::vector< VkVertexInputAttributeDescription > getAttributeDescriptions ()
 Retrieves the Vulkan vertex input attribute descriptions.

Public Attributes

glm::vec3 position
 Position of the vertex in 3D space.
glm::vec3 normal
 Normal vector of the vertex for lighting calculations.
glm::vec2 uv
 Texture coordinate (UV) of the vertex.
glm::ivec4 boneIDs
 Bone IDs that influence this vertex (Max 4).
glm::vec4 boneWeights
 Bone weight influences (sums to 1.0).

Detailed Description

Represents a single vertex in a 3D model, containing position, normal, and UV coordinates.

Constructor & Destructor Documentation

◆ Vertex()

Vertex::Vertex ( const glm::vec3 & pos = {},
const glm::vec3 & n = {},
const glm::vec2 & u = {},
const glm::ivec4 & bones = glm::ivec4(0),
const glm::vec4 & weights = glm::vec4(0.0f) )
inline

Construct a new Vertex object.

Parameters
posPosition of the vertex.
nNormal vector of the vertex.
uTexture coordinate of the vertex.
bonesBone IDs.
weightsBone weights.

Member Function Documentation

◆ getAttributeDescriptions()

std::vector< VkVertexInputAttributeDescription > Vertex::getAttributeDescriptions ( )
inlinestatic

Retrieves the Vulkan vertex input attribute descriptions.

Returns
A vector containing the attribute descriptions.

◆ getBindingDescription()

VkVertexInputBindingDescription Vertex::getBindingDescription ( )
inlinestatic

Retrieves the Vulkan vertex input binding description.

Returns
The binding description.

Member Data Documentation

◆ boneIDs

glm::ivec4 Vertex::boneIDs

Bone IDs that influence this vertex (Max 4).

◆ boneWeights

glm::vec4 Vertex::boneWeights

Bone weight influences (sums to 1.0).

◆ normal

glm::vec3 Vertex::normal

Normal vector of the vertex for lighting calculations.

◆ position

glm::vec3 Vertex::position

Position of the vertex in 3D space.

◆ uv

glm::vec2 Vertex::uv

Texture coordinate (UV) of the vertex.


The documentation for this struct was generated from the following file:
  • engine/include/ecs/components/Mesh.hpp