Class MeshCache

Class Documentation

class legion::core::MeshCache

Data cache for loading, storing and managing raw meshes.

Public Static Functions

static mesh_handle create_mesh(const std::string &name, const filesystem::view &file, mesh_import_settings settings = default_mesh_settings)

Create a new mesh and load it from a file if a mesh with the same name doesn’t exist yet.

Return

mesh_handle A valid handle to the newly created mesh if it succeeds, invalid_mesh_handle if it fails.

Parameters
  • name: Identifying name for the mesh.

  • file: File to load from.

  • settings: Settings to pass on to the import pipeline.

static mesh_handle create_mesh(const std::string &name, const mesh &mesh)
static mesh_handle copy_mesh(const std::string &name, const std::string &newName)

Copy a mesh with a certain name to a new name. Will overwrite the destination if that mesh already existed.

Return

mesh_handle A valid handle to the copy.

Parameters
  • name: Source name

  • newName: Destination name

static mesh_handle copy_mesh(id_type id, const std::string &newName)

Copy a mesh with a certain name to a new name. Will overwrite the destination if that mesh already existed.

Return

mesh_handle A valid handle to the copy.

Parameters
  • id: Source name hash

  • newName: Destination name

static mesh_handle get_handle(const std::string &name)

Returns a handle to a mesh with a certain name. Will return invalid_mesh_handle if the requested mesh doesn’t exist.

static mesh_handle get_handle(id_type id)

Returns a handle to a mesh with a certain name. Will return invalid_mesh_handle if the requested mesh doesn’t exist.

Parameters
  • id: Name hash

static void destroy_mesh(id_type id)

Public Static Attributes

static id_type debugId