UInstancedStaticMeshComponent

Inheritance Hierarchy

Syntax

class UInstancedStaticMeshComponent : public UStaticMeshComponent

Remarks

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

Variables

Name Description

Public variable

bool

 

bPerInstanceRenderDataWasPrebuilt

This was prebuilt for grass, never destroy it.

Protected variable

TArray < FInstan ...

 

CachedMappings

The mappings for all the instances of this component.

Protected variable

friend

 

FInstancedLightMap2D

Protected variable

friend

 

FInstancedShadowMap2D

Protected variable

friend

 

FStaticLightingTextureMapping_InstancedStaticMesh

Public variable

TArray < FBodyIn ...

 

InstanceBodies

Physics representation of the instance bodies.

Public variable

int32

 

InstanceEndCullDistance

Distance from camera at which each instance completely fades out.

Public variable

TArray < int32 >

 

InstanceReorderTable

Mapping from PerInstanceSMData order to instance render buffer order.

Public variable

int32

 

InstanceStartCullDistance

Distance from camera at which each instance begins to fade out.

Public variable

int32

 

InstancingRandomSeed

Value used to seed the random number stream that generates random numbers for each of this mesh's instances.

Protected variable

int32

 

NumPendingLightmaps

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

Public variable

TSharedPtr < FPe...

 

PerInstanceRenderData

Render data will be initialized once we create scene proxy for this component.

Public variable

TArray < FInstan ...

 

PerInstanceSMData

Array of instances, bulk serialized.

Public variable

UPhysicsSeriali ...

 

PhysicsSerializer

Serialization of all the InstanceBodies. Helps speed up physics creation time.

Public variable

SIZE_T

 

ProxySize

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

Public variable

TArray < int32 >

 

RemovedInstances

The render indices of any removed items we should not render.

Public variable

TBitArray

 

SelectedInstances

One bit per instance if the instance is selected.

Public variable

int32

 

SelectionStamp

Incremented when instance selection is changed

Constructors

Name Description

Public function

UInstancedStaticMeshComponent

(
    const FObjectInitializer & ObjectIn...
)

UInstancedStaticMeshComponent

Functions

Name Description

Public function Virtual

int32

 

AddInstance

(
    const FTransform & InstanceTransfor...
)

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

Public function

int32

 

AddInstanceWorldSpace

(
    const FTransform & WorldTransform
)

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

Public function

void

 

ApplyComponentInstanceData

(
    FInstancedStaticMeshComponentInstan...
)

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

Protected function

void

 

ApplyLightMapping

(
    FStaticLightingTextureMapping_Insta...,
    ULevel * LightingScenario
)

Public function Virtual

void

 

ClearInstances()

Clear all instances being rendered by this component.

Public function

void

 

ClearInstanceSelection()

Deselect all instances.

Public function

int32

 

GetInstanceCount()

Get the number of instances in this component.

Public function Virtual

TArray < int3 ...

 

GetInstancesOverlappingBox

(
    const FBox & Box,
    bool bBoxInWorldSpace
)

Returns the instances with instance bounds overlapping the specified box.

Public function Virtual

TArray < int3 ...

 

GetInstancesOverlappingSphere

(
    const FVector & Center,
    float Radius,
    bool bSphereInWorldSpace
)

Returns the instances with instance bounds overlapping the specified sphere.

Public function

bool

 

GetInstanceTransform

(
    int32 InstanceIndex,
    FTransform & OutInstanceTransform,
    bool bWorldSpace
)

Get the transform for the instance specified.

Protected function Virtual

void

 

GetNavigationPerInstanceTransforms

(
    const FBox & AreaBox,
    TArray < FTransform >& InstanceData
)

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

Public function Virtual

int32

 

GetNumRenderInstances()

Number of instances in the render-side instance buffer.

Protected function

void

 

InitInstanceBody

(
    int32 InstanceIdx,
    FBodyInstance * InBodyInstance
)

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

Public function

bool

 

IsInstanceSelected

(
    int32 InInstanceIndex
)

Check to see if an instance is selected.

Protected function Virtual

void

 

PartialNavigationUpdate

(
    int32 InstanceIdx
)

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

Public function

void

 

ReleasePerInstanceRenderData()

Transfers ownership of instance render data to a render thread.

Public function Virtual

bool

 

RemoveInstance

(
    int32 InstanceIndex
)

Remove the instance specified.

Public function

void

 

SelectInstance

(
    bool bInSelected,
    int32 InInstanceIndex,
    int32 InInstanceCount
)

Select/deselect an instance or group of instances.

Public function

void

 

SetCullDistances

(
    int32 StartCullDistance,
    int32 EndCullDistance
)

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

Public function Virtual

bool

 

UpdateInstanceTransform

(
    int32 InstanceIndex,
    const FTransform & NewInstanceTrans...,
    bool bWorldSpace,
    bool bMarkRenderStateDirty,
    bool bTeleport
)

Update the transform for the instance specified.

True on success.

Overridden from UStaticMeshComponent

Name Description

Public function Virtual

void

 

GetStaticLightingInfo

(
    FStaticLightingPrimitiveInfo & OutP...,
    const TArray < ULightComponent *...,
    const FLightingBuildOptions & Optio...
)

Public function Virtual

float

 

GetTextureStreamingTransformScale()

Get the scale comming form the component, when computing StreamingTexture data.

Overridden from UMeshComponent

Name Description

Public function Virtual

bool

 

GetMaterialStreamingData

(
    int32 MaterialIndex,
    FPrimitiveMaterialInfo & MaterialDa...
)

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

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

bool

 

BuildTextureStreamingData

(
    ETextureStreamingBuildType BuildTyp...,
    EMaterialQualityLevel::Type Quality...,
    ERHIFeatureLevel::Type FeatureLevel,
    TSet < FGuid >& DependentResources
)

Build the data to compute accuracte StreaminTexture data.

Public function Virtual

bool

 

CanEditSimulatePhysics()

Determines whether or not the simulate physics setting can be edited interactively on this component

Public function Virtual

FPrimitiveSc ...

 

CreateSceneProxy()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Public function Virtual

bool

 

DoCustomNavigableGeometryExport

(
    FNavigableGeometryExport & GeomExpo...
)

Collects custom navigable geometry of component.

Public function Virtual

void

 

GetLightAndShadowMapMemoryUsage

(
    int32 & LightMapMemoryUsage,
    int32 & ShadowMapMemoryUsage
)

Returns the light and shadow map memory for this primitive in its out variables.

Public function Virtual

void

 

GetStreamingTextureInfo

Get the StreaminTexture data.

Public function Virtual

bool

 

SupportsStaticLighting()

Whether the component type supports static lighting.

Overridden from USceneComponent

Name Description

Public function Virtual

FBoxSphereBo ...

 

CalcBounds

(
    const FTransform & LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Public function Virtual

void

 

OnUpdateTransform

(
    EUpdateTransformFlags UpdateTransfo...,
    ETeleportType Teleport
)

Public function Virtual

void

 

PropagateLightingScenarioChange()

Overridden from UActorComponent

Name Description

Public function Virtual

FActorCompon ...

 

GetComponentInstanceData()

Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation

Protected function Virtual

void

 

OnCreatePhysicsState()

Physics.

Protected function Virtual

void

 

OnDestroyPhysicsState()

Used to shut down and physics engine structure for this component

Public function Virtual

bool

 

ShouldCreatePhysicsState()

Return true if CreatePhysicsState() should be called.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx & CumulativeResourc...
)

Get the size of the object/resource for display to artists/LDs in the Editor.

Public function Virtual

void

 

PostEditChangeChainProperty

(
    FPropertyChangedChainEvent & Proper...
)

This alternate version of PostEditChange is called when properties inside structs are modified.

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

Overridden from INavRelevantInterface

Name Description

Public function Virtual

void

 

GetNavigationData

(
    FNavigationRelevantData & Data
)

Prepare navigation modifiers

References

Module

Engine

Header

Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h