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.

Destructors

No destructors are accessible with public or protected access.

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

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

FBox

 

GetTextureStreamingBox

(
    int32 MaterialIndex
)

Get the texture streaming box related to the given material. Used to support instanced meshes

Public function Virtual

float

 

GetTextureStreamingTransformScale()

Get the scale to apply to the UV densities that come from the component and transform type.

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

 

SetLODDataCount

(
    const uint32 MinSize,
    const uint32 MaxSize
)

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

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

 

SupportsDefaultCollision()

Whether or not the component supports default collision from its static mesh asset

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

 

IsMaterialSlotNameValid

(
    FName MaterialSlotName
)

Overridden from UPrimitiveComponent

Name Description

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

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

Enumerates the streaming textures used by the primitive.

Public function Virtual

void

 

GetUsedMaterials

(
    TArray < UMaterialInterface * > ...
)

Retrieves the materials used in this component

Public function Virtual

bool

 

HasStreamingTextureData()

Return whether this primitive has (good) built data for texture streaming.

Public function Virtual

bool

 

HasTextureStreamingMaterialData

(
    bool bCheckForScales,
    int32 TextureIndex,
    FMaterialTextureInfo * OutTextu...
)

Return whether this primitive has (good) material texcoord size for texture streaming.

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

bool

 

RequiresStreamingTextureData()

Return whether this primitive should have data for texture streaming.

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

void

 

UpdateStreamingTextureData

(
    TArray < UTexture2D* >& LevelT...,
    const FTexCoordScaleMap& TexCoordS...,
    EMaterialQualityLevel::Type Quality...,
    ERHIFeatureLevel::Type FeatureLevel
)

Update the precomputed streaming data of this component.

Public function Virtual

void

 

UpdateTextureStreamingMaterialData

(
    const FTexCoordScaleMap& TexCoordS...
)

Update material texcoord scales for texture streaming.

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

 

OnRegister()

Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called.

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

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