|
Avara3D 0.2.0
C++ API reference
|
Owns the vertex and optional index data for one mesh primitive. More...
#include <a3d/mesh/MeshElement.h>
Public Member Functions | |
| MeshElement (VertexLayout layout, std::span< const std::byte > vertexBytes, uint32_t vertexCount, uint16_t vertexStride, PrimitiveTopology topology, IndexFormat indexFormat, std::span< const std::byte > indexBytes, uint32_t indexCount) | |
| Creates a MeshElement by copying the supplied vertex and index data. More... | |
Owns the vertex and optional index data for one mesh primitive.
MeshElement corresponds roughly to what many 3D APIs call a "submesh" or "mesh primitive." SceneKit calls the analogous concept a "geometry element," while glTF uses the term "mesh primitive."
Definition at line 43 of file MeshElement.h.
| a3d::MeshElement::MeshElement | ( | VertexLayout | layout, |
| std::span< const std::byte > | vertexBytes, | ||
| uint32_t | vertexCount, | ||
| uint16_t | vertexStride, | ||
| PrimitiveTopology | topology, | ||
| IndexFormat | indexFormat, | ||
| std::span< const std::byte > | indexBytes, | ||
| uint32_t | indexCount | ||
| ) |
Creates a MeshElement by copying the supplied vertex and index data.
The input byte spans do not need to outlive the MeshElement. For a non-indexed element, use IndexFormat::None with an index count of zero and an empty index span.
| layout | layout of each vertex record. |
| vertexBytes | source bytes containing at least vertexCount records. |
| vertexCount | number of vertices. |
| vertexStride | size in bytes of one vertex record. |
| topology | primitive topology represented by the data. |
| indexFormat | format of each index, or IndexFormat::None for non-indexed geometry. |
| indexBytes | source index bytes for indexed geometry. |
| indexCount | number of indices for indexed geometry. |
| std::runtime_error | if a supplied byte span is too small for its declared count and stride. |