UStaticMeshComponent

Inheritance Hierarchy

Syntax

class UStaticMeshComponent : public UMeshComponent

Remarks

StaticMeshComponent is used to create an instance of a UStaticMesh . A static mesh is a piece of geometry that consists of a static set of polygons.

Variables

Name Description

Public variable

uint32 : 1

 

bCastDistanceFieldIndirectShadow

Whether to use the mesh distance field representation (when present) for shadowing indirect lighting (from lightmaps or skylight) on Movable components.

Public variable

bool

 

bCustomOverrideVertexColorPerLOD

The component has some custom painting on LODs or not.

Public variable

uint32 : 1

 

bDisallowMeshPaintPerInstance

If true, mesh painting is disallowed on this instance.

Public variable

uint32 : 1

 

bDrawMeshCollisionIfComplex

Draw mesh collision if used for complex collision

Public variable

uint32 : 1

 

bDrawMeshCollisionIfSimple

Draw mesh collision if used for simple collision

Public variable

uint32 : 1

 

bForceNavigationObstacle

Allows overriding navigation export behavior per component: full collisions or dynamic obstacle

Public variable

uint32 : 1

 

bIgnoreInstanceForTextureStreaming

Ignore this instance of this static mesh when calculating streaming information.

Public variable

uint32 : 1

 

bOverrideLightMapRes

Whether to override the lightmap resolution defined in the static mesh.

Public variable

bool

 

bOverrideMinLOD

Whether to override the MinLOD setting of the static mesh asset with the MinLOD of this component.

Public variable

uint32 : 1

 

bOverrideNavigationExport

If true, bForceNavigationObstacle flag will take priority over navigation data stored in StaticMesh

Public variable

bool

 

bOverrideWireframeColor

If true, WireframeColorOverride will be used.

Public variable

bool

 

bUseDefaultCollision

Use the collision profile specified in the StaticMesh asset.

Public variable

uint32 : 1

 

bUseSubDivisions

Whether to use subdivisions or just the triangle's vertices.

Public variable

float

 

DistanceFieldIndirectShadowMinVisibility

Controls how dark the dynamic indirect shadow can be.

Public variable

int32

 

ForcedLodModel

If 0, auto-select LOD level. if >0, force to (ForcedLodModel-1).

Public variable

FLightmassPrimi ...

 

LightmassSettings

The Lightmass settings for this object.

Public variable

TArray < struct ...

 

LODData

Static mesh LOD data. Contains static lighting data along with instanced mesh vertex colors.

Public variable

int32

 

MaterialIndexPreview

Index of the material to preview.

Public variable

TArray < uint32 ...

 

MaterialStreamingRelativeBoxes

Material Bounds used for texture streaming.

Public variable

int32

 

MinLOD

Specifies the smallest LOD that will be used for this component.

Public variable

int32

 

OverriddenLightMapRes

Light map resolution to use on this component, used if bOverrideLightMapRes is true and there is a valid StaticMesh.

Public variable

int32

 

PreviousLODLevel

LOD that was desired for rendering this StaticMeshComponent last frame.

Public variable

int32

 

SectionIndexPreview

Index of the section to preview.

Public variable

int32

 

SelectedEditorMaterial

The material currently selected in the Editor. Used for highlighting

Public variable

int32

 

SelectedEditorSection

The section currently selected in the Editor. Used for highlighting

Public variable

UStaticMesh ...

 

StaticMesh

The static mesh that this component uses to render

Public variable

FString

 

StaticMeshDerivedDataKey

Derived data key of the static mesh, used to determine if an update from the source static mesh is required.

Public variable

int32

 

StaticMeshImportVersion

The import version of the static mesh when it was assign this is update when:

Public variable

float

 

StreamingDistanceMultiplier

Allows adjusting the desired streaming distance of streaming textures that uses UV 0.

Public variable

TArray < FStream ...

 

StreamingTextureData

The list of texture, bounds and scales. As computed in the texture streaming build process.

Public variable

int32

 

SubDivisionStepSize

Subdivision step size for static vertex lighting.

Public variable

FColor

 

WireframeColorOverride

Wireframe color to use if bOverrideWireframeColor is true

Constructors

Name Description

Public function

UStaticMeshComponent

(
    const FObjectInitializer & ObjectIn...
)

Destructors

Name Description

Public function Virtual

~UStaticMeshComponent()

Functions

Name Description

Public function Static

void

 

AddReferencedObjects

(
    UObject * InThis,
    FReferenceCollector & Collector
)

Public function

void

 

AddSpeedTreeWind()

Register this component's render data with the scene for SpeedTree wind

Public function Virtual

FStaticMeshS ...

 

AllocateStaticLightingMesh

(
    int32 LODIndex,
    const TArray < ULightComponent *...
)

Allocates an implementation of FStaticLightingMesh that will handle static lighting for this component

Public function

void

 

ApplyComponentInstanceData

(
    FStaticMeshComponentInstanceData&#...
)

Public function

void

 

CachePaintedDataIfNecessary()

Save off the data painted on to this mesh per LOD if necessary

Public function

void

 

CopyInstanceVertexColorsIfCompatible

(
    UStaticMeshComponent * SourceCo...
)

Copies instance vertex colors from the SourceComponent into this component

Public function

bool

 

FixupOverrideColorsIfNecessary

(
    bool bRebuildingStaticMesh
)

Update the vertex override colors if necessary (i.e. vertices from source mesh have changed from override colors)

Public function

int32

 

GetBlueprintCreatedComponentIndex()

Get this components index in its parents blueprint created components array (used for matching instance data)

Public function Virtual

bool

 

GetEstimatedLightAndShadowMapMemoryUsage

(
    int32 & TextureLightMapMemoryUsage,
    int32 & TextureShadowMapMemoryUsage,
    int32 & VertexLightMapMemoryUsage,
    int32 & VertexShadowMapMemoryUsage,
    int32 & StaticLightingResolution,
    bool& bIsUsingTextureMapping,
    bool& bHasLightmapTexCoords
)

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

Public function Virtual

void

 

GetEstimatedLightMapResolution

(
    int32 & Width,
    int32 & Height
)

Returns the lightmap resolution used for this primitive instance in the case of it supporting texture light/ shadow maps.

Public function

void

 

GetLocalBounds

(
    FVector & Min,
    FVector & Max
)

Get Local bounds

Public function

const FMeshM ...

 

GetMeshMapBuildData

(
    const FStaticMeshComponentLODInfo &...
)

Public function

UStaticMeshS ...

 

GetSocketByName

(
    FName InSocketName
)

Returns the named socket on the static mesh component.

Public function Virtual

void

 

GetStaticLightingInfo

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

Public function

UStaticMesh ...

 

GetStaticMesh()

Get the StaticMesh used by this instance.

Public function Virtual

void

 

GetTextureLightAndShadowMapMemoryUsage

(
    int32 InWidth,
    int32 InHeight,
    int32 & OutLightMapMemoryUsage,
    int32 & OutShadowMapMemoryUsage
)

Get the memory used for texture-based light and shadow maps of the given width and height

Public function Virtual

float

 

GetTextureStreamingTransformScale()

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

Public function

FColor

 

GetWireframeColor()

Returns the wireframe color to use for this component.

Public function Virtual

bool

 

HasLightmapTextureCoordinates()

Returns true if the static mesh the component uses has valid lightmap texture coordinates

Public function

void

 

OnRep_StaticMesh

(
    UStaticMesh * OldStaticMesh
)

Public function Virtual

FOnStaticMes ...

 

OnStaticMeshChanged()

Public function

void

 

ReleaseResources()

Public function

void

 

RemoveInstanceVertexColors()

Removes instance vertex colors from all LODs

Public function

void

 

RemoveInstanceVertexColorsFromLOD

(
    int32 LODToRemoveColorsFrom
)

Removes instance vertex colors from the specified LOD

Public function

void

 

RemoveSpeedTreeWind()

Unregister this component's render data with the scene for SpeedTree wind

Public function

bool

 

RequiresOverrideVertexColorsFixup()

Determines whether any of the component's LODs require override vertex color fixups

Public function

void

 

SetForcedLodModel

(
    int32 NewForcedLodModel
)

Public function

void

 

SetLODDataCount

(
    const uint32 MinSize,
    const uint32 MaxSize
)

Add or remove elements to have the size in the specified range.

Public function

void

 

SetMaterialPreview

(
    int32 InMaterialIndexPreview
)

Sets the value of the MaterialIndexPreview flag and reattaches the component as necessary.

Public function

void

 

SetSectionPreview

(
    int32 InSectionIndexPreview
)

Sets the value of the SectionIndexPreview flag and reattaches the component as necessary.

Public function Virtual

bool

 

SetStaticLightingMapping

(
    bool bTextureMapping,
    int32 ResolutionToUse
)

Switches the static mesh component to use either Texture or Vertex static lighting.

Public function Virtual

bool

 

SetStaticMesh

(
    UStaticMesh * NewMesh
)

Change the StaticMesh used by this instance.

Public function Virtual

bool

 

SupportsDefaultCollision()

WITH_EDITOR.

Public function Virtual

bool

 

SupportsDitheredLODTransitions()

Whether we can support dithered LOD transitions (default behavior checks all materials).

Public function

void

 

UpdateCollisionFromStaticMesh()

Sets the BodyInstance to use the mesh's body setup for external collision information

Public function

void

 

UpdatePreCulledData

(
    int32 LODIndex,
    const TArray < uint32 >& PreCulledD...,
    const TArray < int32 >& NumTriangle...
)

Public function Virtual

bool

 

UsesTextureLightmaps

(
    int32 InWidth,
    int32 InHeight
)

Returns true if the component uses texture lightmaps

Overridden from UMeshComponent

Name Description

Public function Virtual

int32

 

GetMaterialIndex

(
    FName MaterialSlotName
)

Public function Virtual

TArray < FNam ...

 

GetMaterialSlotNames()

Public function Virtual

bool

 

GetMaterialStreamingData

(
    int32 MaterialIndex,
    FPrimitiveMaterialInfo & MaterialDa...
)

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

Public function Virtual

bool

 

IsMaterialSlotNameValid

(
    FName MaterialSlotName
)

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

bool

 

ComponentIsTouchingSelectionBox

(
    const FBox & InSelBBox,
    const FEngineShowFlags & ShowFlags,
    const bool bConsiderOnlyBSP,
    const bool bMustEncompassEntireComp...
)

Determines whether the supplied bounding box intersects with the component.

Public function Virtual

bool

 

ComponentIsTouchingSelectionFrustum

(
    const FConvexVolume & InFrustum,
    const FEngineShowFlags & ShowFlags,
    const bool bConsiderOnlyBSP,
    const bool bMustEncompassEntireComp...
)

Determines whether the supplied frustum intersects with the 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

UBodySetup &...

 

GetBodySetup()

Return the BodySetup to use for this PrimitiveComponent (single body case)

Public function Virtual

float

 

GetDiffuseBoost

(
    int32 ElementIndex
)

Gets the diffuse boost for the primitive component.

Public function Virtual

float

 

GetEmissiveBoost

(
    int32 ElementIndex
)

Gets the emissive boost for the primitive 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

bool

 

GetLightMapResolution

(
    int32 & Width,
    int32 & Height
)

Returns the lightmap resolution used for this primitive instance in the case of it supporting texture light/ shadow maps.

Public function Virtual

UMaterialInt ...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual

UMaterialInt ...

 

GetMaterialFromCollisionFaceIndex

(
    int32 FaceIndex
)

Try and retrieve the material applied to a particular collision face of mesh.

Public function Virtual

int32

 

GetNumMaterials()

Number of material elements in this primitive

Public function Virtual

bool

 

GetShadowIndirectOnly()

Public function Virtual

ELightMapInt ...

 

GetStaticLightingType()

Requests whether the component will use texture, vertex or no lightmaps.

Public function Virtual

int32

 

GetStaticLightMapResolution()

Returns the static lightmap resolution used for this primitive.

Public function Virtual

void

 

GetStreamingTextureInfo

Get the StreaminTexture data.

Public function Virtual

void

 

GetUsedMaterials

(
    TArray < UMaterialInterface * > ...,
    bool bGetDebugMaterials
)

Retrieves the materials used in this component

Public function Virtual

bool

 

HasValidSettingsForStaticLighting

(
    bool bOverlookInvalidComponents
)

Returns true if the component is static AND has the right static mesh setup to support lightmaps.

Public function Virtual

void

 

SetCollisionProfileName

(
    FName InCollisionProfileName
)

Set Collision Profile Name This function is called by constructors when they set ProfileName This will change current CollisionProfileName to be this, and overwrite Collision Setting

Public function Virtual

bool

 

ShouldRecreateProxyOnUpdateTransform()

Determines whether the proxy for this primitive type needs to be recreated whenever the primitive moves.

Protected function Virtual

bool

 

SupportsStaticLighting()

Whether the component type supports static lighting.

Public function Virtual

bool

 

UsesOnlyUnlitMaterials()

True if only unlit materials are used for rendering, false otherwise.

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

bool

 

DoesSocketExist

(
    FName InSocketName
)

Return true if socket with the given name exists

Public function Virtual

FTransform

 

GetSocketTransform

(
    FName InSocketName,
    ERelativeTransformSpace TransformSp...
)

Get world-space socket transform.

Public function Virtual

bool

 

HasAnySockets()

Returns true if this component has any sockets

Public function Virtual

bool

 

IsPrecomputedLightingValid()

Public function Virtual

void

 

PropagateLightingScenarioChange()

Public function Virtual

void

 

QuerySupportedSockets

Get a list of sockets this component contains

Public function Virtual

bool

 

ShouldCollideWhenPlacing()

If true, bounds should be used when placing component/actor in level. Does not affect spawning.

Overridden from UActorComponent

Name Description

Public function Virtual

UObject cons...

 

AdditionalStatObject()

Give a readable name for this component, including asset name if applicable

Public function Virtual

void

 

CheckForErrors()

Function that gets called from within Map_Check to allow this actor component to check itself for any potential errors and register them with map check dialog.

Public function Virtual

FActorCompon ...

 

GetComponentInstanceData()

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

Public function Virtual

void

 

InvalidateLightingCacheDetailed

(
    bool bInvalidateBuildEnqueuedLighti...,
    bool bTranslationOnly
)

Called when this actor component has moved, allowing it to discard statically cached lighting information.

Protected function Virtual

void

 

OnCreatePhysicsState()

Physics.

Protected function Virtual

void

 

OnDestroyPhysicsState()

Used to shut down and physics engine structure for this component

Protected function Virtual

void

 

OnRegister()

WITH_EDITOR.

Protected function Virtual

void

 

OnUnregister()

Called when a component is unregistered.

Overridden from UObject

Name Description

Public function Virtual

bool

 

AreNativePropertiesIdenticalTo

(
    UObject * Other
)

Returns whether native properties are identical to the one of the passed in component.

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

bool

 

CanEditChange

(
    const UProperty * InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual

void

 

ExportCustomProperties

(
    FOutputDevice & Out,
    uint32 Indent
)

Exports the property values for the specified object as text to the output device.

Public function Virtual

FString

 

GetDetailedInfoInternal()

========================================== UObject interface.

Public function Virtual

void

 

ImportCustomProperties

(
    const TCHAR * SourceText,
    FFeedbackContext * Warn
)

Exports the property values for the specified object as text to the output device.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

WITH_EDITOR.

Public function Virtual

void

 

PreEditUndo()

Called before applying a transaction to the object.

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform * TargetP...
)

WITH_EDITOR.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

Overridden from INavRelevantInterface

Name Description

Public function Virtual

void

 

GetNavigationData

(
    FNavigationRelevantData & Data
)

Prepare navigation modifiers

Public function Virtual

bool

 

IsNavigationRelevant()

Are modifiers active?

Classes

Name

Description

Public class

FOnStaticMeshChanged

Called when the static mesh changes

See Also

References

Module

Engine

Header

Runtime/Engine/Classes/Components/StaticMeshComponent.h