Class Model

Inheritance Relationships

Base Type

Class Documentation

class Model : public Cacao::Resource

A resource representation of a model file, containing meshes and textures found within.

Public Functions

const std::vector<std::string> ListMeshes()

Get a list of stored meshes.

Returns:

Mesh ID list

const std::vector<std::string> ListTextures()

Get a list of stored textures.

Returns:

Texture ID list

std::shared_ptr<Mesh> GetMesh(const std::string &id)

Retrieve a stored Mesh by its ID.

Parameters:

id – The ID of the mesh to retrieve

Throws:

NonexistentValueException – If the provided ID is not found in meshList

Returns:

A handle to the mesh resource

std::shared_ptr<Tex2D> GetTexture(const std::string &id)

Retrieve a stored Tex2D by its ID.

Parameters:

id – The ID of the texture to retrieve

Throws:

NonexistentValueException – If the provided ID is not found in texList

Returns:

A handle to the texture resource

~Model()

Public Static Functions

static inline std::shared_ptr<Model> Create(std::vector<unsigned char> &&modelBin, const std::string &addr)

Create a new model from data.

Parameters:
  • modelBin – A blob of model data encoded as FBX Binary, glTF Binary (.glb), Collada, or Wavefront OBJ

  • addr – The resource address identifier to associate with the model