esp::assets::BaseMesh class

Base class for storing mesh asset data including geometry and topology.

Also manages transfer of this data to GPU memory. Derived classes implement modifications to support specific mesh formats as enumerated by SupportedMeshType.

Derived classes

class GenericInstanceMeshData
class GenericMeshData
Mesh data storage and loading for gltf format assets. See ResourceManager::loadGeneralMeshData.
class PTexMeshData

Constructors, destructors, conversion operators

BaseMesh(SupportedMeshType type) explicit
Constructor defining the SupportedMeshType of this asset and likely identifying the derived type of this object.
~BaseMesh() virtual
Destructor.

Public functions

auto setMeshType(SupportedMeshType type) -> bool
Set the SupportedMeshType, type_, of this object.
auto getMeshType() -> SupportedMeshType
Retrieve the SupportedMeshType, type_, of this object.
void uploadBuffersToGPU(bool) virtual
Upload the mesh data to GPU memory.
auto getMagnumGLMesh() -> Magnum::GL::Mesh* virtual
Get a pointer to the compiled rendering buffer for the asset.
auto getMagnumGLMesh(int) -> Magnum::GL::Mesh* virtual
Get a pointer to the compiled rendering buffer for a particular sub-component of the asset.
auto getMeshData() -> Corrade::Containers::Optional<Magnum::Trade::MeshData>&
auto getCollisionMeshData() -> CollisionMeshData& virtual
Get a reference to the collisionMeshData_ (non-render geometry and topology) for the asset.

Public variables

Magnum::Matrix4 meshTransform_
Any transformations applied to the original mesh after loading are stored here.
Magnum::Range3D BB
Axis aligned bounding box of the mesh.

Protected variables

SupportedMeshType type_
Identifies the derived type of this object and the format of the asset.
bool buffersOnGPU_
Whether or not the mesh data has been transfered to GPU.
Corrade::Containers::Optional<Magnum::Trade::MeshData> meshData_
Optional storage container for mesh render data.
CollisionMeshData collisionMeshData_
Stores references to mesh geometry and topology for use in CPU side physics collision shape generation.

Function documentation

bool esp::assets::BaseMesh::setMeshType(SupportedMeshType type)

Set the SupportedMeshType, type_, of this object.

Parameters
type The desired SupportedMeshType to set.
Returns Whether or not the set was successful.

SupportedMeshType esp::assets::BaseMesh::getMeshType()

Retrieve the SupportedMeshType, type_, of this object.

Returns the SupportedMeshType, type_, of this object.

void esp::assets::BaseMesh::uploadBuffersToGPU(bool) virtual

Upload the mesh data to GPU memory.

Virtual with no implementation for BaseMesh.

Magnum::GL::Mesh* esp::assets::BaseMesh::getMagnumGLMesh() virtual

Get a pointer to the compiled rendering buffer for the asset.

Returns A pointer to the compiled rendering buffer for the asset.

Always nullptr for BaseMesh.

Magnum::GL::Mesh* esp::assets::BaseMesh::getMagnumGLMesh(int) virtual

Get a pointer to the compiled rendering buffer for a particular sub-component of the asset.

Returns A pointer to the compiled rendering buffer for a particular sub-component of the asset.

Always nullptr for BaseMesh.

CollisionMeshData& esp::assets::BaseMesh::getCollisionMeshData() virtual

Get a reference to the collisionMeshData_ (non-render geometry and topology) for the asset.

Returns The CollisionMeshData, collisionMeshData_.

Usage: (1) physics simulation.

Variable documentation

Magnum::Matrix4 esp::assets::BaseMesh::meshTransform_

Any transformations applied to the original mesh after loading are stored here.

See ResourceManager::translateMesh.

Magnum::Range3D esp::assets::BaseMesh::BB

Axis aligned bounding box of the mesh.

Computed automatically on mesh load. See ResourceManager::computeMeshBB.

Corrade::Containers::Optional<Magnum::Trade::MeshData> esp::assets::BaseMesh::meshData_ protected

Optional storage container for mesh render data.

See GenericMeshData::setMeshData.

CollisionMeshData esp::assets::BaseMesh::collisionMeshData_ protected

Stores references to mesh geometry and topology for use in CPU side physics collision shape generation.

Should be updated when mesh data is edited.