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
Mesh Struct Reference

Represents a mesh component that holds geometry data and its Vulkan buffers. More...

#include <Mesh.hpp>

Public Member Functions

 Mesh (const std::vector< Vertex > &verts={}, const std::vector< uint32_t > &inds={}, VkBuffer vBuf=VK_NULL_HANDLE, VkDeviceMemory vMem=VK_NULL_HANDLE, VkBuffer iBuf=VK_NULL_HANDLE, VkDeviceMemory iMem=VK_NULL_HANDLE)
 Construct a new Mesh object.

Public Attributes

uint32_t id = 0
 Unique identifier for this mesh.
std::string gltfPath
 Target glTF/glb file path.
int primitiveIndex = -1
 Index of the primitive submesh in glTF.
std::string nodeName
 Name of the node associated with this mesh.
std::string parentBoneName
 Name of the parent bone/joint in glTF.
std::vector< Vertex > vertices
 CPU-side vertex data.
std::vector< uint32_t > indices
 CPU-side index data.
VkBuffer vertexBuffer { VK_NULL_HANDLE }
 Vulkan buffer holding the vertex data.
VkDeviceMemory vertexBufferMemory { VK_NULL_HANDLE }
 GPU memory backing the vertex buffer.
VkBuffer indexBuffer { VK_NULL_HANDLE }
 Vulkan buffer holding the index data.
VkDeviceMemory indexBufferMemory { VK_NULL_HANDLE }
 GPU memory backing the index data.
bool isSkinned = false
 Whether this mesh has skin weights and is deformed on GPU.
bool visible = true
 Whether this mesh should be rendered.

Detailed Description

Represents a mesh component that holds geometry data and its Vulkan buffers.

Constructor & Destructor Documentation

◆ Mesh()

Mesh::Mesh ( const std::vector< Vertex > & verts = {},
const std::vector< uint32_t > & inds = {},
VkBuffer vBuf = VK_NULL_HANDLE,
VkDeviceMemory vMem = VK_NULL_HANDLE,
VkBuffer iBuf = VK_NULL_HANDLE,
VkDeviceMemory iMem = VK_NULL_HANDLE )
inline

Construct a new Mesh object.

Parameters
vertsList of vertices.
indsList of indices.
vBufVulkan vertex buffer.
vMemGPU memory for vertex buffer.
iBufVulkan index buffer.
iMemGPU memory for index buffer.

Member Data Documentation

◆ gltfPath

std::string Mesh::gltfPath

Target glTF/glb file path.

◆ id

uint32_t Mesh::id = 0

Unique identifier for this mesh.

◆ indexBuffer

VkBuffer Mesh::indexBuffer { VK_NULL_HANDLE }

Vulkan buffer holding the index data.

◆ indexBufferMemory

VkDeviceMemory Mesh::indexBufferMemory { VK_NULL_HANDLE }

GPU memory backing the index data.

◆ indices

std::vector<uint32_t> Mesh::indices

CPU-side index data.

◆ isSkinned

bool Mesh::isSkinned = false

Whether this mesh has skin weights and is deformed on GPU.

◆ nodeName

std::string Mesh::nodeName

Name of the node associated with this mesh.

◆ parentBoneName

std::string Mesh::parentBoneName

Name of the parent bone/joint in glTF.

◆ primitiveIndex

int Mesh::primitiveIndex = -1

Index of the primitive submesh in glTF.

◆ vertexBuffer

VkBuffer Mesh::vertexBuffer { VK_NULL_HANDLE }

Vulkan buffer holding the vertex data.

◆ vertexBufferMemory

VkDeviceMemory Mesh::vertexBufferMemory { VK_NULL_HANDLE }

GPU memory backing the vertex buffer.

◆ vertices

std::vector<Vertex> Mesh::vertices

CPU-side vertex data.

◆ visible

bool Mesh::visible = true

Whether this mesh should be rendered.


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