UModelComponent

ModelComponents are PrimitiveComponents that represent elements of BSP geometry in a [ULevel](API\Runtime\Engine\Engine\ULevel) object.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

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

Include

#include "Components/ModelComponent.h"

Syntax

class UModelComponent :
    public UPrimitiveComponent,
    public IInterface_CollisionDataProvider

Remarks

ModelComponents are PrimitiveComponents that represent elements of BSP geometry in a ULevel object. They are used exclusively by ULevel and are not intended as general-purpose components.

Variables

Name Description

Public variable

UBodySetup *...

 

ModelBodySetup

Description of collision

Constructors

Name Description

Public function

UModelComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function Static

void

 

ApplyTempElements

(
    bool bLightingWasSuccessful
)

Apply all the elements that we were putting into the TempBSPElements map to the Elements arrays in all components

Public function

void

 

BuildRenderData()

Rebuild the model's rendering info.

Public function

void

 

CommitSurfaces()

Commit the editor's changes to BSP surfaces.

Public function

void

 

CopyElementsFrom

(
    UModelComponent* OtherModelCom...
)

Copy model elements from the other component.

Public function

void

 

CreateModelBodySetup()

Ensure ModelBodySetup is present and correctly configured.

Public function Static

FModelElemen...

 

CreateNewTempElement

(
    UModelComponent* Component
)

Create a new temp FModelElement element for the component, which will be applied when lighting is all done.

Public function Virtual

bool

 

GenerateElements

(
    bool bBuildRenderData
)

Generate the Elements array.

Public function Const

const TIndir...

 

GetElements()

Public function

TIndirectArr...

 

GetElements()

Public function Const

UModel *

 

GetModel()

Accessors.

Public function Virtual

void

 

GetStaticLightingInfo

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

Public function Const

void

 

GetSurfaceLightMapResolution

(
    int32 SurfaceIndex,
    int32 QualityScale,
    int32& Width,
    int32& Height,
    FMatrix& WorldToMap,
    TArray< int32 >* GatheredNodes
)

Calculate the lightmap resolution to be used by the given surface.

Public function

void

 

InitializeModelComponent

(
    UModel* InModel,
    uint16 InComponentIndex,
    uint32 MaskedSurfaceFlags,
    const TArray< uint16 >& InNodes
)

Minimal initialization.

Public function

void

 

InvalidateCollisionData()

Invalidate current collision data

Public function

void

 

SelectAllSurfaces()

Selects all surfaces that are part of this model component.

Public function

void

 

ShrinkElements()

Free empty elements.

Overridden from UPrimitiveComponent

Name Description

Public function Virtual Const

void

 

AddMapBuildDataGUIDs

(
    TSet< FGuid >& InGUIDs
)

Add the used GUIDs from UMapBuildDataRegistry::MeshBuildData.

Public function Virtual

FPrimitiveSc...

 

CreateSceneProxy()

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

Public function Virtual

UBodySetup &...

 

GetBodySetup()

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

Public function Virtual Const

void

 

GetLightAndShadowMapMemoryUsage

(
    int32& LightMapMemoryUsage,
    int32& ShadowMapMemoryUsage
)

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

Public function Virtual Const

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 Const

UMaterialInt...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual Const

UMaterialInt...

 

GetMaterialFromCollisionFaceIndex

(
    int32 FaceIndex,
    int32& SectionIndex
)

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

Public function Virtual Const

int32

 

GetNumMaterials()

Return number of material elements in this primitive

Public function Virtual Const

ELightMapInt...

 

GetStaticLightingType()

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

Public function Virtual Const

int32

 

GetStaticLightMapResolution()

Returns the static lightmap resolution used for this primitive.

Public function Virtual Const

void

 

GetStreamingRenderAssetInfo

Enumerates the streaming textures/meshes used by the primitive.

Public function Virtual Const

void

 

GetUsedMaterials

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

Retrieves the materials used in this component

Public function Virtual Const

bool

 

ShouldRecreateProxyOnUpdateTransform()

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

Protected function Virtual Const

bool

 

SupportsStaticLighting()

Whether the component type supports static lighting.

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 Const

bool

 

IsPrecomputedLightingValid()

True if our precomputed lighting is up to date

Public function Virtual

void

 

PropagateLightingScenarioChange()

Updates any visuals after the lighting has changed

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

CreateRenderState_Concurrent

(
    FRegisterComponentContext* Con...
)

Used to create any rendering thread information for this component

Public function Virtual

void

 

DestroyRenderState_Concurrent()

Used to shut down any rendering thread structure for this component

Public function Virtual

void

 

InvalidateLightingCacheDetailed

(
    bool bInvalidateBuildEnqueuedLighti...,
    bool bTranslationOnly
)

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

Overridden from UObject

Name Description

Public function Virtual Const

bool

 

IsNameStableForNetworking()

IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

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 IInterface_CollisionDataProvider

Name Description

Public function Virtual Const

bool

 

ContainsPhysicsTriMeshData

(
    bool InUseAllTriData
)

Interface for checking if the implementing objects contains triangle mesh collision data

Public function Virtual

bool

 

GetPhysicsTriMeshData

(
    FTriMeshCollisionData* Collisi...,
    bool InUseAllTriData
)

Interface for retrieving triangle mesh collision data from the implementing object

Public function Virtual

bool

 

WantsNegXTriMesh()

Do we want to create a negative version of this mesh

Constants

Name

Description

TempBSPElements

The new BSP elements that are made during lighting, and will be applied to the components when all lighting is done

See Also

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