UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UModelComponent Class Reference

#include <ModelComponent.h>

+ Inheritance diagram for UModelComponent:

Public Member Functions

void CommitSurfaces ()
 
void BuildRenderData ()
 
void ShrinkElements ()
 
ENGINE_API void GetSurfaceLightMapResolution (int32 SurfaceIndex, int32 QualityScale, int32 &Width, int32 &Height, FMatrix &WorldToMap, TArray< int32 > *GatheredNodes=NULL) const
 
ENGINE_API void CopyElementsFrom (UModelComponent *OtherModelComponent)
 
virtual void CreateRenderState_Concurrent (FRegisterComponentContext *Context) override
 
virtual void DestroyRenderState_Concurrent () override
 
virtual bool GetLightMapResolution (int32 &Width, int32 &Height) const override
 
virtual int32 GetStaticLightMapResolution () const override
 
virtual void GetLightAndShadowMapMemoryUsage (int32 &LightMapMemoryUsage, int32 &ShadowMapMemoryUsage) const override
 
virtual FBoxSphereBounds CalcBounds (const FTransform &LocalToWorld) const override
 
virtual FPrimitiveSceneProxyCreateSceneProxy () override
 
virtual bool ShouldRecreateProxyOnUpdateTransform () const override
 
virtual ELightMapInteractionType GetStaticLightingType () const override
 
virtual void GetStreamingRenderAssetInfo (FStreamingTextureLevelContext &LevelContext, TArray< FStreamingRenderAssetPrimitiveInfo > &OutStreamingRenderAssets) const override
 
virtual void GetUsedMaterials (TArray< UMaterialInterface * > &OutMaterials, bool bGetDebugMaterials=false) const override
 
virtual class UBodySetupGetBodySetup () override
 
virtual int32 GetNumMaterials () const override
 
virtual UMaterialInterfaceGetMaterial (int32 MaterialIndex) const override
 
virtual UMaterialInterfaceGetMaterialFromCollisionFaceIndex (int32 FaceIndex, int32 &SectionIndex) const override
 
virtual bool IsPrecomputedLightingValid () const override
 
virtual void InvalidateLightingCacheDetailed (bool bInvalidateBuildEnqueuedLighting, bool bTranslationOnly) override
 
virtual void PropagateLightingScenarioChange () override
 
virtual void Serialize (FArchive &Ar) override
 
virtual void PostLoad () override
 
virtual bool IsNameStableForNetworking () const override
 
virtual bool GetPhysicsTriMeshData (struct FTriMeshCollisionData *CollisionData, bool InUseAllTriData) override
 
virtual bool GetTriMeshSizeEstimates (struct FTriMeshCollisionDataEstimates &OutTriMeshEstimates, bool bInUseAllTriData) const override
 
virtual bool ContainsPhysicsTriMeshData (bool InUseAllTriData) const override
 
virtual bool WantsNegXTriMesh () override
 
void CreateModelBodySetup ()
 
UModelGetModel () const
 
const TIndirectArray< FModelElement > & GetElements () const
 
TIndirectArray< FModelElement > & GetElements ()
 

Static Public Member Functions

static void AddReferencedObjects (UObject *InThis, FReferenceCollector &Collector)
 
static FModelElementCreateNewTempElement (UModelComponent *Component)
 
static ENGINE_API void ApplyTempElements (bool bLightingWasSuccessful)
 

Public Attributes

TObjectPtr< class UBodySetupModelBodySetup
 

Protected Member Functions

virtual bool SupportsStaticLighting () const override
 

Friends

class UModel
 
class FStaticLightingSystem
 
void SetDebugLightmapSample (TArray< UActorComponent * > *Components, UModel *Model, int32 iSurf, FVector ClickLocation)
 

Detailed Description

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.

See also
ULevel

Member Function Documentation

◆ AddReferencedObjects()

void UModelComponent::AddReferencedObjects ( UObject InThis,
FReferenceCollector Collector 
)
static

◆ ApplyTempElements()

void UModelComponent::ApplyTempElements ( bool  bLightingWasSuccessful)
static

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

Parameters
bLightingWasSuccessfulIf true, the lighting should be applied, otherwise, the temp lighting should be cleaned up

◆ BuildRenderData()

void UModelComponent::BuildRenderData ( )

Rebuild the model's rendering info.

◆ CalcBounds()

FBoxSphereBounds UModelComponent::CalcBounds ( const FTransform LocalToWorld) const
overridevirtual

◆ CommitSurfaces()

void UModelComponent::CommitSurfaces ( )

Commit the editor's changes to BSP surfaces. Reconstructs rendering info based on the new surface data. The model should not be attached when this is called.

◆ ContainsPhysicsTriMeshData()

bool UModelComponent::ContainsPhysicsTriMeshData ( bool  InUseAllTriData) const
overridevirtual

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

Returns
true if the implementing object contains triangle mesh data, false otherwise

Reimplemented from IInterface_CollisionDataProvider.

◆ CopyElementsFrom()

void UModelComponent::CopyElementsFrom ( UModelComponent OtherModelComponent)

Copy model elements from the other component. This is used when duplicating components for PIE to guarantee correct rendering.

◆ CreateModelBodySetup()

void UModelComponent::CreateModelBodySetup ( )

Ensure ModelBodySetup is present and correctly configured.

◆ CreateNewTempElement()

FModelElement * UModelComponent::CreateNewTempElement ( UModelComponent Component)
static

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

Parameters
ComponentThe UModelComponent to make the temp element in

◆ CreateRenderState_Concurrent()

void UModelComponent::CreateRenderState_Concurrent ( FRegisterComponentContext Context)
overridevirtual

◆ CreateSceneProxy()

FPrimitiveSceneProxy * UModelComponent::CreateSceneProxy ( )
overridevirtual

◆ DestroyRenderState_Concurrent()

void UModelComponent::DestroyRenderState_Concurrent ( )
overridevirtual

◆ GetBodySetup()

virtual class UBodySetup * UModelComponent::GetBodySetup ( )
inlineoverridevirtual

◆ GetElements() [1/2]

TIndirectArray< FModelElement > & UModelComponent::GetElements ( )
inline

◆ GetElements() [2/2]

const TIndirectArray< FModelElement > & UModelComponent::GetElements ( ) const
inline

◆ GetLightAndShadowMapMemoryUsage()

void UModelComponent::GetLightAndShadowMapMemoryUsage ( int32 LightMapMemoryUsage,
int32 ShadowMapMemoryUsage 
) const
overridevirtual

◆ GetLightMapResolution()

bool UModelComponent::GetLightMapResolution ( int32 Width,
int32 Height 
) const
overridevirtual

◆ GetMaterial()

UMaterialInterface * UModelComponent::GetMaterial ( int32  MaterialIndex) const
overridevirtual

◆ GetMaterialFromCollisionFaceIndex()

UMaterialInterface * UModelComponent::GetMaterialFromCollisionFaceIndex ( int32  FaceIndex,
int32 SectionIndex 
) const
overridevirtual

◆ GetModel()

UModel * UModelComponent::GetModel ( ) const
inline

◆ GetNumMaterials()

int32 UModelComponent::GetNumMaterials ( ) const
overridevirtual

◆ GetPhysicsTriMeshData()

bool UModelComponent::GetPhysicsTriMeshData ( struct FTriMeshCollisionData CollisionData,
bool  InUseAllTriData 
)
overridevirtual

Interface for retrieving triangle mesh collision data from the implementing object

Parameters
CollisionData- structure given by the caller to be filled with tri mesh collision data
Returns
true if successful, false if unable to successfully fill in data structure

Reimplemented from IInterface_CollisionDataProvider.

◆ GetStaticLightingType()

virtual ELightMapInteractionType UModelComponent::GetStaticLightingType ( ) const
inlineoverridevirtual

◆ GetStaticLightMapResolution()

int32 UModelComponent::GetStaticLightMapResolution ( ) const
overridevirtual

◆ GetStreamingRenderAssetInfo()

void UModelComponent::GetStreamingRenderAssetInfo ( FStreamingTextureLevelContext LevelContext,
TArray< FStreamingRenderAssetPrimitiveInfo > &  OutStreamingRenderAssets 
) const
overridevirtual

◆ GetSurfaceLightMapResolution()

void UModelComponent::GetSurfaceLightMapResolution ( int32  SurfaceIndex,
int32  QualityScale,
int32 Width,
int32 Height,
FMatrix WorldToMap,
TArray< int32 > *  GatheredNodes = NULL 
) const

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

◆ GetTriMeshSizeEstimates()

bool UModelComponent::GetTriMeshSizeEstimates ( struct FTriMeshCollisionDataEstimates OutTriMeshEstimates,
bool  bInUseAllTriData 
) const
overridevirtual

Returns an estimate of how much data would be retrieved by GetPhysicsTriMeshData.

Parameters
OutTriMeshEstimates- structure given by the caller to be filled with tri mesh estimate data
Returns
true if successful, false if unable to successfully fill in data structure

Reimplemented from IInterface_CollisionDataProvider.

◆ GetUsedMaterials()

void UModelComponent::GetUsedMaterials ( TArray< UMaterialInterface * > &  OutMaterials,
bool  bGetDebugMaterials = false 
) const
overridevirtual

◆ InvalidateLightingCacheDetailed()

void UModelComponent::InvalidateLightingCacheDetailed ( bool  bInvalidateBuildEnqueuedLighting,
bool  bTranslationOnly 
)
overridevirtual

◆ IsNameStableForNetworking()

bool UModelComponent::IsNameStableForNetworking ( ) const
overridevirtual

◆ IsPrecomputedLightingValid()

bool UModelComponent::IsPrecomputedLightingValid ( ) const
overridevirtual

◆ PostLoad()

void UModelComponent::PostLoad ( )
overridevirtual

◆ PropagateLightingScenarioChange()

void UModelComponent::PropagateLightingScenarioChange ( )
overridevirtual

◆ Serialize()

void UModelComponent::Serialize ( FArchive Ar)
overridevirtual

◆ ShouldRecreateProxyOnUpdateTransform()

bool UModelComponent::ShouldRecreateProxyOnUpdateTransform ( ) const
overridevirtual

◆ ShrinkElements()

void UModelComponent::ShrinkElements ( )

Free empty elements.

◆ SupportsStaticLighting()

virtual bool UModelComponent::SupportsStaticLighting ( ) const
inlineoverrideprotectedvirtual

Whether the component type supports static lighting.

◆ WantsNegXTriMesh()

virtual bool UModelComponent::WantsNegXTriMesh ( )
inlineoverridevirtual

Do we want to create a negative version of this mesh

Reimplemented from IInterface_CollisionDataProvider.

Friends And Related Symbol Documentation

◆ FStaticLightingSystem

friend class FStaticLightingSystem
friend

◆ SetDebugLightmapSample

void SetDebugLightmapSample ( TArray< UActorComponent * > *  Components,
UModel Model,
int32  iSurf,
FVector  ClickLocation 
)
friend

◆ UModel

friend class UModel
friend

Member Data Documentation

◆ ModelBodySetup

TObjectPtr<class UBodySetup> UModelComponent::ModelBodySetup

Description of collision


The documentation for this class was generated from the following files: