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

#include <InstancedStaticMeshComponent.h>

+ Inheritance diagram for UInstancedStaticMeshComponent:

Public Member Functions

int32 GetRenderIndex (int32 InInstanceIndex) const
 
virtual ENGINE_API int32 AddInstance (const FTransform &InstanceTransform, bool bWorldSpace=false)
 
virtual ENGINE_API TArray< int32AddInstances (const TArray< FTransform > &InstanceTransforms, bool bShouldReturnIndices, bool bWorldSpace=false, bool bUpdateNavigation=true)
 
int32 AddInstanceWorldSpace (const FTransform &WorldTransform)
 
int32 GetNumInstances () const
 
ENGINE_API TArray< FPrimitiveInstanceIdAddInstancesById (const TArrayView< const FTransform > &InstanceTransforms, bool bWorldSpace=false, bool bUpdateNavigation=true)
 
ENGINE_API FPrimitiveInstanceId AddInstanceById (const FTransform &InstanceTransforms, bool bWorldSpace=false)
 
ENGINE_API void SetCustomDataById (const TArrayView< const FPrimitiveInstanceId > &InstanceIds, TArrayView< const float > CustomDataFloats)
 
void SetCustomDataById (FPrimitiveInstanceId InstanceId, TArrayView< const float > CustomDataFloats)
 
ENGINE_API void SetCustomDataValueById (FPrimitiveInstanceId InstanceId, int32 CustomDataIndex, float CustomDataValue)
 
virtual ENGINE_API void RemoveInstancesById (const TArrayView< const FPrimitiveInstanceId > &InstanceIds, bool bUpdateNavigation=true)
 
void RemoveInstanceById (FPrimitiveInstanceId InstanceId)
 
ENGINE_API void UpdateInstanceTransformById (FPrimitiveInstanceId InstanceId, const FTransform &NewInstanceTransform, bool bWorldSpace=false, bool bTeleport=false)
 
ENGINE_API void SetPreviousTransformById (FPrimitiveInstanceId InstanceId, const FTransform &NewPrevInstanceTransform, bool bWorldSpace=false)
 
ENGINE_API bool IsValidId (FPrimitiveInstanceId InstanceId)
 
int32 GetInstanceIndexForId (FPrimitiveInstanceId InstanceId) const
 
ENGINE_API void SetHasPerInstancePrevTransforms (bool bInHasPreviousTransforms)
 
virtual ENGINE_API bool SetCustomDataValue (int32 InstanceIndex, int32 CustomDataIndex, float CustomDataValue, bool bMarkRenderStateDirty=false)
 
virtual ENGINE_API void SetNumCustomDataFloats (int32 InNumCustomDataFloats)
 
virtual ENGINE_API bool SetCustomData (int32 InstanceIndex, TArrayView< const float > CustomDataFloats, bool bMarkRenderStateDirty=false)
 
virtual ENGINE_API bool SetCustomData (int32 InstanceIndexStart, int32 InstanceIndexEnd, TConstArrayView< float > CustomDataFloats, bool bMarkRenderStateDirty=false)
 
virtual ENGINE_API void PreAllocateInstancesMemory (int32 AddedInstanceCount)
 
ENGINE_API bool GetInstanceTransform (int32 InstanceIndex, FTransform &OutInstanceTransform, bool bWorldSpace=false) const
 
float GetLODDistanceScale () const
 
ENGINE_API void SetLODDistanceScale (float InLODDistanceScale)
 
ENGINE_API bool GetInstancePrevTransform (int32 InstanceIndex, FTransform &OutInstanceTransform, bool bWorldSpace=false) const
 
virtual ENGINE_API void OnUpdateTransform (EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport) override
 
ENGINE_API void UpdateComponentTransform (EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport)
 
virtual ENGINE_API float GetTextureStreamingTransformScale () const override
 
virtual ENGINE_API bool GetMaterialStreamingData (int32 MaterialIndex, FPrimitiveMaterialInfo &MaterialData) const override
 
virtual ENGINE_API bool BuildTextureStreamingDataImpl (ETextureStreamingBuildType BuildType, EMaterialQualityLevel::Type QualityLevel, ERHIFeatureLevel::Type FeatureLevel, TSet< FGuid > &DependentResources, bool &bOutSupportsBuildTextureStreamingData) override
 
virtual ENGINE_API void GetStreamingRenderAssetInfo (FStreamingTextureLevelContext &LevelContext, TArray< FStreamingRenderAssetPrimitiveInfo > &OutStreamingRenderAssets) const override
 
virtual ENGINE_API bool UpdateInstanceTransform (int32 InstanceIndex, const FTransform &NewInstanceTransform, bool bWorldSpace=false, bool bMarkRenderStateDirty=false, bool bTeleport=false)
 
virtual ENGINE_API bool BatchUpdateInstancesTransforms (int32 StartInstanceIndex, const TArray< FTransform > &NewInstancesTransforms, bool bWorldSpace=false, bool bMarkRenderStateDirty=false, bool bTeleport=false)
 
virtual ENGINE_API bool BatchUpdateInstancesTransforms (int32 StartInstanceIndex, TArrayView< const FTransform > NewInstancesTransforms, bool bWorldSpace=false, bool bMarkRenderStateDirty=false, bool bTeleport=false)
 
virtual ENGINE_API bool BatchUpdateInstancesTransforms (int32 StartInstanceIndex, const TArray< FTransform > &NewInstancesTransforms, const TArray< FTransform > &NewInstancesPrevTransforms, bool bWorldSpace=false, bool bMarkRenderStateDirty=false, bool bTeleport=false)
 
virtual ENGINE_API bool BatchUpdateInstancesTransform (int32 StartInstanceIndex, int32 NumInstances, const FTransform &NewInstancesTransform, bool bWorldSpace=false, bool bMarkRenderStateDirty=false, bool bTeleport=false)
 
virtual ENGINE_API bool BatchUpdateInstancesData (int32 StartInstanceIndex, int32 NumInstances, FInstancedStaticMeshInstanceData *StartInstanceData, bool bMarkRenderStateDirty=false, bool bTeleport=false)
 
virtual ENGINE_API bool RemoveInstance (int32 InstanceIndex)
 
virtual ENGINE_API bool RemoveInstances (const TArray< int32 > &InstancesToRemove)
 
virtual ENGINE_API bool RemoveInstances (const TArray< int32 > &InstancesToRemove, bool bInstanceArrayAlreadySortedInReverseOrder)
 
virtual ENGINE_API void ClearInstances ()
 
ENGINE_API int32 GetInstanceCount () const
 
ENGINE_API bool IsValidInstance (int32 InstanceIndex) const
 
ENGINE_API void SetCullDistances (int32 StartCullDistance, int32 EndCullDistance)
 
void GetCullDistances (int32 &OutStartCullDistance, int32 &OutEndCullDistance) const
 
virtual ENGINE_API TArray< int32GetInstancesOverlappingSphere (const FVector &Center, float Radius, bool bSphereInWorldSpace=true) const
 
virtual ENGINE_API TArray< int32GetInstancesOverlappingBox (const FBox &Box, bool bBoxInWorldSpace=true) const
 
virtual ENGINE_API bool ShouldCreatePhysicsState () const override
 
virtual ENGINE_API void PostLoad () override
 
virtual ENGINE_API void OnRegister () override
 
virtual ENGINE_API void OnUnregister () override
 
void SetRemoveSwap ()
 
virtual ENGINE_API bool SupportsRemoveSwap () const
 
void SetUseConservativeBounds (bool bValue)
 
ENGINE_API FInstanceDataFlags MakeInstanceDataFlags (bool bAnyMaterialHasPerInstanceRandom, bool bAnyMaterialHasPerInstanceCustomData) const
 
virtual ENGINE_API TStructOnScope< FActorComponentInstanceDataGetComponentInstanceData () const override
 
virtual ENGINE_API void GetComponentChildElements (TArray< FTypedElementHandle > &OutElementHandles, const bool bAllowCreate=true) override
 
virtual ENGINE_API bool IsHLODRelevant () const override
 
virtual ENGINE_API void SendRenderInstanceData_Concurrent () override
 
virtual ENGINE_API FPrimitiveSceneProxyCreateSceneProxy () override
 
virtual ENGINE_API FMatrix GetRenderMatrix () const override
 
virtual ENGINE_API FBodyInstanceGetBodyInstance (FName BoneName=NAME_None, bool bGetWelded=true, int32 Index=INDEX_NONE) const override
 
virtual ENGINE_API void RecreateInstanceBody (int32 InstanceBodyIndex) override
 
virtual ENGINE_API bool CanEditSimulatePhysics () override
 
virtual ENGINE_API FBoxSphereBounds CalcBounds (const FTransform &BoundTransform) const override
 
virtual ENGINE_API void UpdateBounds () override
 
virtual bool SupportsStaticLighting () const override
 
virtual ENGINE_API void GetLightAndShadowMapMemoryUsage (int32 &LightMapMemoryUsage, int32 &ShadowMapMemoryUsage) const override
 
virtual ENGINE_API bool DoCustomNavigableGeometryExport (FNavigableGeometryExport &GeomExport) const override
 
virtual ENGINE_API bool LineTraceComponent (FHitResult &OutHit, const FVector Start, const FVector End, const FCollisionQueryParams &Params) override
 
virtual ENGINE_API bool SweepComponent (FHitResult &OutHit, const FVector Start, const FVector End, const FQuat &ShapRotation, const FCollisionShape &CollisionShape, bool bTraceComplex=false) override
 
virtual ENGINE_API bool OverlapComponent (const FVector &Pos, const FQuat &Rot, const FCollisionShape &CollisionShape) const override
 
virtual ENGINE_API Chaos::FPhysicsObjectGetPhysicsObjectById (Chaos::FPhysicsObjectId Id) const override
 
virtual ENGINE_API TArray< Chaos::FPhysicsObject * > GetAllPhysicsObjects () const override
 
virtual ENGINE_API void GetNavigationData (FNavigationRelevantData &Data) const override
 
virtual ENGINE_API FBox GetNavigationBounds () const override
 
virtual ENGINE_API bool IsNavigationRelevant () const override
 
virtual ENGINE_API bool ShouldSkipDirtyAreaOnAddOrRemove () const override
 
virtual ENGINE_API void Serialize (FArchive &Ar) override
 
virtual ENGINE_API void GetResourceSizeEx (FResourceSizeEx &CumulativeResourceSize) override
 
virtual ENGINE_API void BeginDestroy () override
 
virtual ENGINE_API void PreSave (FObjectPreSaveContext ObjectSaveContext) override
 
virtual FVector GetTranslatedInstanceSpaceOrigin () const
 
ENGINE_API void PreApplyComponentInstanceData (struct FInstancedStaticMeshComponentInstanceData *ComponentInstanceData)
 
virtual ENGINE_API void ApplyComponentInstanceData (struct FInstancedStaticMeshComponentInstanceData *ComponentInstanceData)
 
ENGINE_API bool IsInstanceSelected (int32 InInstanceIndex) const
 
ENGINE_API void SelectInstance (bool bInSelected, int32 InInstanceIndex, int32 InInstanceCount=1)
 
ENGINE_API void ClearInstanceSelection ()
 
virtual ENGINE_API void CollectPSOPrecacheData (const FPSOPrecacheParams &BasePrecachePSOParams, FMaterialInterfacePSOPrecacheParamsList &OutParams) override
 
virtual int32 GetNumRenderInstances () const
 
virtual ENGINE_API void PropagateLightingScenarioChange () override
 
ENGINE_API void GetInstancesMinMaxScale (FVector &MinScale, FVector &MaxScale) const
 
void OnPostPopulatePerInstanceData ()
 
virtual ENGINE_API void PartialNavigationUpdate (int32 InstanceIdx)
 
virtual ENGINE_API void PartialNavigationUpdates (TConstArrayView< FTransform > InstanceTransforms)
 
ENGINE_API TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafeGetOrCreateInstanceDataSceneProxy ()
 
ENGINE_API const TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafe > & GetInstanceDataSceneProxy () const
 
ENGINE_API void SetBakedLightingDataChanged (int32 InInstanceIndex)
 
ENGINE_API void SetBakedLightingDataChangedAll ()
 
ENGINE_API void InvalidateInstanceDataTracking ()
 
FPrimitiveMaterialPropertyDescriptor GetUsedMaterialPropertyDesc (EShaderPlatform ShaderPlatform) const
 
FPrimitiveMaterialPropertyDescriptor GetUsedMaterialPropertyDesc (ERHIFeatureLevel::Type FeatureLevel) const
 
- Public Member Functions inherited from ISMInstanceManager
virtual FText GetSMInstanceDisplayName (const FSMInstanceId &InstanceId) const
 
virtual FText GetSMInstanceTooltip (const FSMInstanceId &InstanceId) const
 
virtual void ForEachSMInstanceInSelectionGroup (const FSMInstanceId &InstanceId, TFunctionRef< bool(FSMInstanceId)> Callback)
 
virtual bool CanDeleteSMInstance (const FSMInstanceId &InstanceId) const
 
virtual bool CanDuplicateSMInstance (const FSMInstanceId &InstanceId) const
 
virtual TSubclassOf< USMInstanceProxyEditingObjectGetSMInstanceEditingProxyClass () const
 

Public Attributes

TArray< int32InstanceReorderTable
 
SIZE_T ProxySize
 
TArray< FBodyInstance * > InstanceBodies
 

Protected Types

enum class  EBoundsCacheType : uint8 {
  Component , Navigation , Local , Count ,
  Other
}
 

Protected Member Functions

virtual ENGINE_API void OnCreatePhysicsState () override
 
virtual ENGINE_API void OnDestroyPhysicsState () override
 
virtual ENGINE_API bool OnAsyncDestroyPhysicsState (const UE::FTimeout &Timeout) override
 
virtual ENGINE_API void OnAsyncDestroyPhysicsStateBegin_GameThread () override
 
virtual ENGINE_API bool ComponentOverlapComponentImpl (class UPrimitiveComponent *PrimComp, const FVector Pos, const FQuat &Quat, const FCollisionQueryParams &Params) override
 
virtual ENGINE_API bool ComponentOverlapMultiImpl (TArray< struct FOverlapResult > &OutOverlaps, const class UWorld *InWorld, const FVector &Pos, const FQuat &Rot, ECollisionChannel TestChannel, const struct FComponentQueryParams &Params, const struct FCollisionObjectQueryParams &ObjectQueryParams=FCollisionObjectQueryParams::DefaultObjectQueryParam) const override
 
virtual ENGINE_API FPrimitiveSceneProxyCreateStaticMeshSceneProxy (Nanite::FMaterialAudit &NaniteMaterials, bool bCreateNanite) override
 
void InvalidateCachedBounds ()
 
ENGINE_API void CalcAndCacheNavigationBounds ()
 
ENGINE_API void CreateAllInstanceBodies ()
 
ENGINE_API void ClearAllInstanceBodies ()
 
virtual ENGINE_API void FullNavigationUpdate ()
 
FBoxSphereBounds CalcBoundsImpl (const FTransform &BoundTransform, bool bForNavigation) const
 
FBoxSphereBounds CalcBoundsImpl (const FTransform &BoundTransform, const FBox &InstanceBounds) const
 
virtual bool SupportsPartialNavigationUpdate () const
 
ENGINE_API int32 AddInstanceInternal (int32 InstanceIndex, FInstancedStaticMeshInstanceData *InNewInstanceData, const FTransform &InstanceTransform, bool bWorldSpace)
 
ENGINE_API TArray< int32AddInstancesInternal (TConstArrayView< FTransform > InstanceTransforms, bool bShouldReturnIndices, bool bWorldSpace, bool bUpdateNavigation=true)
 
ENGINE_API bool RemoveInstanceInternal (int32 InstanceIndex, bool InstanceAlreadyRemoved, bool bForceRemoveAtSwap=false, bool bUpdateNavigation=true)
 
FBox GetInstanceNavigationBounds () const
 
virtual ENGINE_API void GetNavigationPerInstanceTransforms (const FBox &AreaBox, TArray< FTransform > &InstanceData) const
 
ENGINE_API void InitInstanceBody (int32 InstanceIdx, FBodyInstance *InBodyInstance)
 
ENGINE_API void InitInstanceBody (int32 InstanceIdx, FBodyInstance *InstanceBodyInstance, FBodyInstance *ReferenceBodyInstance, bool bRuntimeBodyInstance, UBodySetup *BodySetup)
 
ENGINE_API void ApplyLightMapping (FStaticLightingTextureMapping_InstancedStaticMesh *InMapping, const FStaticLightingBuildContext *LightingContext)
 
ENGINE_API void CreateHitProxyData (TArray< TRefCountPtr< HHitProxy > > &HitProxies)
 
ENGINE_API void BuildLegacyRenderData (FStaticMeshInstanceData &OutData)
 
ENGINE_API void SerializeRenderData (FArchive &Ar)
 
virtual ENGINE_API void OnPostLoadPerInstanceData ()
 
ENGINE_API void BuildInstanceDataDeltaChangeSetCommon (FISMInstanceUpdateChangeSet &ChangeSet)
 
virtual ENGINE_API void BuildComponentInstanceData (ERHIFeatureLevel::Type FeatureLevel, FInstanceUpdateComponentDesc &OutData)
 
virtual ENGINE_API void BuildComponentInstanceData (EShaderPlatform InShaderPlatform, FInstanceUpdateComponentDesc &OutData)
 
virtual ENGINE_API bool CanEditSMInstance (const FSMInstanceId &InstanceId) const override
 
virtual ENGINE_API bool CanMoveSMInstance (const FSMInstanceId &InstanceId, const ETypedElementWorldType InWorldType) const override
 
virtual ENGINE_API bool GetSMInstanceTransform (const FSMInstanceId &InstanceId, FTransform &OutInstanceTransform, bool bWorldSpace=false) const override
 
virtual ENGINE_API bool SetSMInstanceTransform (const FSMInstanceId &InstanceId, const FTransform &InstanceTransform, bool bWorldSpace=false, bool bMarkRenderStateDirty=false, bool bTeleport=false) override
 
virtual ENGINE_API void NotifySMInstanceMovementStarted (const FSMInstanceId &InstanceId) override
 
virtual ENGINE_API void NotifySMInstanceMovementOngoing (const FSMInstanceId &InstanceId) override
 
virtual ENGINE_API void NotifySMInstanceMovementEnded (const FSMInstanceId &InstanceId) override
 
virtual ENGINE_API void NotifySMInstanceSelectionChanged (const FSMInstanceId &InstanceId, const bool bIsSelected) override
 
virtual ENGINE_API bool DeleteSMInstances (TArrayView< const FSMInstanceId > InstanceIds) override
 
virtual ENGINE_API bool DuplicateSMInstances (TArrayView< const FSMInstanceId > InstanceIds, TArray< FSMInstanceId > &OutNewInstanceIds) override
 
void InitializeInstancingRandomSeed (const bool bAllowRandomSeedValue=false)
 

Protected Attributes

uint8 bIsInstanceDataApplyCompleted: 1
 
int32 NumPendingLightmaps
 
FPrimitiveInstanceDataManager PrimitiveInstanceDataManager
 
TArray< FInstancedStaticMeshMappingInfoCachedMappings
 
friend FStaticLightingTextureMapping_InstancedStaticMesh
 
friend FInstancedLightMap2D
 
friend FInstancedShadowMap2D
 

Detailed Description

A component that efficiently renders multiple instances of the same StaticMesh.

Member Enumeration Documentation

◆ EBoundsCacheType

Enumerator
Component 
Navigation 
Local 
Count 
Other 

Member Function Documentation

◆ AddInstance()

int32 UInstancedStaticMeshComponent::AddInstance ( const FTransform InstanceTransform,
bool  bWorldSpace = false 
)
virtual

Add an instance to this component. Transform is given in local space of this component unless bWorldSpace is set.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ AddInstanceById()

FPrimitiveInstanceId UInstancedStaticMeshComponent::AddInstanceById ( const FTransform InstanceTransforms,
bool  bWorldSpace = false 
)

◆ AddInstanceInternal()

int32 UInstancedStaticMeshComponent::AddInstanceInternal ( int32  InstanceIndex,
FInstancedStaticMeshInstanceData InNewInstanceData,
const FTransform InstanceTransform,
bool  bWorldSpace 
)
protected

Internal version of AddInstance

◆ AddInstances()

TArray< int32 > UInstancedStaticMeshComponent::AddInstances ( const TArray< FTransform > &  InstanceTransforms,
bool  bShouldReturnIndices,
bool  bWorldSpace = false,
bool  bUpdateNavigation = true 
)
virtual

Add multiple instances to this component. Transform is given in local space of this component unless bWorldSpace is set.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ AddInstancesById()

TArray< FPrimitiveInstanceId > UInstancedStaticMeshComponent::AddInstancesById ( const TArrayView< const FTransform > &  InstanceTransforms,
bool  bWorldSpace = false,
bool  bUpdateNavigation = true 
)

Preliminary ID-based interface. May only be used if no other manipulations are performed that cause invalidation of IDs. For example, cannot be used on HISM. ISMs edited in the editor can also not reliably be used, as some editor changes cause ID tracking to be lost.

◆ AddInstancesInternal()

TArray< int32 > UInstancedStaticMeshComponent::AddInstancesInternal ( TConstArrayView< FTransform InstanceTransforms,
bool  bShouldReturnIndices,
bool  bWorldSpace,
bool  bUpdateNavigation = true 
)
protected

Internal implementation of AddInstances

◆ AddInstanceWorldSpace()

int32 UInstancedStaticMeshComponent::AddInstanceWorldSpace ( const FTransform WorldTransform)
inline

Add an instance to this component. Transform is given in world space.

◆ ApplyComponentInstanceData()

void UInstancedStaticMeshComponent::ApplyComponentInstanceData ( struct FInstancedStaticMeshComponentInstanceData ComponentInstanceData)
virtual

Applies the cached component instance data to a newly blueprint constructed component.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ ApplyLightMapping()

ENGINE_API void UInstancedStaticMeshComponent::ApplyLightMapping ( FStaticLightingTextureMapping_InstancedStaticMesh InMapping,
const FStaticLightingBuildContext LightingContext 
)
protected

◆ BatchUpdateInstancesData()

bool UInstancedStaticMeshComponent::BatchUpdateInstancesData ( int32  StartInstanceIndex,
int32  NumInstances,
FInstancedStaticMeshInstanceData StartInstanceData,
bool  bMarkRenderStateDirty = false,
bool  bTeleport = false 
)
virtual

◆ BatchUpdateInstancesTransform()

bool UInstancedStaticMeshComponent::BatchUpdateInstancesTransform ( int32  StartInstanceIndex,
int32  NumInstances,
const FTransform NewInstancesTransform,
bool  bWorldSpace = false,
bool  bMarkRenderStateDirty = false,
bool  bTeleport = false 
)
virtual

Update the transform for a number of instances.

Parameters
StartInstanceIndexThe starting index of the instances to update
NumInstancesThe number of instances to update
NewInstancesTransformThe new transform
bWorldSpaceIf true, the new transform is interpreted as a World Space transform, otherwise it is interpreted as Local Space
bMarkRenderStateDirtyIf true, the change should be visible immediately. If you are updating many instances you should only set this to true for the last instance.
bTeleportWhether or not the instances physics should be moved normally, or teleported (moved instantly, ignoring velocity).
Returns
True on success.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ BatchUpdateInstancesTransforms() [1/3]

bool UInstancedStaticMeshComponent::BatchUpdateInstancesTransforms ( int32  StartInstanceIndex,
const TArray< FTransform > &  NewInstancesTransforms,
bool  bWorldSpace = false,
bool  bMarkRenderStateDirty = false,
bool  bTeleport = false 
)
virtual

Update the transform for an array of instances.

Parameters
StartInstanceIndexThe starting index of the instances to update
NewInstancesTransformsThe new transforms
bWorldSpaceIf true, the new transforms are interpreted as a World Space transform, otherwise it is interpreted as Local Space
bMarkRenderStateDirtyIf true, the change should be visible immediately. If you are updating many instances you should only set this to true for the last instance.
bTeleportWhether or not the instances physics should be moved normally, or teleported (moved instantly, ignoring velocity).
Returns
True on success.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ BatchUpdateInstancesTransforms() [2/3]

bool UInstancedStaticMeshComponent::BatchUpdateInstancesTransforms ( int32  StartInstanceIndex,
const TArray< FTransform > &  NewInstancesTransforms,
const TArray< FTransform > &  NewInstancesPrevTransforms,
bool  bWorldSpace = false,
bool  bMarkRenderStateDirty = false,
bool  bTeleport = false 
)
virtual

Update the transform for an array of instances. Overloaded version which takes an array of NewPreviousFrameTransforms.

◆ BatchUpdateInstancesTransforms() [3/3]

bool UInstancedStaticMeshComponent::BatchUpdateInstancesTransforms ( int32  StartInstanceIndex,
TArrayView< const FTransform NewInstancesTransforms,
bool  bWorldSpace = false,
bool  bMarkRenderStateDirty = false,
bool  bTeleport = false 
)
virtual

this is array view version of the UFUNCTION, blueprints do not support ArrayViews at the time of adding this one

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ BeginDestroy()

void UInstancedStaticMeshComponent::BeginDestroy ( )
overridevirtual

◆ BuildComponentInstanceData() [1/2]

void UInstancedStaticMeshComponent::BuildComponentInstanceData ( ERHIFeatureLevel::Type  FeatureLevel,
FInstanceUpdateComponentDesc OutData 
)
protectedvirtual

◆ BuildComponentInstanceData() [2/2]

void UInstancedStaticMeshComponent::BuildComponentInstanceData ( EShaderPlatform  InShaderPlatform,
FInstanceUpdateComponentDesc OutData 
)
protectedvirtual

◆ BuildInstanceDataDeltaChangeSetCommon()

void UInstancedStaticMeshComponent::BuildInstanceDataDeltaChangeSetCommon ( FISMInstanceUpdateChangeSet ChangeSet)
protected

◆ BuildLegacyRenderData()

void UInstancedStaticMeshComponent::BuildLegacyRenderData ( FStaticMeshInstanceData OutData)
protected

Build instance buffer for rendering from current component data. Only used for cook

◆ BuildTextureStreamingDataImpl()

bool UInstancedStaticMeshComponent::BuildTextureStreamingDataImpl ( ETextureStreamingBuildType  BuildType,
EMaterialQualityLevel::Type  QualityLevel,
ERHIFeatureLevel::Type  FeatureLevel,
TSet< FGuid > &  DependentResources,
bool bOutSupportsBuildTextureStreamingData 
)
overridevirtual

Build the data to compute accuracte StreaminTexture data.

◆ CalcAndCacheNavigationBounds()

void UInstancedStaticMeshComponent::CalcAndCacheNavigationBounds ( )
protected

◆ CalcBounds()

FBoxSphereBounds UInstancedStaticMeshComponent::CalcBounds ( const FTransform BoundTransform) const
overridevirtual

◆ CalcBoundsImpl() [1/2]

FBoxSphereBounds UInstancedStaticMeshComponent::CalcBoundsImpl ( const FTransform BoundTransform,
bool  bForNavigation 
) const
protected

◆ CalcBoundsImpl() [2/2]

FBoxSphereBounds UInstancedStaticMeshComponent::CalcBoundsImpl ( const FTransform BoundTransform,
const FBox InstanceBounds 
) const
protected

Calculates bounds from all instances.

Parameters
BoundTransformThe bounds transform
InstanceBoundsThe instance bounds

◆ CanEditSimulatePhysics()

bool UInstancedStaticMeshComponent::CanEditSimulatePhysics ( )
overridevirtual

◆ CanEditSMInstance()

bool UInstancedStaticMeshComponent::CanEditSMInstance ( const FSMInstanceId InstanceId) const
overrideprotectedvirtual

Can the given static mesh instance be edited?

Returns
True if it can be edited, false otherwise.

Implements ISMInstanceManager.

◆ CanMoveSMInstance()

bool UInstancedStaticMeshComponent::CanMoveSMInstance ( const FSMInstanceId InstanceId,
const ETypedElementWorldType  WorldType 
) const
overrideprotectedvirtual

Can the given static mesh instance be moved in the world?

Returns
True if it can be moved, false otherwise.

Implements ISMInstanceManager.

◆ ClearAllInstanceBodies()

void UInstancedStaticMeshComponent::ClearAllInstanceBodies ( )
protected

Terminate all body instances owned by this component.

◆ ClearInstances()

void UInstancedStaticMeshComponent::ClearInstances ( )
virtual

Clear all instances being rendered by this component.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ ClearInstanceSelection()

void UInstancedStaticMeshComponent::ClearInstanceSelection ( )

Deselect all instances.

◆ CollectPSOPrecacheData()

void UInstancedStaticMeshComponent::CollectPSOPrecacheData ( const FPSOPrecacheParams BasePrecachePSOParams,
FMaterialInterfacePSOPrecacheParamsList OutParams 
)
overridevirtual

Precache all PSOs which can be used by the component

◆ ComponentOverlapComponentImpl()

bool UInstancedStaticMeshComponent::ComponentOverlapComponentImpl ( class UPrimitiveComponent *  PrimComp,
const FVector  Pos,
const FQuat Quat,
const FCollisionQueryParams Params 
)
overrideprotectedvirtual

◆ ComponentOverlapMultiImpl()

bool UInstancedStaticMeshComponent::ComponentOverlapMultiImpl ( TArray< struct FOverlapResult > &  OutOverlaps,
const class UWorld InWorld,
const FVector Pos,
const FQuat Rot,
ECollisionChannel  TestChannel,
const struct FComponentQueryParams Params,
const struct FCollisionObjectQueryParams ObjectQueryParams = FCollisionObjectQueryParams::DefaultObjectQueryParam 
) const
overrideprotectedvirtual

◆ CreateAllInstanceBodies()

void UInstancedStaticMeshComponent::CreateAllInstanceBodies ( )
protected

Creates body instances for all instances owned by this component.

◆ CreateHitProxyData()

void UInstancedStaticMeshComponent::CreateHitProxyData ( TArray< TRefCountPtr< HHitProxy > > &  HitProxies)
protected

◆ CreateSceneProxy()

FPrimitiveSceneProxy * UInstancedStaticMeshComponent::CreateSceneProxy ( )
overridevirtual

◆ CreateStaticMeshSceneProxy()

FPrimitiveSceneProxy * UInstancedStaticMeshComponent::CreateStaticMeshSceneProxy ( Nanite::FMaterialAudit NaniteMaterials,
bool  bCreateNanite 
)
overrideprotectedvirtual

◆ DeleteSMInstances()

bool UInstancedStaticMeshComponent::DeleteSMInstances ( TArrayView< const FSMInstanceId InstanceIds)
overrideprotectedvirtual

Attempt to delete the given static mesh instances.

Returns
True if any instances were deleted, false otherwise.

Implements ISMInstanceManager.

◆ DoCustomNavigableGeometryExport()

bool UInstancedStaticMeshComponent::DoCustomNavigableGeometryExport ( FNavigableGeometryExport GeomExport) const
overridevirtual

◆ DuplicateSMInstances()

bool UInstancedStaticMeshComponent::DuplicateSMInstances ( TArrayView< const FSMInstanceId InstanceIds,
TArray< FSMInstanceId > &  OutNewInstanceIds 
)
overrideprotectedvirtual

Attempt to duplicate the given static mesh instances, retrieving the IDs of any new instances.

Returns
True if any instances were duplicated, false otherwise.

Implements ISMInstanceManager.

◆ FullNavigationUpdate()

void UInstancedStaticMeshComponent::FullNavigationUpdate ( )
protectedvirtual

Request to navigation system to update for the bounds of the ISM.

◆ GetAllPhysicsObjects()

TArray< Chaos::FPhysicsObject * > UInstancedStaticMeshComponent::GetAllPhysicsObjects ( ) const
overridevirtual

◆ GetBodyInstance()

FBodyInstance * UInstancedStaticMeshComponent::GetBodyInstance ( FName  BoneName = NAME_None,
bool  bGetWelded = true,
int32  Index = INDEX_NONE 
) const
overridevirtual

◆ GetComponentChildElements()

void UInstancedStaticMeshComponent::GetComponentChildElements ( TArray< FTypedElementHandle > &  OutElementHandles,
const bool  bAllowCreate = true 
)
overridevirtual

◆ GetComponentInstanceData()

PRAGMA_ENABLE_DEPRECATION_WARNINGS TStructOnScope< FActorComponentInstanceData > UInstancedStaticMeshComponent::GetComponentInstanceData ( ) const
overridevirtual

◆ GetCullDistances()

void UInstancedStaticMeshComponent::GetCullDistances ( int32 OutStartCullDistance,
int32 OutEndCullDistance 
) const
inline

Gets the fading start and culling end distances for this component.

◆ GetInstanceCount()

int32 UInstancedStaticMeshComponent::GetInstanceCount ( ) const

Get the number of instances in this component.

◆ GetInstanceDataSceneProxy()

const TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafe > & UInstancedStaticMeshComponent::GetInstanceDataSceneProxy ( ) const

◆ GetInstanceIndexForId()

int32 UInstancedStaticMeshComponent::GetInstanceIndexForId ( FPrimitiveInstanceId  InstanceId) const
inline

Fetches current instance index for a given InstanceId

◆ GetInstanceNavigationBounds()

FBox UInstancedStaticMeshComponent::GetInstanceNavigationBounds ( ) const
protected

Returns the bounds of a single instance in local space. It uses the NavCollision if available, then the StaticMesh bounds if available or an invalid box otherwise.

Returns
The bounds of a single instance in local space

◆ GetInstancePrevTransform()

bool UInstancedStaticMeshComponent::GetInstancePrevTransform ( int32  InstanceIndex,
FTransform OutInstanceTransform,
bool  bWorldSpace = false 
) const

Get the prev transform for the instance specified. Only works if PerInstancePrevTransform has been setup and updated through BatchUpdateInstancesTransforms

◆ GetInstancesMinMaxScale()

void UInstancedStaticMeshComponent::GetInstancesMinMaxScale ( FVector MinScale,
FVector MaxScale 
) const

◆ GetInstancesOverlappingBox()

TArray< int32 > UInstancedStaticMeshComponent::GetInstancesOverlappingBox ( const FBox Box,
bool  bBoxInWorldSpace = true 
) const
virtual

Returns the instances with instance bounds overlapping the specified box. The return value is an array of instance indices.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ GetInstancesOverlappingSphere()

TArray< int32 > UInstancedStaticMeshComponent::GetInstancesOverlappingSphere ( const FVector Center,
float  Radius,
bool  bSphereInWorldSpace = true 
) const
virtual

Returns the instances with instance bounds overlapping the specified sphere. The return value is an array of instance indices.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ GetInstanceTransform()

bool UInstancedStaticMeshComponent::GetInstanceTransform ( int32  InstanceIndex,
FTransform OutInstanceTransform,
bool  bWorldSpace = false 
) const

Get the transform for the instance specified. Instance is returned in local space of this component unless bWorldSpace is set. Returns True on success.

◆ GetLightAndShadowMapMemoryUsage()

void UInstancedStaticMeshComponent::GetLightAndShadowMapMemoryUsage ( int32 LightMapMemoryUsage,
int32 ShadowMapMemoryUsage 
) const
overridevirtual

◆ GetLODDistanceScale()

float UInstancedStaticMeshComponent::GetLODDistanceScale ( ) const
inline

Gets the current LOD scale.

◆ GetMaterialStreamingData()

bool UInstancedStaticMeshComponent::GetMaterialStreamingData ( int32  MaterialIndex,
FPrimitiveMaterialInfo MaterialData 
) const
overridevirtual

Get material, UV density and bounds for a given material index.

◆ GetNavigationBounds()

FBox UInstancedStaticMeshComponent::GetNavigationBounds ( ) const
overridevirtual

◆ GetNavigationData()

void UInstancedStaticMeshComponent::GetNavigationData ( FNavigationRelevantData Data) const
overridevirtual

◆ GetNavigationPerInstanceTransforms()

void UInstancedStaticMeshComponent::GetNavigationPerInstanceTransforms ( const FBox AreaBox,
TArray< FTransform > &  InstanceData 
) const
protectedvirtual

Handles request from navigation system to gather instance transforms in a specific area box.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ GetNumInstances()

int32 UInstancedStaticMeshComponent::GetNumInstances ( ) const
inline

◆ GetNumRenderInstances()

virtual int32 UInstancedStaticMeshComponent::GetNumRenderInstances ( ) const
inlinevirtual

◆ GetOrCreateInstanceDataSceneProxy()

TSharedPtr< FISMCInstanceDataSceneProxy, ESPMode::ThreadSafe > UInstancedStaticMeshComponent::GetOrCreateInstanceDataSceneProxy ( )

◆ GetPhysicsObjectById()

Chaos::FPhysicsObject * UInstancedStaticMeshComponent::GetPhysicsObjectById ( Chaos::FPhysicsObjectId  Id) const
overridevirtual

◆ GetRenderIndex()

int32 UInstancedStaticMeshComponent::GetRenderIndex ( int32  InInstanceIndex) const
inline

Returns the render instance buffer index.

◆ GetRenderMatrix()

FMatrix UInstancedStaticMeshComponent::GetRenderMatrix ( ) const
overridevirtual

◆ GetResourceSizeEx()

void UInstancedStaticMeshComponent::GetResourceSizeEx ( FResourceSizeEx CumulativeResourceSize)
overridevirtual

◆ GetSMInstanceTransform()

bool UInstancedStaticMeshComponent::GetSMInstanceTransform ( const FSMInstanceId InstanceId,
FTransform OutInstanceTransform,
bool  bWorldSpace = false 
) const
overrideprotectedvirtual

Attempt to get the transform of the given static mesh instance.

Note
The transform should be in the local space of the owner ISM component, unless bWorldSpace is set.
Returns
True if the transform was retrieved, false otherwise.

Implements ISMInstanceManager.

◆ GetStreamingRenderAssetInfo()

void UInstancedStaticMeshComponent::GetStreamingRenderAssetInfo ( FStreamingTextureLevelContext LevelContext,
TArray< FStreamingRenderAssetPrimitiveInfo > &  OutStreamingRenderAssets 
) const
overridevirtual

Get the StreaminTexture data.

◆ GetTextureStreamingTransformScale()

float UInstancedStaticMeshComponent::GetTextureStreamingTransformScale ( ) const
overridevirtual

Get the scale comming form the component, when computing StreamingTexture data. Used to support instanced meshes.

◆ GetTranslatedInstanceSpaceOrigin()

virtual FVector UInstancedStaticMeshComponent::GetTranslatedInstanceSpaceOrigin ( ) const
inlinevirtual

Get the translated space for instance transforms to be passed to the renderer. In the renderer data structures we only have floating point precision for instance transforms relative to their owning primitive. The primitive transform itself has double precision. Some ISM that are authored in world space need to adjust the local space to keep instance transforms within precision limits.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ GetUsedMaterialPropertyDesc() [1/2]

FPrimitiveMaterialPropertyDescriptor UInstancedStaticMeshComponent::GetUsedMaterialPropertyDesc ( ERHIFeatureLevel::Type  FeatureLevel) const
inline

wrapper which is public so we can implement the LIST ISM command

◆ GetUsedMaterialPropertyDesc() [2/2]

FPrimitiveMaterialPropertyDescriptor UInstancedStaticMeshComponent::GetUsedMaterialPropertyDesc ( EShaderPlatform  ShaderPlatform) const
inline

◆ InitializeInstancingRandomSeed()

void UInstancedStaticMeshComponent::InitializeInstancingRandomSeed ( const bool  bAllowRandomSeedValue = false)
protected

◆ InitInstanceBody() [1/2]

void UInstancedStaticMeshComponent::InitInstanceBody ( int32  InstanceIdx,
FBodyInstance InBodyInstance 
)
protected

Initializes the body instance for the specified instance of the static mesh.

◆ InitInstanceBody() [2/2]

void UInstancedStaticMeshComponent::InitInstanceBody ( int32  InstanceIdx,
FBodyInstance InstanceBodyInstance,
FBodyInstance ReferenceBodyInstance,
bool  bRuntimeBodyInstance,
UBodySetup BodySetup 
)
protected

◆ InvalidateCachedBounds()

void UInstancedStaticMeshComponent::InvalidateCachedBounds ( )
protected

◆ InvalidateInstanceDataTracking()

void UInstancedStaticMeshComponent::InvalidateInstanceDataTracking ( )

Clears all the updated instance tracking data AND instance ID association, also forcing a full update of the instance data the next time it is flushed.
NOTE: Destroying the instance updated tracking means the renderer has to treat the instances as completely new, preventing e.g., velocity tracking and caching from working reliably. This function is only intended to be used when some outside entity has modified the instance data, this is not recommended and access to the public data will be removed in a future release.

◆ IsHLODRelevant()

bool UInstancedStaticMeshComponent::IsHLODRelevant ( ) const
overridevirtual

◆ IsInstanceSelected()

bool UInstancedStaticMeshComponent::IsInstanceSelected ( int32  InInstanceIndex) const

Check to see if an instance is selected.

◆ IsNavigationRelevant()

bool UInstancedStaticMeshComponent::IsNavigationRelevant ( ) const
overridevirtual

◆ IsValidId()

bool UInstancedStaticMeshComponent::IsValidId ( FPrimitiveInstanceId  InstanceId)

◆ IsValidInstance()

bool UInstancedStaticMeshComponent::IsValidInstance ( int32  InstanceIndex) const

Does the given index map to a valid instance in this component?

◆ LineTraceComponent()

bool UInstancedStaticMeshComponent::LineTraceComponent ( FHitResult OutHit,
const FVector  Start,
const FVector  End,
const FCollisionQueryParams Params 
)
overridevirtual

(UE_BUILD_SHIPPING || UE_BUILD_TEST)

◆ MakeInstanceDataFlags()

FInstanceDataFlags UInstancedStaticMeshComponent::MakeInstanceDataFlags ( bool  bAnyMaterialHasPerInstanceRandom,
bool  bAnyMaterialHasPerInstanceCustomData 
) const

◆ NotifySMInstanceMovementEnded()

void UInstancedStaticMeshComponent::NotifySMInstanceMovementEnded ( const FSMInstanceId InstanceId)
overrideprotectedvirtual

Notify that the given static mesh instance is done being moved.

Note
This gives the manager a chance to end a move operation.

Implements ISMInstanceManager.

◆ NotifySMInstanceMovementOngoing()

void UInstancedStaticMeshComponent::NotifySMInstanceMovementOngoing ( const FSMInstanceId InstanceId)
overrideprotectedvirtual

Notify that the given static mesh instance is currently being moved.

Note
This gives the manager a chance to update a move operation.

Implements ISMInstanceManager.

◆ NotifySMInstanceMovementStarted()

void UInstancedStaticMeshComponent::NotifySMInstanceMovementStarted ( const FSMInstanceId InstanceId)
overrideprotectedvirtual

Notify that the given static mesh instance is about to be moved.

Note
This gives the manager a chance to start a move operation, to avoid performing repeated work until the move is finished.

Implements ISMInstanceManager.

◆ NotifySMInstanceSelectionChanged()

void UInstancedStaticMeshComponent::NotifySMInstanceSelectionChanged ( const FSMInstanceId InstanceId,
const bool  bIsSelected 
)
overrideprotectedvirtual

Notify that the given static mesh instance selection state has changed.

Note
This gives the manager a chance to sync any internal selection state.

Implements ISMInstanceManager.

◆ OnAsyncDestroyPhysicsState()

bool UInstancedStaticMeshComponent::OnAsyncDestroyPhysicsState ( const UE::FTimeout Timeout)
overrideprotectedvirtual

◆ OnAsyncDestroyPhysicsStateBegin_GameThread()

void UInstancedStaticMeshComponent::OnAsyncDestroyPhysicsStateBegin_GameThread ( )
overrideprotectedvirtual

◆ OnCreatePhysicsState()

void UInstancedStaticMeshComponent::OnCreatePhysicsState ( )
overrideprotectedvirtual

◆ OnDestroyPhysicsState()

void UInstancedStaticMeshComponent::OnDestroyPhysicsState ( )
overrideprotectedvirtual

◆ OnPostLoadPerInstanceData()

void UInstancedStaticMeshComponent::OnPostLoadPerInstanceData ( )
protectedvirtual

Creates rendering buffer from serialized data, if any

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ OnPostPopulatePerInstanceData()

void UInstancedStaticMeshComponent::OnPostPopulatePerInstanceData ( )
inline

◆ OnRegister()

void UInstancedStaticMeshComponent::OnRegister ( )
overridevirtual

◆ OnUnregister()

void UInstancedStaticMeshComponent::OnUnregister ( )
overridevirtual

◆ OnUpdateTransform()

void UInstancedStaticMeshComponent::OnUpdateTransform ( EUpdateTransformFlags  UpdateTransformFlags,
ETeleportType  Teleport 
)
overridevirtual

◆ OverlapComponent()

bool UInstancedStaticMeshComponent::OverlapComponent ( const FVector Pos,
const FQuat Rot,
const FCollisionShape CollisionShape 
) const
overridevirtual

◆ PartialNavigationUpdate()

void UInstancedStaticMeshComponent::PartialNavigationUpdate ( int32  InstanceIdx)
virtual

Request to navigation system to update only part of navmesh occupied by specified instance.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ PartialNavigationUpdates()

void UInstancedStaticMeshComponent::PartialNavigationUpdates ( TConstArrayView< FTransform InstanceTransforms)
virtual

Request to navigation system to update only part of navmesh occupied specified instances transforms.

◆ PostLoad()

void UInstancedStaticMeshComponent::PostLoad ( )
overridevirtual

◆ PreAllocateInstancesMemory()

void UInstancedStaticMeshComponent::PreAllocateInstancesMemory ( int32  AddedInstanceCount)
virtual

Preallocated memory to include the new added instances count, to prevent reallloc during the add operation.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ PreApplyComponentInstanceData()

void UInstancedStaticMeshComponent::PreApplyComponentInstanceData ( struct FInstancedStaticMeshComponentInstanceData ComponentInstanceData)

Handle changes that must happen before the proxy is recreated.

◆ PreSave()

void UInstancedStaticMeshComponent::PreSave ( FObjectPreSaveContext  ObjectSaveContext)
overridevirtual

◆ PropagateLightingScenarioChange()

void UInstancedStaticMeshComponent::PropagateLightingScenarioChange ( )
overridevirtual

◆ RecreateInstanceBody()

void UInstancedStaticMeshComponent::RecreateInstanceBody ( int32  InstanceBodyIndex)
overridevirtual

◆ RemoveInstance()

bool UInstancedStaticMeshComponent::RemoveInstance ( int32  InstanceIndex)
virtual

Remove the instance specified. Returns True on success.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ RemoveInstanceById()

void UInstancedStaticMeshComponent::RemoveInstanceById ( FPrimitiveInstanceId  InstanceId)
inline

◆ RemoveInstanceInternal()

bool UInstancedStaticMeshComponent::RemoveInstanceInternal ( int32  InstanceIndex,
bool  InstanceAlreadyRemoved,
bool  bForceRemoveAtSwap = false,
bool  bUpdateNavigation = true 
)
protected

Internal version of RemoveInstance

◆ RemoveInstances() [1/2]

bool UInstancedStaticMeshComponent::RemoveInstances ( const TArray< int32 > &  InstancesToRemove)
virtual

Remove the instances specified. Returns True on success.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ RemoveInstances() [2/2]

bool UInstancedStaticMeshComponent::RemoveInstances ( const TArray< int32 > &  InstancesToRemove,
bool  bInstanceArrayAlreadySortedInReverseOrder 
)
virtual

Remove the instances specified. Returns True on success.

Parameters
InstancesToRemovearray of the instance indices to remove ( can be sorted
See also
bInstanceArrayAlreadySortedInReverseOrder )
Parameters
bInstanceArrayAlreadySortedInReverseOrdertrue is the array is already sorted in reverse order

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ RemoveInstancesById()

void UInstancedStaticMeshComponent::RemoveInstancesById ( const TArrayView< const FPrimitiveInstanceId > &  InstanceIds,
bool  bUpdateNavigation = true 
)
virtual

◆ SelectInstance()

void UInstancedStaticMeshComponent::SelectInstance ( bool  bInSelected,
int32  InInstanceIndex,
int32  InInstanceCount = 1 
)

Select/deselect an instance or group of instances.

◆ SendRenderInstanceData_Concurrent()

void UInstancedStaticMeshComponent::SendRenderInstanceData_Concurrent ( )
overridevirtual

◆ Serialize()

void UInstancedStaticMeshComponent::Serialize ( FArchive Ar)
overridevirtual

◆ SerializeRenderData()

void UInstancedStaticMeshComponent::SerializeRenderData ( FArchive Ar)
protected

Serialize instance buffer that is used for rendering. Only for cooked content

◆ SetBakedLightingDataChanged()

void UInstancedStaticMeshComponent::SetBakedLightingDataChanged ( int32  InInstanceIndex)

Mark the "shadowmap" or lightmap uv as modified for the instance since this is stored in external data.

◆ SetBakedLightingDataChangedAll()

void UInstancedStaticMeshComponent::SetBakedLightingDataChangedAll ( )

Mark the "shadowmap" or lightmap uv as modified for all the instances since this is stored in external data.

◆ SetCullDistances()

void UInstancedStaticMeshComponent::SetCullDistances ( int32  StartCullDistance,
int32  EndCullDistance 
)

Sets the fading start and culling end distances for this component.

◆ SetCustomData() [1/2]

bool UInstancedStaticMeshComponent::SetCustomData ( int32  InstanceIndex,
TArrayView< const float CustomDataFloats,
bool  bMarkRenderStateDirty = false 
)
virtual

Per Instance Custom Data

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ SetCustomData() [2/2]

bool UInstancedStaticMeshComponent::SetCustomData ( int32  InstanceIndexStart,
int32  InstanceIndexEnd,
TConstArrayView< float CustomDataFloats,
bool  bMarkRenderStateDirty = false 
)
virtual

◆ SetCustomDataById() [1/2]

void UInstancedStaticMeshComponent::SetCustomDataById ( const TArrayView< const FPrimitiveInstanceId > &  InstanceIds,
TArrayView< const float CustomDataFloats 
)

◆ SetCustomDataById() [2/2]

void UInstancedStaticMeshComponent::SetCustomDataById ( FPrimitiveInstanceId  InstanceId,
TArrayView< const float CustomDataFloats 
)
inline

◆ SetCustomDataValue()

bool UInstancedStaticMeshComponent::SetCustomDataValue ( int32  InstanceIndex,
int32  CustomDataIndex,
float  CustomDataValue,
bool  bMarkRenderStateDirty = false 
)
virtual

Update custom data for specific instance

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ SetCustomDataValueById()

void UInstancedStaticMeshComponent::SetCustomDataValueById ( FPrimitiveInstanceId  InstanceId,
int32  CustomDataIndex,
float  CustomDataValue 
)

◆ SetHasPerInstancePrevTransforms()

void UInstancedStaticMeshComponent::SetHasPerInstancePrevTransforms ( bool  bInHasPreviousTransforms)

◆ SetLODDistanceScale()

void UInstancedStaticMeshComponent::SetLODDistanceScale ( float  InLODDistanceScale)

Sets the LOD scale.

◆ SetNumCustomDataFloats()

void UInstancedStaticMeshComponent::SetNumCustomDataFloats ( int32  InNumCustomDataFloats)
virtual

Update number of custom data entries per instance. This applies to all instances and will reallocate the full custom data buffer and reset all values to 0

◆ SetPreviousTransformById()

void UInstancedStaticMeshComponent::SetPreviousTransformById ( FPrimitiveInstanceId  InstanceId,
const FTransform NewPrevInstanceTransform,
bool  bWorldSpace = false 
)

◆ SetRemoveSwap()

void UInstancedStaticMeshComponent::SetRemoveSwap ( )
inline

Sets to use RemoveAtSwap on instance removal. This is an optimization, but will change the resultant instance reordering.

◆ SetSMInstanceTransform()

bool UInstancedStaticMeshComponent::SetSMInstanceTransform ( const FSMInstanceId InstanceId,
const FTransform InstanceTransform,
bool  bWorldSpace = false,
bool  bMarkRenderStateDirty = false,
bool  bTeleport = false 
)
overrideprotectedvirtual

Attempt to set the transform of the given static mesh instance.

Note
The transform should be in the local space of the owner ISM component, unless bWorldSpace is set.
Returns
True if the transform was updated, false otherwise.

Implements ISMInstanceManager.

◆ SetUseConservativeBounds()

void UInstancedStaticMeshComponent::SetUseConservativeBounds ( bool  bValue)
inline

Sets whether to use conservative bounds. This doesn't fully recalculate bounds on instance addition/removal/transform change. Instead maintains a conservative bound that only grows.

◆ ShouldCreatePhysicsState()

bool UInstancedStaticMeshComponent::ShouldCreatePhysicsState ( ) const
overridevirtual

◆ ShouldSkipDirtyAreaOnAddOrRemove()

bool UInstancedStaticMeshComponent::ShouldSkipDirtyAreaOnAddOrRemove ( ) const
overridevirtual

◆ SupportsPartialNavigationUpdate()

virtual bool UInstancedStaticMeshComponent::SupportsPartialNavigationUpdate ( ) const
inlineprotectedvirtual

Does this component support partial navigation updates

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ SupportsRemoveSwap()

bool UInstancedStaticMeshComponent::SupportsRemoveSwap ( ) const
virtual

Returns true if RemoveAtSwap is enabled. Derived classes may always return true regardless of whether SetRemoveSwapEnabled() was called.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ SupportsStaticLighting()

virtual bool UInstancedStaticMeshComponent::SupportsStaticLighting ( ) const
inlineoverridevirtual

◆ SweepComponent()

bool UInstancedStaticMeshComponent::SweepComponent ( FHitResult OutHit,
const FVector  Start,
const FVector  End,
const FQuat ShapRotation,
const FCollisionShape CollisionShape,
bool  bTraceComplex = false 
)
overridevirtual

◆ UpdateBounds()

void UInstancedStaticMeshComponent::UpdateBounds ( )
overridevirtual

◆ UpdateComponentTransform()

void UInstancedStaticMeshComponent::UpdateComponentTransform ( EUpdateTransformFlags  UpdateTransformFlags,
ETeleportType  Teleport 
)

◆ UpdateInstanceTransform()

bool UInstancedStaticMeshComponent::UpdateInstanceTransform ( int32  InstanceIndex,
const FTransform NewInstanceTransform,
bool  bWorldSpace = false,
bool  bMarkRenderStateDirty = false,
bool  bTeleport = false 
)
virtual

Update the transform for the instance specified.

Parameters
InstanceIndexThe index of the instance to update
NewInstanceTransformThe new transform
bWorldSpaceIf true, the new transform is interpreted as a World Space transform, otherwise it is interpreted as Local Space
bMarkRenderStateDirtyIf true, the change should be visible immediately. If you are updating many instances you should only set this to true for the last instance.
bTeleportWhether or not the instance's physics should be moved normally, or teleported (moved instantly, ignoring velocity).
Returns
True on success.

Reimplemented in UHierarchicalInstancedStaticMeshComponent.

◆ UpdateInstanceTransformById()

void UInstancedStaticMeshComponent::UpdateInstanceTransformById ( FPrimitiveInstanceId  InstanceId,
const FTransform NewInstanceTransform,
bool  bWorldSpace = false,
bool  bTeleport = false 
)

Member Data Documentation

◆ bIsInstanceDataApplyCompleted

uint8 UInstancedStaticMeshComponent::bIsInstanceDataApplyCompleted
protected

◆ CachedMappings

TArray<FInstancedStaticMeshMappingInfo> UInstancedStaticMeshComponent::CachedMappings
protected

The mappings for all the instances of this component.

◆ FInstancedLightMap2D

friend UInstancedStaticMeshComponent::FInstancedLightMap2D
protected

◆ FInstancedShadowMap2D

friend UInstancedStaticMeshComponent::FInstancedShadowMap2D
protected

◆ FStaticLightingTextureMapping_InstancedStaticMesh

friend UInstancedStaticMeshComponent::FStaticLightingTextureMapping_InstancedStaticMesh
protected

◆ InstanceBodies

TArray<FBodyInstance*> UInstancedStaticMeshComponent::InstanceBodies

Physics representation of the instance bodies.

◆ InstanceReorderTable

TArray<int32> UInstancedStaticMeshComponent::InstanceReorderTable

Mapping from PerInstanceSMData order to instance render buffer order. If empty, the PerInstanceSMData order is used.

◆ NumPendingLightmaps

int32 UInstancedStaticMeshComponent::NumPendingLightmaps
protected

Number of pending lightmaps still to be calculated (Apply()'d).

◆ PrimitiveInstanceDataManager

FPrimitiveInstanceDataManager UInstancedStaticMeshComponent::PrimitiveInstanceDataManager
protected

◆ ProxySize

SIZE_T UInstancedStaticMeshComponent::ProxySize

Tracks outstanding proxysize, as this is a bit hard to do with the fire-and-forget grass.


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