UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FInstanceIdIndexMap Class Reference

#include <InstanceDataSceneProxy.h>

+ Inheritance diagram for FInstanceIdIndexMap:

Public Member Functions

 FInstanceIdIndexMap ()=default
 
bool IsIdentity () const
 
int32 GetMaxInstanceId () const
 
int32 GetMaxInstanceIndex () const
 
bool IsValidId (FPrimitiveInstanceId InstanceId) const
 
int32 IdToIndex (FPrimitiveInstanceId InstanceId) const
 
FPrimitiveInstanceId IndexToId (int32 InstanceIndex) const
 
void SetInvalid (FPrimitiveInstanceId InstanceId)
 
void Update (FPrimitiveInstanceId InstanceId, int32 InstanceIndex)
 
ENGINE_API void Reset (int32 InNumInstances)
 
ENGINE_API void ResizeExplicit (int32 InNumInstances, int32 MaxInstanceId)
 
ENGINE_API void CreateExplicitIdentityMapping ()
 
ENGINE_API void Serialize (FArchive &Ar)
 
ENGINE_API void RebuildFromIndexToIdMap (TArray< FPrimitiveInstanceId > &&InIndexToIdMap, int32 MaxInstanceId)
 

Protected Member Functions

ENGINE_API void RebuildFromIndexToIdMap (int32 MaxInstanceId)
 

Protected Attributes

TArray< FPrimitiveInstanceIdIndexToIdMap
 
TArray< int32IdToIndexMap
 
int32 NumInstances = 0
 

Constructor & Destructor Documentation

◆ FInstanceIdIndexMap()

FInstanceIdIndexMap::FInstanceIdIndexMap ( )
default

Member Function Documentation

◆ CreateExplicitIdentityMapping()

void FInstanceIdIndexMap::CreateExplicitIdentityMapping ( )

Convert an implicit identity mapping to an explicit one, by filling in the mapping arrays. Not allowed to be called if the mapping is already explicit.

◆ GetMaxInstanceId()

int32 FInstanceIdIndexMap::GetMaxInstanceId ( ) const
inline

Returms the upper bound on the instance ID represented as an integer, may be larger than the number of instances but is never larger than the max that has ever been allocated.

◆ GetMaxInstanceIndex()

int32 FInstanceIdIndexMap::GetMaxInstanceIndex ( ) const
inline

Returns the maximum instance index (or rather the maximum valid number plus one), AKA the number of instances represented.

◆ IdToIndex()

int32 FInstanceIdIndexMap::IdToIndex ( FPrimitiveInstanceId  InstanceId) const
inline

Translate from FPrimitiveInstanceId to Index

◆ IndexToId()

FPrimitiveInstanceId FInstanceIdIndexMap::IndexToId ( int32  InstanceIndex) const
inline

Translate from Index to FPrimitiveInstanceId

◆ IsIdentity()

bool FInstanceIdIndexMap::IsIdentity ( ) const
inline

Returns true if the mapping is an identity mapping. I.e., each instance ID corresponds to the same index.

◆ IsValidId()

bool FInstanceIdIndexMap::IsValidId ( FPrimitiveInstanceId  InstanceId) const
inline

Returns true if InstanceId is in the mapped range AND .

◆ RebuildFromIndexToIdMap() [1/2]

void FInstanceIdIndexMap::RebuildFromIndexToIdMap ( int32  MaxInstanceId)
protected

◆ RebuildFromIndexToIdMap() [2/2]

void FInstanceIdIndexMap::RebuildFromIndexToIdMap ( TArray< FPrimitiveInstanceId > &&  InIndexToIdMap,
int32  MaxInstanceId 
)

◆ Reset()

void FInstanceIdIndexMap::Reset ( int32  InNumInstances)

Reset the mapping to an identity map of size InNumInstances.

◆ ResizeExplicit()

void FInstanceIdIndexMap::ResizeExplicit ( int32  InNumInstances,
int32  MaxInstanceId 
)

Make sure the mapping is explicit and add enough space to accommodate the InNumInstances & MaxInstanceId.

◆ Serialize()

void FInstanceIdIndexMap::Serialize ( FArchive Ar)

◆ SetInvalid()

void FInstanceIdIndexMap::SetInvalid ( FPrimitiveInstanceId  InstanceId)
inline

Set the index mapping for the given InstanceId to INDEX_NONE.

◆ Update()

void FInstanceIdIndexMap::Update ( FPrimitiveInstanceId  InstanceId,
int32  InstanceIndex 
)
inline

Update the mapping from ID to index (and vice versa). Does not reset any previous mapping for the given ID.

Member Data Documentation

◆ IdToIndexMap

TArray<int32> FInstanceIdIndexMap::IdToIndexMap
protected

◆ IndexToIdMap

TArray<FPrimitiveInstanceId> FInstanceIdIndexMap::IndexToIdMap
protected

◆ NumInstances

int32 FInstanceIdIndexMap::NumInstances = 0
protected

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