Navigation
API > API/Runtime > API/Runtime/Engine
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.
| Name | UModelComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/ModelComponent.h |
| Include Path | #include "Components/ModelComponent.h" |
Syntax
UCLASS (MinimalAPI)
class UModelComponent :
public UPrimitiveComponent ,
public IInterface_CollisionDataProvider
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UModelComponent
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsComponent
- IInterface_CollisionDataProvider
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UModelComponent
(
const FObjectInitializer& ObjectInitializer |
Components/ModelComponent.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| TempBSPElements | TMap< UModelComponent *, TIndirectArray< FModelElement > > | The new BSP elements that are made during lighting, and will be applied to the components when all lighting is done | Components/ModelComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ModelBodySetup | TObjectPtr< class UBodySetup > | Description of collision | Components/ModelComponent.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ComponentIndex | int32 | The index of this component in the ULevel's ModelComponents array. | Components/ModelComponent.h | |
| Elements | TIndirectArray< FModelElement > | The elements used to render the nodes. | Components/ModelComponent.h | |
| Model | TObjectPtr< class UModel > | The BSP tree. | Components/ModelComponent.h | |
| Nodes | TArray< uint16 > | The nodes which this component renders. | Components/ModelComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void BuildRenderData() |
Rebuild the model's rendering info. | Components/ModelComponent.h | |
void CommitSurfaces () |
Commit the editor's changes to BSP surfaces. | Components/ModelComponent.h | |
void CopyElementsFrom
(
UModelComponent* OtherModelComponent |
Copy model elements from the other component. | Components/ModelComponent.h | |
void CreateModelBodySetup() |
Ensure ModelBodySetup is present and correctly configured. | Components/ModelComponent.h | |
virtual bool GenerateElements
(
bool bBuildRenderData |
Generate the Elements array. | Components/ModelComponent.h | |
const TIndirectArray< FModelElement > & GetElements () |
Components/ModelComponent.h | ||
TIndirectArray< FModelElement > & GetElements () |
Components/ModelComponent.h | ||
UModel * GetModel() |
Accessors. | Components/ModelComponent.h | |
virtual void GetStaticLightingInfo
(
FStaticLightingPrimitiveInfo& OutPrimitiveInfo, |
Components/ModelComponent.h | ||
void GetSurfaceLightMapResolution
(
int32 SurfaceIndex, |
Calculate the lightmap resolution to be used by the given surface. | Components/ModelComponent.h | |
| Minimal initialization. | Components/ModelComponent.h | ||
void InvalidateCollisionData() |
Invalidate current collision data | Components/ModelComponent.h | |
void SelectAllSurfaces() |
Selects all surfaces that are part of this model component. | Components/ModelComponent.h | |
void ShrinkElements() |
Free empty elements. | Components/ModelComponent.h |
Overridden from UPrimitiveComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddMapBuildDataGUIDs
(
TSet< FGuid >& InGUIDs |
Add the used GUIDs from UMapBuildDataRegistry::MeshBuildData. | Components/ModelComponent.h | |
virtual FPrimitiveSceneProxy * CreateSceneProxy() |
Creates a proxy to represent the primitive to the scene manager in the rendering thread. | Components/ModelComponent.h | |
virtual UBodySetup * GetBodySetup() |
Return the BodySetup to use for this PrimitiveComponent (single body case) | Components/ModelComponent.h | |
virtual void GetLightAndShadowMapMemoryUsage
(
int32& LightMapMemoryUsage, |
Returns the light and shadow map memory for this primitive in its out variables. | Components/ModelComponent.h | |
virtual bool GetLightMapResolution
(
int32& Width, |
Returns the lightmap resolution used for this primitive instance in the case of it supporting texture light/ shadow maps. | Components/ModelComponent.h | |
virtual UMaterialInterface * GetMaterial
(
int32 ElementIndex |
Returns the material used by the element at the specified index | Components/ModelComponent.h | |
virtual UMaterialInterface * GetMaterialFromCollisionFaceIndex
(
int32 FaceIndex, |
Try and retrieve the material applied to a particular collision face of mesh. | Components/ModelComponent.h | |
virtual int32 GetNumMaterials() |
Return number of material elements in this primitive | Components/ModelComponent.h | |
virtual ELightMapInteractionType GetStaticLightingType() |
Requests whether the component will use texture, vertex or no lightmaps. | Components/ModelComponent.h | |
virtual int32 GetStaticLightMapResolution () |
Returns the static lightmap resolution used for this primitive. | Components/ModelComponent.h | |
virtual void GetStreamingRenderAssetInfo
(
FStreamingTextureLevelContext& LevelContext, |
Enumerates the streaming textures/meshes used by the primitive. | Components/ModelComponent.h | |
virtual void GetUsedMaterials
(
TArray< UMaterialInterface* >& OutMaterials, |
Retrieves the materials used in this component | Components/ModelComponent.h | |
virtual bool ShouldRecreateProxyOnUpdateTransform() |
Determines whether the proxy for this primitive type needs to be recreated whenever the primitive moves. | Components/ModelComponent.h |
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FBoxSphereBounds CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. | Components/ModelComponent.h | |
virtual bool IsPrecomputedLightingValid() |
True if our precomputed lighting is up to date | Components/ModelComponent.h | |
virtual void PropagateLightingScenarioChange() |
Updates any visuals after the lighting has changed | Components/ModelComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void CreateRenderState_Concurrent
(
FRegisterComponentContext* Context |
Used to create any rendering thread information for this component | Components/ModelComponent.h | |
virtual void DestroyRenderState_Concurrent () |
Used to shut down any rendering thread structure for this component | Components/ModelComponent.h | |
virtual void InvalidateLightingCacheDetailed
(
bool bInvalidateBuildEnqueuedLighting, |
Called when this actor component has moved, allowing it to discard statically cached lighting information. | Components/ModelComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsNameStableForNetworking() |
Components/ModelComponent.h | ||
virtual void PostEditUndo() |
Components/ModelComponent.h | ||
virtual void PostLoad() |
Components/ModelComponent.h | ||
virtual void Serialize
(
FArchive& Ar |
Components/ModelComponent.h |
Overridden from IInterface_CollisionDataProvider
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool ContainsPhysicsTriMeshData
(
bool InUseAllTriData |
Interface for checking if the implementing objects contains triangle mesh collision data | Components/ModelComponent.h | |
virtual bool GetPhysicsTriMeshData
(
FTriMeshCollisionData* CollisionData, |
Interface for retrieving triangle mesh collision data from the implementing object | Components/ModelComponent.h | |
virtual bool GetTriMeshSizeEstimates
(
FTriMeshCollisionDataEstimates& OutTriMeshEstimates, |
Returns an estimate of how much data would be retrieved by GetPhysicsTriMeshData. | Components/ModelComponent.h | |
virtual bool WantsNegXTriMesh() |
Do we want to create a negative version of this mesh | Components/ModelComponent.h |
Protected
Overridden from UPrimitiveComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool SupportsStaticLighting() |
Whether the component type supports static lighting. | Components/ModelComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddReferencedObjects
(
UObject* InThis, |
Components/ModelComponent.h | ||
static void ApplyTempElements
(
bool bLightingWasSuccessful |
Apply all the elements that we were putting into the TempBSPElements map to the Elements arrays in all components | Components/ModelComponent.h | |
static FModelElement * CreateNewTempElement
(
UModelComponent* Component |
Create a new temp FModelElement element for the component, which will be applied when lighting is all done. | Components/ModelComponent.h |