Class Mesh

Inheritance Relationships

Base Type

Class Documentation

class Mesh : public Cacao::Asset

Asset type for 3D mesh data.

Public Functions

virtual void Realize()

Convert the mesh data into a form suitable for rendering.

Throws:
  • BadRealizeStateException – If the mesh is already realized

  • BadInitStateException – If the graphics backend is not initialized or connected

virtual void DropRealized()

Destroy the realized representation of the asset.

Throws:
  • BadRealizeStateException – If the mesh is not realized

  • BadInitStateException – If the graphics backend is not initialized or connected

~Mesh()

Public Static Functions

static inline std::shared_ptr<Mesh> Create(std::vector<Vertex> &&vtx, std::vector<glm::uvec3> &&idx, const std::string &addr)

Create a new mesh from vertex and index data.

Parameters:
  • vtx – The vertices of the mesh

  • idx – The indices of the mesh, grouped in sets of triangles, corresponding to the vertex index in vtx

  • addr – The resource address to associate with the mesh

Throws:
  • BadValueException – If the vertex or index data is empty

  • BadValueException – If the address is malformed