|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| void MayaFlux::Kakshya::MeshInsertion::insert_submesh | ( | std::span< const uint8_t > | vertex_bytes, |
| std::span< const uint32_t > | index_data, | ||
| std::string_view | name = {}, |
||
| std::string_view | material_name = {}, |
||
| const VertexLayout & | layout = VertexLayout::for_meshes(60) |
||
| ) |
Append one submesh batch, accumulating into the shared buffers.
Vertex bytes are appended to the existing vector<uint8_t>; indices are offset by the current vertex count and appended to vector<uint32_t>. A Region is added to the internal submesh RegionGroup recording the index sub-range and names.
layout is taken from the first call; subsequent calls must have the same stride_bytes and attribute count. Mismatches log an error and skip the batch.
| vertex_bytes | Raw interleaved vertex data for this submesh. |
| index_data | Triangle indices local to this submesh (0-based). |
| name | Submesh name (may be empty). |
| material_name | Material name (may be empty). |
| layout | Vertex layout; ignored after first call. |
Definition at line 101 of file MeshInsertion.cpp.
References ensure_index_storage(), ensure_vertex_storage(), MayaFlux::Kakshya::MeshSubrange::index_count, MayaFlux::Kakshya::MeshSubrange::index_start, MayaFlux::Journal::Kakshya, m_index_count, m_index_variant, m_layout, m_layout_set, m_submeshes, m_vertex_count, m_vertex_variant, MayaFlux::Kakshya::MeshSubrange::material_name, MF_DEBUG, MF_ERROR, MayaFlux::Kakshya::MeshSubrange::name, MayaFlux::Journal::Runtime, MayaFlux::Kakshya::VertexLayout::stride_bytes, MayaFlux::Kakshya::MeshSubrange::to_region(), validate_layout(), MayaFlux::Kakshya::VertexLayout::vertex_count, and MayaFlux::Kakshya::MeshSubrange::vertex_offset.
Here is the call graph for this function: