Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Render::MeshInstanceManager Class Reference

The MeshInstanceManager tracks the mesh/material combinations that can be instanced. More...

#include <MeshInstanceManager.h>

Public Types

using Handle = MeshInstanceGroupList::WeakHandle
 
using InsertResult = MeshInstanceGroupList::InsertResult
 
using ParallelRanges = MeshInstanceGroupList::ParallelRanges
 

Public Member Functions

InsertResult AddInstance (MeshInstanceGroupKey meshInstanceGroupData)
 
void RemoveInstance (MeshInstanceGroupKey meshInstanceGroupData)
 
void RemoveInstance (Handle handle)
 
uint32_t GetInstanceGroupCount () const
 Get the total number of instance groups being managed by the MeshInstanceManager.
 
MeshInstanceGroupDataoperator[] (Handle handle)
 Constant O(1) access to a MeshInstanceGroup via its handle.
 
ParallelRanges GetParallelRanges ()
 Get begin and end iterators for each page in the MeshInstanceGroup, which can be processed in parallel.
 

Detailed Description

The MeshInstanceManager tracks the mesh/material combinations that can be instanced.

Member Function Documentation

◆ AddInstance()

InsertResult AZ::Render::MeshInstanceManager::AddInstance ( MeshInstanceGroupKey  meshInstanceGroupData)

Increase the ref-count for an instance group if one already exists for the given key, or add a new instance group if it doesn't exist. Returns an InsertResult with a weak handle to the data and the ref-count for the instance group after adding this instance.

◆ RemoveInstance() [1/2]

void AZ::Render::MeshInstanceManager::RemoveInstance ( Handle  handle)

Decrease the ref-count for an instance group, and remove it if the ref-count drops to 0. The MeshInstanceManager keeps a copy of the MeshInstanceGroupKey alongside the data, so removing by handle is just as performance as removing by key.

◆ RemoveInstance() [2/2]

void AZ::Render::MeshInstanceManager::RemoveInstance ( MeshInstanceGroupKey  meshInstanceGroupData)

Decrease the ref-count for an instance group, and remove it if the ref-count drops to 0. The MeshInstanceManager keeps a copy of the MeshInstanceGroupKey alongside the data, so removing by handle is just as performance as removing by key.


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