MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ vertex_count()

uint32_t MayaFlux::Kakshya::MeshData::vertex_count ( ) const
inlinenoexcept

Number of vertices derived from vertex byte count and layout stride.

Returns
0 if layout stride is zero or vertex_variant holds wrong type.

Definition at line 78 of file MeshData.hpp.

79 {
80 if (layout.stride_bytes == 0) {
81 return 0;
82 }
83 const auto* vb = std::get_if<std::vector<uint8_t>>(&vertex_variant);
84 if (!vb) {
85 return 0;
86 }
87 return static_cast<uint32_t>(vb->size() / layout.stride_bytes);
88 }
DataVariant vertex_variant
vector<uint8_t>: interleaved vertex bytes
Definition MeshData.hpp:34
uint32_t stride_bytes
Total bytes per vertex (stride in Vulkan terms) e.g., 3 floats (position) + 3 floats (normal) = 24 by...

References MayaFlux::Kakshya::VertexLayout::stride_bytes.