UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FISMComponentBatcher Struct Reference

#include <ISMComponentBatcher.h>

Classes

struct  FComponentToInstancesMapping
 

Public Member Functions

 FISMComponentBatcher ()
 
 FISMComponentBatcher (bool bInBuildMappingInfo)
 
ENGINE_API void Add (const UActorComponent *InActorComponent)
 
ENGINE_API void Add (const UActorComponent *InActorComponent, TFunctionRef< FTransform(const FTransform &)> InTransformFunc)
 
ENGINE_API void Add (const UActorComponent *InComponent, TFunctionRef< bool(const FBox &)> InFilterFunc)
 
ENGINE_API void Add (const UActorComponent *InComponent, TFunctionRef< FTransform(const FTransform &)> InTransformFunc, TFunctionRef< bool(const FBox &)> InFilterFunc)
 
template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void Append (const TArray< TComponentClass * > &InComponents)
 
template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void Append (const TArray< TComponentClass * > &InComponents, TFunctionRef< FTransform(const FTransform &)> InTransformFunc)
 
template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void Append (const TArray< TComponentClass * > &InComponents, TFunctionRef< bool(const FBox &)> InFilterFunc)
 
template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void Append (const TArray< TComponentClass * > &InComponents, TFunctionRef< FTransform(const FTransform &)> InTransformFunc, TFunctionRef< bool(const FBox &)> InFilterFunc)
 
int32 GetNumInstances () const
 
ENGINE_API void InitComponent (UInstancedStaticMeshComponent *ISMComponent) const
 
ENGINE_API void InitComponent (UInstancedSkinnedMeshComponent *ISMComponent) const
 
uint32 GetHash () const
 
ENGINE_API TArray< FComponentToInstancesMappingGetComponentsToInstancesMap ()
 

Protected Member Functions

void ENGINE_API AddInternal (const UActorComponent *InComponent, TOptional< TFunctionRef< FTransform(const FTransform &)> > InTransformFunc, TOptional< TFunctionRef< bool(const FBox &)> > InFilterFunc)
 
void ENGINE_API ComputeHash () const
 

Protected Attributes

uint32 Hash = 0
 
int32 NumInstances = 0
 
int32 NumCustomDataFloats = 0
 
TArray< FTransformInstancesTransformsWS
 
TArray< floatInstancesCustomData
 
int32 InstancingRandomSeed = 0
 
TArray< FInstancedStaticMeshRandomSeedAdditionalRandomSeeds
 
TArray< int32AnimationIndices
 
bool bBuildMappingInfo = false
 
TArray< FComponentToInstancesMappingComponentsToInstancesMap
 

Detailed Description

Struct that allows batching of transforms and custom data of multiple (possibly instanced) static mesh components

Constructor & Destructor Documentation

◆ FISMComponentBatcher() [1/2]

FISMComponentBatcher::FISMComponentBatcher ( )
inline

◆ FISMComponentBatcher() [2/2]

FISMComponentBatcher::FISMComponentBatcher ( bool  bInBuildMappingInfo)
inline

Member Function Documentation

◆ Add() [1/4]

void FISMComponentBatcher::Add ( const UActorComponent InActorComponent)

Add a single component to be batched

Parameters
InActorComponentComponent to be batched

◆ Add() [2/4]

void FISMComponentBatcher::Add ( const UActorComponent InActorComponent,
TFunctionRef< FTransform(const FTransform &)>  InTransformFunc 
)

Add a single component to be batched

Parameters
InActorComponentComponent to be batched
InTransformFuncFunction that takes the world space transform of an instance and modifies it. Must return a world space transform.

◆ Add() [3/4]

void FISMComponentBatcher::Add ( const UActorComponent InComponent,
TFunctionRef< bool(const FBox &)>  InFilterFunc 
)

Add a single component to be batched

Parameters
InActorComponentComponent to be batched
InFilterFuncFunction that can be used to filter out instances based on their world bounds.

◆ Add() [4/4]

void FISMComponentBatcher::Add ( const UActorComponent InComponent,
TFunctionRef< FTransform(const FTransform &)>  InTransformFunc,
TFunctionRef< bool(const FBox &)>  InFilterFunc 
)

Add a single component to be batched

Parameters
InActorComponentComponent to be batched
InTransformFuncFunction that takes the world space transform of an instance and modifies it. Must return a world space transform.
InFilterFuncFunction that can be used to filter out instances based on their world bounds.

◆ AddInternal()

void FISMComponentBatcher::AddInternal ( const UActorComponent InComponent,
TOptional< TFunctionRef< FTransform(const FTransform &)> >  InTransformFunc,
TOptional< TFunctionRef< bool(const FBox &)> >  InFilterFunc 
)
protected

◆ Append() [1/4]

template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void FISMComponentBatcher::Append ( const TArray< TComponentClass * > &  InComponents)
inline

Add an array of component to be batched

Parameters
InComponentsComponents to be batched

◆ Append() [2/4]

template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void FISMComponentBatcher::Append ( const TArray< TComponentClass * > &  InComponents,
TFunctionRef< bool(const FBox &)>  InFilterFunc 
)
inline

Add an array of components to be batched

Parameters
InComponentsComponents to be batched
InFilterFuncFunction that can be used to filter out instances based on their world bounds.

◆ Append() [3/4]

template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void FISMComponentBatcher::Append ( const TArray< TComponentClass * > &  InComponents,
TFunctionRef< FTransform(const FTransform &)>  InTransformFunc 
)
inline

Add an array of components to be batched

Parameters
InComponentsComponents to be batched
InTransformFuncFunction that takes the world space transform of an instance and modifies it. Must return a world space transform.

◆ Append() [4/4]

template<typename TComponentClass = UActorComponent, typename = typename TEnableIf<TIsDerivedFrom<TComponentClass, UActorComponent>::IsDerived>::Type>
void FISMComponentBatcher::Append ( const TArray< TComponentClass * > &  InComponents,
TFunctionRef< FTransform(const FTransform &)>  InTransformFunc,
TFunctionRef< bool(const FBox &)>  InFilterFunc 
)
inline

Add an array of components to be batched

Parameters
InComponentsComponents to be batched
InFilterFuncFunction that can be used to filter out instances based on their world bounds.
InTransformFuncFunction that takes the world space transform of an instance and modifies it. Must return a world space transform.

◆ ComputeHash()

void FISMComponentBatcher::ComputeHash ( ) const
protected

◆ GetComponentsToInstancesMap()

TArray< FISMComponentBatcher::FComponentToInstancesMapping > FISMComponentBatcher::GetComponentsToInstancesMap ( )

Retrieve the component to instances mapping. Will only be populated if bBuildMappingInfo=true is provided to the batcher's constructor.

◆ GetHash()

uint32 FISMComponentBatcher::GetHash ( ) const
inline

◆ GetNumInstances()

int32 FISMComponentBatcher::GetNumInstances ( ) const
inline

Return the number of instances batched so far.

◆ InitComponent() [1/2]

void FISMComponentBatcher::InitComponent ( UInstancedSkinnedMeshComponent *  ISMComponent) const

Initialize the instances of the provided instanced skinned mesh component using the batched data stored in this class.

Parameters
ISMComponentInstanced skinned mesh component which will be modified.

◆ InitComponent() [2/2]

void FISMComponentBatcher::InitComponent ( UInstancedStaticMeshComponent ISMComponent) const

Initialize the instances of the provided instanced static mesh component using the batched data stored in this class.

Parameters
ISMComponentInstanced static mesh component which will be modified.

Member Data Documentation

◆ AdditionalRandomSeeds

TArray<FInstancedStaticMeshRandomSeed> FISMComponentBatcher::AdditionalRandomSeeds
protected

◆ AnimationIndices

TArray<int32> FISMComponentBatcher::AnimationIndices
protected

◆ bBuildMappingInfo

bool FISMComponentBatcher::bBuildMappingInfo = false
protected

◆ ComponentsToInstancesMap

TArray<FComponentToInstancesMapping> FISMComponentBatcher::ComponentsToInstancesMap
protected

◆ Hash

uint32 FISMComponentBatcher::Hash = 0
mutableprotected

◆ InstancesCustomData

TArray<float> FISMComponentBatcher::InstancesCustomData
protected

◆ InstancesTransformsWS

TArray<FTransform> FISMComponentBatcher::InstancesTransformsWS
protected

◆ InstancingRandomSeed

int32 FISMComponentBatcher::InstancingRandomSeed = 0
protected

◆ NumCustomDataFloats

int32 FISMComponentBatcher::NumCustomDataFloats = 0
protected

◆ NumInstances

int32 FISMComponentBatcher::NumInstances = 0
protected

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