Avara3D 0.2.0
C++ API reference
a3d::MeshElement Class Reference

Owns the vertex and optional index data for one mesh primitive. More...

#include <a3d/mesh/MeshElement.h>

Inheritance diagram for a3d::MeshElement:
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MeshElement()

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.

Parameters
layoutlayout of each vertex record.
vertexBytessource bytes containing at least vertexCount records.
vertexCountnumber of vertices.
vertexStridesize in bytes of one vertex record.
topologyprimitive topology represented by the data.
indexFormatformat of each index, or IndexFormat::None for non-indexed geometry.
indexBytessource index bytes for indexed geometry.
indexCountnumber of indices for indexed geometry.
Exceptions
std::runtime_errorif a supplied byte span is too small for its declared count and stride.

The documentation for this class was generated from the following file: