Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UPrimitiveComponent
- UMeshComponent
- UStaticMeshComponent
- UInstancedStaticMeshComponent
- UHierarchicalInstancedStaticMeshComponent
- UFoliageInstancedStaticMeshComponent
- UGrassInstancedStaticMeshComponent
- UHLODTemplatedInstancedStaticMeshComponent
- UMassInstancedStaticMeshComponent
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h |
Include | #include "Components/InstancedStaticMeshComponent.h" |
Syntax
class UInstancedStaticMeshComponent :
public UStaticMeshComponent,
public ISMInstanceManager
Remarks
A component that efficiently renders multiple instances of the same StaticMesh.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
TArray< FInstancedStaticMeshRandomSeed > | AdditionalRandomSeeds | Additional random seeds ranges. |
![]() |
bool | bForceShowAllInstancesDetails | Indicates that the user has purposedly chosen to show the instance list in the details panel, despite the performance warning. |
![]() |
bool | bSupportRemoveAtSwap | Flag for using RemoveAtSwap on instance removal. |
![]() |
TArray< FInstancedStaticMeshMappingInfo > | CachedMappings | The mappings for all the instances of this component. |
![]() |
EInstanceDeletionReason | DeletionState | This will be set to the appropriate state when one or more instances are in the process of being deleted. |
![]() |
friend | FInstancedLightMap2D | |
![]() |
friend | FInstancedShadowMap2D | |
![]() |
friend | FStaticLightingTextureMapping_InstancedStaticMesh | |
![]() |
TArray< FBodyInstance * > | InstanceBodies | Physics representation of the instance bodies. |
![]() |
TUniquePtr< FStaticMeshInstanceData > | InstanceDataBuffers | Buffers with per-instance data laid out for rendering. |
![]() |
int32 | InstanceEndCullDistance | Distance from camera at which each instance completely fades out. |
![]() |
TMap< int32, int32 > | InstanceIdToInstanceIndexMap | Used to cache a unique identifier for each instance. |
![]() |
TArray< int32 > | InstanceReorderTable | Mapping from PerInstanceSMData order to instance render buffer order. |
![]() |
int32 | InstanceStartCullDistance | Distance from camera at which each instance begins to fade out. |
![]() |
FInstanceUpdateCmdBuffer | InstanceUpdateCmdBuffer | This is here because in void FScene::UpdatePrimitiveInstance(UPrimitiveComponent* Primitive) we want access to the instances updates through the primitive component in a generic way. |
![]() |
int32 | InstancingRandomSeed | Value used to seed the random number stream that generates random numbers for each of this mesh's instances. |
![]() |
int32 | NumCustomDataFloats | Defines the number of floats that will be available per instance for custom data |
![]() |
int32 | NumPendingLightmaps | Number of pending lightmaps still to be calculated (Apply()'d). |
![]() |
TArray< int32 > | PerInstanceIds | |
![]() |
TArray< FMatrix > | PerInstancePrevTransform | TODO: KevinO cleanup. |
![]() |
TSharedPtr< FPerInstanceRenderData, ESPMode::ThreadSafe > | PerInstanceRenderData | Render data will be initialized on PostLoad or on demand. Released on the rendering thread. |
![]() |
TArray< float > | PerInstanceSMCustomData | Array of custom data for instances. |
![]() |
TArray< FInstancedStaticMeshInstanceData > | PerInstanceSMData | Array of instances, bulk serialized. |
![]() |
SIZE_T | ProxySize | Tracks outstanding proxysize, as this is a bit hard to do with the fire-and-forget grass. |
![]() |
TBitArray | SelectedInstances | One bit per instance if the instance is selected. |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UInstancedStaticMeshComponent
(
const FObjectInitializer& ObjectInitializer |
||
![]() |
UInstancedStaticMeshComponent
(
FVTableHelper& Helper |
Needs implementation in InstancedStaticMesh.cpp to compile UniquePtr for forward declared class |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
int32 | AddInstance
(
const FTransform& InstanceTransform, |
Add an instance to this component. |
![]() |
int32 | AddInstanceInternal
(
int32 InstanceIndex, |
Internal version of AddInstance |
![]() ![]() |
TArray< int32 > | AddInstances
(
const TArray< FTransform >& InstanceTransforms, |
Add multiple instances to this component. |
![]() |
TArray< int32 > | AddInstancesInternal
(
TConstArrayView< FTransform > InstanceTransforms, |
Internal implementation of AddInstances |
![]() ![]() |
void | ApplyComponentInstanceData
(
FInstancedStaticMeshComponentInstanceData* ComponentInstanceData |
Applies the cached component instance data to a newly blueprint constructed component. |
![]() |
void | ApplyLightMapping
(
FStaticLightingTextureMapping_InstancedStaticMesh* InMapping, |
|
![]() ![]() |
bool | BatchUpdateInstancesData
(
int32 StartInstanceIndex, |
|
![]() ![]() |
bool | BatchUpdateInstancesTransform
(
int32 StartInstanceIndex, |
Update the transform for a number of instances. |
![]() ![]() |
bool | BatchUpdateInstancesTransforms
(
int32 StartInstanceIndex, |
TODO: KevinO cleanup. |
![]() ![]() |
bool | BatchUpdateInstancesTransforms
(
int32 StartInstanceIndex, |
This is array view version of the UFUNCTION, blueprints do not support ArrayViews at the time of adding this one |
![]() ![]() |
bool | BatchUpdateInstancesTransforms
(
int32 StartInstanceIndex, |
Update the transform for an array of instances. |
![]() |
void | BuildRenderData
(
FStaticMeshInstanceData& OutData, |
Build instance buffer for rendering from current component data. |
![]() |
void | Terminate all body instances owned by this component. | |
![]() ![]() |
void | Clear all instances being rendered by this component. | |
![]() |
void | Deselect all instances. | |
![]() |
void | Creates body instances for all instances owned by this component. | |
![]() |
void | CreateHitProxyData
(
TArray< TRefCountPtr< HHitProxy >>& HitProxies |
|
![]() |
void | FlushInstanceUpdateCommands
(
bool bFlushInstanceUpdateCmdBuffer |
|
![]() ![]() |
void | GetCullDistances
(
int32& OutStartCullDistance, |
Gets the fading start and culling end distances for this component. |
![]() ![]() |
int32 | Get the number of instances in this component. | |
![]() ![]() |
bool | GetInstancePrevTransform
(
int32 InstanceIndex, |
TODO: KevinO cleanup. |
![]() ![]() |
void | GetInstancesMinMaxScale
(
FVector& MinScale, |
|
![]() ![]() ![]() |
TArray< int32 > | GetInstancesOverlappingBox
(
const FBox& Box, |
Returns the instances with instance bounds overlapping the specified box. |
![]() ![]() ![]() |
TArray< int32 > | GetInstancesOverlappingSphere
(
const FVector& Center, |
Returns the instances with instance bounds overlapping the specified sphere. |
![]() ![]() |
bool | GetInstanceTransform
(
int32 InstanceIndex, |
Get the transform for the instance specified. |
![]() ![]() ![]() |
void | GetNavigationPerInstanceTransforms
(
const FBox& AreaBox, |
Handles request from navigation system to gather instance transforms in a specific area box. |
![]() ![]() ![]() |
int32 | Number of instances in the render-side instance buffer. | |
![]() ![]() |
int32 | GetRenderIndex
(
int32 InInstanceIndex |
Returns the render instance buffer index. |
![]() ![]() ![]() |
FVector | Get the translated space for instance transforms to be passed to the renderer. | |
![]() |
void | InitInstanceBody
(
int32 InstanceIdx, |
Initializes the body instance for the specified instance of the static mesh. |
![]() |
void | InitPerInstanceRenderData
(
bool InitializeFromCurrentData, |
Initialize the Per Instance Render Data |
![]() ![]() |
bool | IsInstanceSelected
(
int32 InInstanceIndex |
Check to see if an instance is selected. |
![]() ![]() ![]() |
bool | IsInstanceTouchingSelectionBox
(
int32 InstanceIndex, |
|
![]() ![]() ![]() |
bool | IsInstanceTouchingSelectionFrustum
(
int32 InstanceIndex, |
|
![]() ![]() |
bool | IsValidInstance
(
int32 InstanceIndex |
Does the given index map to a valid instance in this component? |
![]() ![]() |
void | Creates rendering buffer from serialized data, if any | |
![]() ![]() |
void | PartialNavigationUpdate
(
int32 InstanceIdx |
Request to navigation system to update only part of navmesh occupied by specified instance. |
![]() ![]() |
void | PreAllocateInstancesMemory
(
int32 AddedInstanceCount |
Preallocated memory to include the new added instances count, to prevent reallloc during the add operation. |
![]() |
void | Transfers ownership of instance render data to a render thread. | |
![]() ![]() |
bool | RemoveInstance
(
int32 InstanceIndex |
Remove the instance specified. Returns True on success. |
![]() |
bool | RemoveInstanceInternal
(
int32 InstanceIndex, |
Internal version of RemoveInstance |
![]() ![]() |
bool | RemoveInstances
(
const TArray< int32 >& InstancesToRemove, |
Remove the instances specified. Returns True on success. |
![]() ![]() |
bool | RemoveInstances
(
const TArray< int32 >& InstancesToRemove |
Remove the instances specified. Returns True on success. |
![]() |
void | SelectInstance
(
bool bInSelected, |
Select/deselect an instance or group of instances. |
![]() |
void | SerializeRenderData
(
FArchive& Ar |
Serialize instance buffer that is used for rendering. Only for cooked content |
![]() |
void | SetCullDistances
(
int32 StartCullDistance, |
Sets the fading start and culling end distances for this component. |
![]() ![]() |
bool | SetCustomData
(
int32 InstanceIndex, |
Per Instance Custom Data |
![]() ![]() |
bool | SetCustomDataValue
(
int32 InstanceIndex, |
Update custom data for specific instance |
![]() ![]() |
void | SetNumCustomDataFloats
(
int32 InNumCustomDataFloats |
Update number of custom data entries per instance. |
![]() |
void | Sets to use RemoveAtSwap on instance removal. | |
![]() ![]() ![]() |
bool | Does this component support partial navigation updates | |
![]() ![]() ![]() |
bool | Returns true if RemoveAtSwap is enabled. | |
![]() ![]() |
bool | UpdateInstances
(
const TArray< int32 >& UpdateInstanceIds, |
Lightweight interface to add, remove and update instances. |
![]() ![]() |
bool | UpdateInstanceTransform
(
int32 InstanceIndex, |
Update the transform for the instance specified. |
Overridden from UStaticMeshComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
FPrimitiveSceneProxy * | CreateStaticMeshSceneProxy
(
Nanite::FMaterialAudit& NaniteMaterials, |
Overload this in child implementations that wish to extend Static Mesh or Nanite scene proxy implementations. |
![]() ![]() |
void | GetStaticLightingInfo
(
FStaticLightingPrimitiveInfo& OutPrimitiveInfo, |
|
![]() ![]() ![]() |
float | Get the scale comming form the component, when computing StreamingTexture data. |
Overridden from UMeshComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
bool | GetMaterialStreamingData
(
int32 MaterialIndex, |
Get material, UV density and bounds for a given material index. |
Overridden from UPrimitiveComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
bool | BuildTextureStreamingDataImpl
(
ETextureStreamingBuildType BuildType, |
Build the data to compute accuracte StreaminTexture data. |
![]() ![]() |
bool | Determines whether or not the simulate physics setting can be edited interactively on this component | |
![]() ![]() |
void | CollectPSOPrecacheData
(
const FPSOPrecacheParams& BasePrecachePSOParams, |
Precache all PSOs which can be used by the component |
![]() ![]() ![]() |
bool | ComponentIsTouchingSelectionBox
(
const FBox& InSelBBox, |
Determines whether the supplied bounding box intersects with the component. |
![]() ![]() ![]() |
bool | ComponentIsTouchingSelectionFrustum
(
const FConvexVolume& InFrustum, |
Determines whether the supplied frustum intersects with the component. |
![]() ![]() |
bool | ComponentOverlapComponentImpl
(
UPrimitiveComponent* PrimComp, |
Override this method for custom behavior for ComponentOverlapComponent() |
![]() ![]() ![]() |
bool | ComponentOverlapMultiImpl
(
TArray< struct FOverlapResult >& OutOverlaps, |
Override this method for custom behavior for ComponentOverlapMulti() |
![]() ![]() |
FPrimitiveSceneProxy * | Creates a proxy to represent the primitive to the scene manager in the rendering thread. | |
![]() ![]() ![]() |
bool | DoCustomNavigableGeometryExport
(
FNavigableGeometryExport& GeomExport |
Collects custom navigable geometry of component. |
![]() ![]() ![]() |
FBodyInstance * | GetBodyInstance
(
FName BoneName, |
Returns BodyInstance of the component. |
![]() ![]() ![]() |
void | GetLightAndShadowMapMemoryUsage
(
int32& LightMapMemoryUsage, |
Returns the light and shadow map memory for this primitive in its out variables. |
![]() ![]() ![]() |
FMatrix | Returns the matrix that should be used to render this component. | |
![]() ![]() ![]() |
void | GetStreamingRenderAssetInfo
(
FStreamingTextureLevelContext& LevelContext, |
Get the StreaminTexture data. |
![]() ![]() |
bool | LineTraceComponent
(
FHitResult& OutHit, |
Trace a ray against just this component. |
![]() ![]() ![]() |
bool | OverlapComponent
(
const FVector& Pos, |
|
![]() ![]() ![]() |
bool | Whether the component type supports static lighting. | |
![]() ![]() |
bool | SweepComponent
(
FHitResult& OutHit, |
Trace a shape against just this component. |
Overridden from USceneComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FBoxSphereBounds | CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. |
![]() ![]() |
void | OnUpdateTransform
(
EUpdateTransformFlags UpdateTransformFlags, |
Native callback when this component is moved |
![]() ![]() |
void | Updates any visuals after the lighting has changed |
Overridden from UActorComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | GetComponentChildElements
(
TArray< FTypedElementHandle >& OutElementHandles, |
Get the logical child elements of this component, if any. |
![]() ![]() ![]() |
TStructOnScope< FActorComponentInstanceData > | Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation | |
![]() ![]() ![]() |
FBox | ||
![]() ![]() ![]() |
bool | Override to specify that a component is relevant to the HLOD generation. | |
![]() ![]() |
void | Used to create any physics engine information for this component | |
![]() ![]() |
void | Used to shut down and physics engine structure for this component | |
![]() ![]() |
void | OnRegister () |
Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called. |
![]() ![]() |
void | Called to send instance data for this component to the rendering thread | |
![]() ![]() ![]() |
bool | Return true if CreatePhysicsState() should be called. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | BeginDestroy () |
Called before destroying the object. |
![]() ![]() |
void | GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific). |
![]() ![]() |
void | PostEditChangeChainProperty
(
FPropertyChangedChainEvent& PropertyChangedEvent |
This alternate version of PostEditChange is called when properties inside structs are modified. |
![]() ![]() |
void | PostEditUndo () |
Called after applying a transaction to the object. |
![]() ![]() |
void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. |
![]() ![]() |
void | Handles reading, writing, and reference collecting using FArchive. |
Overridden from INavRelevantInterface
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FBox | Get bounds for navigation octree | |
![]() ![]() ![]() |
void | GetNavigationData
(
FNavigationRelevantData& Data |
Prepare navigation modifiers |
![]() ![]() ![]() |
bool | Are modifiers active? |
Overridden from ISMInstanceManager
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
bool | CanEditSMInstance
(
const FSMInstanceId& InstanceId |
Can the given static mesh instance be edited? |
![]() ![]() ![]() |
bool | CanMoveSMInstance
(
const FSMInstanceId& InstanceId, |
Can the given static mesh instance be moved in the world? |
![]() ![]() |
bool | DeleteSMInstances
(
TArrayView< const FSMInstanceId > InstanceIds |
Attempt to delete the given static mesh instances. |
![]() ![]() |
bool | DuplicateSMInstances
(
TArrayView< const FSMInstanceId > InstanceIds, |
Attempt to duplicate the given static mesh instances, retrieving the IDs of any new instances. |
![]() ![]() ![]() |
bool | GetSMInstanceTransform
(
const FSMInstanceId& InstanceId, |
Attempt to get the transform of the given static mesh instance. |
![]() ![]() |
void | NotifySMInstanceMovementEnded
(
const FSMInstanceId& InstanceId |
Notify that the given static mesh instance is done being moved. |
![]() ![]() |
void | NotifySMInstanceMovementOngoing
(
const FSMInstanceId& InstanceId |
Notify that the given static mesh instance is currently being moved. |
![]() ![]() |
void | NotifySMInstanceMovementStarted
(
const FSMInstanceId& InstanceId |
Notify that the given static mesh instance is about to be moved. |
![]() ![]() |
void | NotifySMInstanceSelectionChanged
(
const FSMInstanceId& InstanceId, |
Notify that the given static mesh instance selection state has changed. |
![]() ![]() |
bool | SetSMInstanceTransform
(
const FSMInstanceId& InstanceId, |
Attempt to set the transform of the given static mesh instance. |
Enums
Type | Name | Description | |
---|---|---|---|
![]() |
EInstanceDeletionReason | The reason why a deletion operation is currently happening. |
Deprecated Functions
Type | Name | Description | |
---|---|---|---|
![]() |
int32 | AddInstanceWorldSpace
(
const FTransform& WorldTransform |
Use AddInstance or AddInstances with bWorldSpace set to true. |