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

#include <ARComponent.h>

+ Inheritance diagram for UARComponent:

Public Member Functions

UE_API UARComponent ()
 
UE_API void SetNativeID (FGuid NativeID)
 
UMRMeshComponent * GetMRMesh ()
 
UE_API void ReceiveRemove ()
 
UE_API void UpdateVisualization ()
 
virtual void Update (UARTrackedGeometry *TrackedGeometry)
 
virtual UE_API void Remove (UARTrackedGeometry *TrackedGeometry)
 
 DECLARE_MULTICAST_DELEGATE_OneParam (FMRMeshDelegate, UMRMeshComponent *)
 

Public Attributes

FGuid NativeID
 
FMRMeshDelegate OnMRMeshCreated
 
FMRMeshDelegate OnMRMeshDestroyed
 

Protected Member Functions

virtual UE_API void OnUnregister () override
 
virtual UE_API void OnRep_Payload ()
 
UE_API void RemoveMeshComponent (UARTrackedGeometry *TrackedGeometry)
 
UE_API void ManageMeshComponentForDebugMode (bool bDebugModeEnabled, const FARSessionPayload &SessionPayload)
 
UE_API FLinearColor GetDebugColor () const
 

Protected Attributes

bool bUseDefaultReplication = true
 
TObjectPtr< UMaterialInterfaceDefaultMeshMaterial = nullptr
 
TObjectPtr< UMaterialInterfaceDefaultWireframeMeshMaterial = nullptr
 
TObjectPtr< UMRMeshComponent > MRMeshComponent
 
TObjectPtr< UARTrackedGeometryMyTrackedGeometry
 
bool bFirstUpdate = true
 
bool bIsRemoved = false
 
bool bInDebugMode = false
 
bool bSavedWireframeMode
 
FLinearColor SavedWireframeColor
 

Detailed Description

ARComponent handles replication and visualization update for AR tracked geometries ARComponent is created in either multiplayer or local only environment

To customize the visualization logic, override 'UpdateVisualization' in Blueprint or 'UpdateVisualization_Implementation' in C++

To customize the replication logic, disable 'bUseDefaultReplication' and implement your own replication logic when the ARComponent is updated (see how 'Update' is implemented in the sub classes)

A MRMeshComponent will be created if mesh visualization is enabled (see UARSessionConfig::bGenerateMeshDataFromTrackedGeometry) It can be accessed via 'GetMRMesh' or 'UARTrackedGeometry::GetUnderlyingMesh'

Constructor & Destructor Documentation

◆ UARComponent()

UARComponent::UARComponent ( )

Member Function Documentation

◆ DECLARE_MULTICAST_DELEGATE_OneParam()

UARComponent::DECLARE_MULTICAST_DELEGATE_OneParam ( FMRMeshDelegate  ,
UMRMeshComponent *   
)

◆ GetDebugColor()

FLinearColor UARComponent::GetDebugColor ( ) const
protected

◆ GetMRMesh()

UMRMeshComponent * UARComponent::GetMRMesh ( )
inline

◆ ManageMeshComponentForDebugMode()

void UARComponent::ManageMeshComponentForDebugMode ( bool  bDebugModeEnabled,
const FARSessionPayload SessionPayload 
)
protected

◆ OnRep_Payload()

◆ OnUnregister()

void UARComponent::OnUnregister ( )
overrideprotectedvirtual

◆ ReceiveRemove()

UE_API void UARComponent::ReceiveRemove ( )

Event when native representation is removed, called on server and clients.

◆ Remove()

void UARComponent::Remove ( UARTrackedGeometry TrackedGeometry)
virtual

◆ RemoveMeshComponent()

void UARComponent::RemoveMeshComponent ( UARTrackedGeometry TrackedGeometry)
protected

◆ SetNativeID()

void UARComponent::SetNativeID ( FGuid  NativeID)

◆ Update()

◆ UpdateVisualization()

UE_API void UARComponent::UpdateVisualization ( )

Member Data Documentation

◆ bFirstUpdate

bool UARComponent::bFirstUpdate = true
protected

If this component has ever been updated

◆ bInDebugMode

bool UARComponent::bInDebugMode = false
protected

◆ bIsRemoved

bool UARComponent::bIsRemoved = false
protected

If 'ReceiveRemove' has been called for this component

◆ bSavedWireframeMode

bool UARComponent::bSavedWireframeMode
protected

◆ bUseDefaultReplication

bool UARComponent::bUseDefaultReplication = true
protected

If the default replication logic should be used for this component

◆ DefaultMeshMaterial

TObjectPtr<UMaterialInterface> UARComponent::DefaultMeshMaterial = nullptr
protected

The default material to be used for the generated mesh component. If not set, the DefaultMeshMaterial from ARSessionConfig will be used.

◆ DefaultWireframeMeshMaterial

TObjectPtr<UMaterialInterface> UARComponent::DefaultWireframeMeshMaterial = nullptr
protected

The default wireframe material to be used for the generated mesh component. If not set, the DefaultMeshMaterial from ARSessionConfig will be used.

◆ MRMeshComponent

TObjectPtr<UMRMeshComponent> UARComponent::MRMeshComponent
protected

◆ MyTrackedGeometry

TObjectPtr<UARTrackedGeometry> UARComponent::MyTrackedGeometry
protected

The tracked geometry used for updating this component, only set on "local" client

◆ NativeID

FGuid UARComponent::NativeID

◆ OnMRMeshCreated

FMRMeshDelegate UARComponent::OnMRMeshCreated

◆ OnMRMeshDestroyed

FMRMeshDelegate UARComponent::OnMRMeshDestroyed

◆ SavedWireframeColor

FLinearColor UARComponent::SavedWireframeColor
protected

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