UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPrimitiveComponentTarget Class Referenceabstract

#include <ComponentSourceInterfaces.h>

Classes

struct  FCommitParams
 

Public Types

using FCommitter = TFunction< void(const FCommitParams &) >
 

Public Member Functions

virtual ~FPrimitiveComponentTarget ()
 
 FPrimitiveComponentTarget (UPrimitiveComponent *Component)
 
virtual INTERACTIVETOOLSFRAMEWORK_API bool IsValid () const
 
INTERACTIVETOOLSFRAMEWORK_API AActorGetOwnerActor () const
 
INTERACTIVETOOLSFRAMEWORK_API UPrimitiveComponent * GetOwnerComponent () const
 
INTERACTIVETOOLSFRAMEWORK_API int32 GetNumMaterials () const
 
INTERACTIVETOOLSFRAMEWORK_API UMaterialInterfaceGetMaterial (int32 MaterialIndex) const
 
virtual INTERACTIVETOOLSFRAMEWORK_API void GetMaterialSet (FComponentMaterialSet &MaterialSetOut, bool bAssetMaterials=false) const
 
INTERACTIVETOOLSFRAMEWORK_API FTransform GetWorldTransform () const
 
INTERACTIVETOOLSFRAMEWORK_API bool HitTest (const FRay &WorldRay, FHitResult &OutHit) const
 
INTERACTIVETOOLSFRAMEWORK_API void SetOwnerVisibility (bool bVisible) const
 
virtual bool HasSameSourceData (const FPrimitiveComponentTarget &OtherTarget) const =0
 
virtual INTERACTIVETOOLSFRAMEWORK_API void CommitMaterialSetUpdate (const FComponentMaterialSet &MaterialSet, bool bApplyToAsset)
 
virtual FMeshDescriptionGetMesh ()=0
 
virtual void CommitMesh (const FCommitter &)=0
 

Public Attributes

UPrimitiveComponent * Component {}
 

Detailed Description

Wrapper around a UObject Component that can provide a MeshDescription, and (optionally) bake a modified MeshDescription back to this Component. An example of a Source might be a StaticMeshComponent. How a modified MeshDescription is committed back is context-dependent (in Editor vs PIE vs Runtime, etc).

(Conceivably this doesn't have to be backed by a Component, but most usage will assume there is an Actor)

Member Typedef Documentation

◆ FCommitter

Constructor & Destructor Documentation

◆ ~FPrimitiveComponentTarget()

virtual FPrimitiveComponentTarget::~FPrimitiveComponentTarget ( )
inlinevirtual

◆ FPrimitiveComponentTarget()

FPrimitiveComponentTarget::FPrimitiveComponentTarget ( UPrimitiveComponent *  Component)
inline

Constructor UPrimitivecomponent*

Parameters
Componentthe UPrimitiveComponent* to target

Member Function Documentation

◆ CommitMaterialSetUpdate()

void FPrimitiveComponentTarget::CommitMaterialSetUpdate ( const FComponentMaterialSet MaterialSet,
bool  bApplyToAsset 
)
virtual

Commit an update to the material set. This may generate a transaction.

Parameters
MaterialSetnew list of materials
bApplyToAssetif true, materials of Asset are updated (if Asset exists), rather than Component

◆ CommitMesh()

virtual void FPrimitiveComponentTarget::CommitMesh ( const FCommitter )
pure virtual

◆ GetMaterial()

UMaterialInterface * FPrimitiveComponentTarget::GetMaterial ( int32  MaterialIndex) const

Get pointer to a Material provided by this Source

Parameters
MaterialIndexindex of the material
Returns
MaterialInterface pointer, or null if MaterialIndex is invalid

◆ GetMaterialSet()

void FPrimitiveComponentTarget::GetMaterialSet ( FComponentMaterialSet MaterialSetOut,
bool  bAssetMaterials = false 
) const
virtual

Get material set provided by this source

Parameters
MaterialSetOutreturned material set
bAssetMaterialsif an underlying asset exists, return the Asset-level material assignment instead of the component materials

◆ GetMesh()

virtual FMeshDescription * FPrimitiveComponentTarget::GetMesh ( )
pure virtual

◆ GetNumMaterials()

int32 FPrimitiveComponentTarget::GetNumMaterials ( ) const
Returns
number of material indices in use by this Component

◆ GetOwnerActor()

AActor * FPrimitiveComponentTarget::GetOwnerActor ( ) const
Returns
the Actor that owns this Component

◆ GetOwnerComponent()

UPrimitiveComponent * FPrimitiveComponentTarget::GetOwnerComponent ( ) const
Returns
the Component this is a Source for

◆ GetWorldTransform()

FTransform FPrimitiveComponentTarget::GetWorldTransform ( ) const
Returns
the transform on this component

◆ HasSameSourceData()

virtual bool FPrimitiveComponentTarget::HasSameSourceData ( const FPrimitiveComponentTarget OtherTarget) const
pure virtual

Checks if the underlying asset that would be edited by CommitMesh() is the same for two ComponentTargets

Parameters
OtherTargetAnother component target to compare against
Returns
true if both component targets are known to share the same source asset

◆ HitTest()

bool FPrimitiveComponentTarget::HitTest ( const FRay WorldRay,
FHitResult OutHit 
) const

Compute ray intersection with the MeshDescription this Source is providing

Parameters
WorldRayray in world space
OutHithit test data
Returns
true if ray intersected Component

◆ IsValid()

bool FPrimitiveComponentTarget::IsValid ( ) const
virtual
Returns
true if component target is still valid. May become invalid for various reasons (eg Component was deleted out from under us)

◆ SetOwnerVisibility()

void FPrimitiveComponentTarget::SetOwnerVisibility ( bool  bVisible) const

Set the visibility of the Component associated with this Source (ie to hide during Tool usage)

Parameters
bVisibledesired visibility

Member Data Documentation

◆ Component

UPrimitiveComponent* FPrimitiveComponentTarget::Component {}

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