UHierarchicalInstancedStaticMeshComponent

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/HierarchicalInstancedStaticMeshComponent.h

Include

#include "Components/HierarchicalInstancedStaticMeshComponent.h"

Syntax

class UHierarchicalInstancedStaticMeshComponent : public UInstancedStaticMeshComponent

Variables

Name Description

Protected variable

FBox

 

AccumulatedNavigationDirtyArea

Public variable

bool: 1

 

bAutoRebuildTreeOnInstanceChanges

Public variable

bool: 1

 

bCanEnableDensityScaling

In Editor mode we might disable the density scaling for edition

Public variable

bool: 1

 

bConcurrentChanges

Public variable

bool

 

bDisableCollision

Public variable

uint32: 1

 

bEnableDensityScaling

Enable for detail meshes that don't really affect the game.

Public variable

bool: 1

 

bIsAsyncBuilding

Public variable

bool: 1

 

bIsOutOfDate

Protected variable

FGraphEventArra...

 

BuildTreeAsyncTasks

Public variable

FBox

 

BuiltInstanceBounds

Bounding box of any built instances (cached from the ClusterTree)

Public variable

uint32: 1

 

bUseTranslatedInstanceSpace

If true then we allow a translated space when building the cluster tree.

Public variable

FBoxSphereBound...

 

CacheMeshExtendedBounds

The last mesh bounds that was cache.

Public variable

TSharedPtr< TAr...

 

ClusterTreePtr

Public variable

float

 

CurrentDensityScaling

Current value of density scaling applied to this component.

Protected variable

friend

 

FInstancedLightMap2D

Protected variable

friend

 

FInstancedShadowMap2D

Protected variable

friend

 

FStaticLightingTextureMapping_InstancedStaticMesh

Public variable

int32

 

InstanceCountToRender

Instances to render (including removed one until the build is complete)

Public variable

int32

 

NumBuiltInstances

The number of instances in the ClusterTree. Subsequent instances will always be rendered.

Public variable

int32

 

NumBuiltRenderInstances

Normally equal to NumBuiltInstances, but can be lower if density scaling is in effect.

Public variable

int32

 

OcclusionLayerNumNodes

The number of nodes in the occlusion layer.

Public variable

TArray< int32 >

 

SortedInstances

Table for remapping instances from cluster tree to PerInstanceSMData order.

Public variable

FVector

 

TranslatedInstanceSpaceOrigin

Origin of the translated space used when building the cluster tree.

Public variable

FBox

 

UnbuiltInstanceBounds

Bounding box of any unbuilt instances.

Public variable

TArray< FBox >

 

UnbuiltInstanceBoundsList

Bounds of each individual unbuilt instance, used for LOD calculation.

Protected variable

EHISMViewReleva...

 

ViewRelevanceType

Constructors

Name Description

Public function

UHierarchicalInstancedStaticMeshComponent

(
    const FObjectInitializer& ObjectIn...
)

Destructors

Functions

Name Description

Protected function

float

 

ActualInstancesPerLeaf()

Average number of instances per leaf

Protected function

void

 

ApplyBuildTree

(
    FClusterBuilder& Builder,
    const bool bWasAsyncBuild
)

Public function

void

 

ApplyBuildTreeAsync

(
    ENamedThreads::Type CurrentThread,
    const FGraphEventRef& MyCompletion...,
    TSharedRef< FClusterBuilder, ESPMod...,
    double StartTime
)

Apply the results of the async build.

Protected function

void

 

ApplyEmpty()

Protected function

void

 

BuildTree()

Protected function

void

 

BuildTreeAsync()

Public function

bool

 

BuildTreeIfOutdated

(
    bool Async,
    bool ForceUpdate
)

Protected function Const

FVector

 

CalcTranslatedInstanceSpaceOrigin()

Public function

int32

 

DesiredInstancesPerLeaf()

Heuristic for the number of leaves in the tree

Protected function

void

 

FlushAccumulatedNavigationUpdates()

Protected function Const

void

 

GetInstanceTransforms

(
    TArray< FMatrix >& InstanceTransfo...,
    FVector const& Offset
)

Public function Const

int32

 

GetOverlappingBoxCount

(
    const FBox& Box
)

Get the number of instances that overlap a given box

Public function Const

void

 

GetOverlappingBoxTransforms

(
    const FBox& Box,
    TArray< FTransform >& OutTransform...
)

Get the transforms of instances inside the provided box

Public function Const

int32

 

GetOverlappingSphereCount

(
    const FSphere& Sphere
)

Get the number of instances that overlap a given sphere

Protected function

int32

 

GetVertsForLOD

(
    int32 LODIndex
)

Gets and approximate number of verts for each LOD to generate heuristics

Public function Const

EHISMViewRel...

 

GetViewRelevanceType()

Protected function

void

 

InitializeInstancingRandomSeed()

Public function Const

bool

 

IsAsyncBuilding()

Public function Const

bool

 

IsTreeFullyBuilt()

Protected function

void

 

PostBuildStats()

For testing, prints some stats after any kind of build

Protected function

void

 

RemoveInstancesInternal

(
    const int32* InstanceIndices,
    int32 Num
)

Removes specified instances

Protected function

void

 

SetPerInstanceLightMapAndEditorData

(
    FStaticMeshInstanceData& PerInstan...,
    const TArray< TRefCountPtr< HHitPro...
)

Public function

void

 

UpdateDensityScaling()

Will apply current density scaling, if enabled

Overridden from UInstancedStaticMeshComponent

Name Description

Public function Virtual

int32

 

AddInstance

(
    const FTransform& InstanceTransfor...,
    bool bWorldSpace
)

Add an instance to this component.

Public function Virtual

TArray< int3...

 

AddInstances

(
    const TArray< FTransform >& Instan...,
    bool bShouldReturnIndices,
    bool bWorldSpace
)

Add multiple instances to this component.

Public function Virtual

void

 

ApplyComponentInstanceData

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

Public function Virtual

bool

 

BatchUpdateInstancesData

(
    int32 StartInstanceIndex,
    int32 NumInstances,
    FInstancedStaticMeshInstanceData&#...,
    bool bMarkRenderStateDirty,
    bool bTeleport
)

Public function Virtual

bool

 

BatchUpdateInstancesTransform

(
    int32 StartInstanceIndex,
    int32 NumInstances,
    const FTransform& NewInstancesTran...,
    bool bWorldSpace,
    bool bMarkRenderStateDirty,
    bool bTeleport
)

Update the transform for a number of instances.

Public function Virtual

bool

 

BatchUpdateInstancesTransforms

(
    int32 StartInstanceIndex,
    const TArray< FTransform >& NewIns...,
    bool bWorldSpace,
    bool bMarkRenderStateDirty,
    bool bTeleport
)

Update the transform for an array of instances.

Public function Virtual

void

 

ClearInstances()

Clear all instances being rendered by this component.

Public function Virtual Const

TArray< int3...

 

GetInstancesOverlappingBox

(
    const FBox& Box,
    bool bBoxInWorldSpace
)

Returns the instances with instance bounds overlapping the specified box.

Public function Virtual Const

TArray< int3...

 

GetInstancesOverlappingSphere

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

Returns the instances with instance bounds overlapping the specified sphere.

Protected function Virtual Const

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 Const

int32

 

GetNumRenderInstances()

Number of instances in the render-side instance buffer.

Protected function Virtual Const

FVector

 

GetTranslatedInstanceSpaceOrigin()

Get the translated space for instance transforms to be passed to the renderer.

Protected function Virtual

void

 

OnPostLoadPerInstanceData()

Creates rendering buffer from serialized data, if any

Protected function Virtual

void

 

PartialNavigationUpdate

(
    int32 InstanceIdx
)

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

Public function Virtual

void

 

PreAllocateInstancesMemory

(
    int32 AddedInstanceCount
)

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

Public function Virtual

bool

 

RemoveInstance

(
    int32 InstanceIndex
)

Remove the instance specified. Returns True on success.

Public function Virtual

bool

 

RemoveInstances

(
    const TArray< int32 >& InstancesTo...
)

Remove the instances specified. Returns True on success.

Public function Virtual

bool

 

SetCustomData

(
    int32 InstanceIndex,
    const TArray< float >& CustomDataF...,
    bool bMarkRenderStateDirty
)

Per Instance Custom Data

Public function Virtual

bool

 

SetCustomDataValue

(
    int32 InstanceIndex,
    int32 CustomDataIndex,
    float CustomDataValue,
    bool bMarkRenderStateDirty
)

Update custom data for specific instance

Protected function Virtual Const

bool

 

SupportsPartialNavigationUpdate()

Does this component support partial navigation updates

Public function Virtual Const

bool

 

SupportsRemoveSwap()

Public function Virtual

bool

 

UpdateInstanceTransform

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

Update the transform for the instance specified.

Overridden from UStaticMeshComponent

Name Description

Public function Virtual

void

 

PostStaticMeshCompilation()

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

FPrimitiveSc...

 

CreateSceneProxy()

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

Overridden from USceneComponent

Name Description

Public function Virtual Const

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

 

PropagateLightingScenarioChange()

Updates any visuals after the lighting has changed

Overridden from UActorComponent

Name Description

Public function Virtual Const

bool

 

ShouldCreatePhysicsState()

Return true if CreatePhysicsState() should be called.

Overridden from UObject

Name Description

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx& CumulativeResourc...
)

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).

Public function Virtual

void

 

PostEditChangeChainProperty

(
    FPropertyChangedChainEvent& Proper...
)

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

Public function Virtual

void

 

PostEditImport()

Called after importing property values for this object (paste, duplicate or .t3d import) Allow the object to perform any cleanup for properties which shouldn't be duplicated or are unsupported by the script serialization

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from INavRelevantInterface

Name Description

Protected function Virtual Const

FBox

 

GetNavigationBounds()

Get bounds for navigation octree

Deprecated Functions

Name Description

Public function

void

 

AcceptPrebuiltTree

(
    TArray< FInstancedStaticMeshInstanc...,
    TArray< FClusterNode >& InClusterT...,
    int32 InOcclusionLayerNumNodes,
    int32 InNumBuiltRenderInstances
)

The AcceptPrebuiltTree method is moving to UGrassInstancedStaticMeshComponent. Please update your project to use the new component and method or your project may not compile in the next udpate.

Public function Static

void

 

BuildTreeAnyThread

(
    TArray< FMatrix >& InstanceTransfo...,
    TArray< float >& InstanceCustomDat...,
    int32 NumCustomDataFloats,
    const FBox& MeshBox,
    TArray< FClusterNode >& OutCluster...,
    TArray< int32 >& OutSortedInstance...,
    TArray< int32 >& OutInstanceReorde...,
    int32& OutOcclusionLayerNum,
    int32 MaxInstancesPerLeaf,
    bool InGenerateInstanceScalingRange
)

The BuildTreeAnyThread method is moving to UGrassInstancedStaticMeshComponent. Please update your project to use the new component and method or your project may not compile in the next udpate.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel