UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ARTrackable.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "ARTypes.h"
6#include "ARComponent.h"
7#include "ARTrackable.generated.h"
8
9#define UE_API AUGMENTEDREALITY_API
10
13class UMRMeshComponent;
14
15UCLASS(MinimalAPI, BlueprintType)
17{
19
20public:
22
23 UE_API void InitializeNativeResource(IARRef* InNativeResource);
24
25 UE_API virtual void DebugDraw( UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const;
26
27 UE_API void GetNetworkPayload(FARMeshUpdatePayload& Payload);
28
29 UE_API void UpdateTrackedGeometryNoMove(const TSharedRef<FARSupportInterface, ESPMode::ThreadSafe>& InTrackingSystem, uint32 FrameNumber, double Timestamp);
31
32 UE_API void UpdateTrackingState( EARTrackingState NewTrackingState );
33
34 UE_API void UpdateAlignmentTransform( const FTransform& NewAlignmentTransform );
35
36 UE_API void SetDebugName( FName InDebugName );
37
38 UE_API void SetName(const FString& InName);
39
40 UE_API IARRef* GetNativeResource();
41
42 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
43 UE_API FTransform GetLocalToWorldTransform() const;
44
45 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
46 UE_API FTransform GetLocalToTrackingTransform() const;
47
48 UE_API FTransform GetLocalToTrackingTransform_NoAlignment() const;
49
50 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
51 UE_API EARTrackingState GetTrackingState() const;
52 UE_API void SetTrackingState(EARTrackingState NewState);
53
54 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
55 UE_API bool IsTracked() const;
56
57 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
58 UE_API FName GetDebugName() const;
59
60 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
61 UE_API const FString& GetName() const;
62
63 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
64 UE_API int32 GetLastUpdateFrameNumber() const;
65
66 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
67 UE_API float GetLastUpdateTimestamp() const;
68 inline void SetLastUpdateTimestamp(double InTimestamp) { LastUpdateTimestamp = InTimestamp; }
69
70 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Tracked Geometry")
71 UE_API UMRMeshComponent* GetUnderlyingMesh();
72 UE_API void SetUnderlyingMesh(UMRMeshComponent* InMRMeshComponent);
73
74 UPROPERTY(BlueprintReadOnly, Category="AR AugmentedReality|Tracked Geometry")
75 FGuid UniqueId;
76
77 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Scene Understanding")
78 EARObjectClassification GetObjectClassification() const { return ObjectClassification; }
80
81 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Scene Understanding")
82 bool HasSpatialMeshUsageFlag(const EARSpatialMeshUsageFlags InFlag) const { return ((int32)SpatialMeshUsageFlags & (int32)InFlag) != 0; }
83 void SetSpatialMeshUsageFlags(const EARSpatialMeshUsageFlags InFlags) { SpatialMeshUsageFlags = InFlags; }
84
85protected:
87 UE_API void UpdateSessionPayload(FARSessionPayload& Payload) const;
88
89 UPROPERTY()
90 FTransform LocalToTrackingTransform;
91
92 UPROPERTY()
93 FTransform LocalToAlignedTrackingTransform;
94
95 UPROPERTY()
96 EARTrackingState TrackingState;
97
99 TUniquePtr<IARRef> NativeResource;
100
103 TObjectPtr<UMRMeshComponent> UnderlyingMesh;
104
106 UPROPERTY()
107 EARObjectClassification ObjectClassification;
108
110 UPROPERTY()
111 EARSpatialMeshUsageFlags SpatialMeshUsageFlags;
112
113private:
115
117 UPROPERTY()
118 int32 LastUpdateFrameNumber;
119
121 double LastUpdateTimestamp;
122
124 UPROPERTY()
125 FName DebugName;
126
128 FString AnchorName;
129};
130
131UCLASS(MinimalAPI, BlueprintType)
133{
135
136public:
137
139
141
142 UE_API virtual void DebugDraw( UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const override;
143
144 UE_API void GetNetworkPayload(FARPlaneUpdatePayload& Payload);
145
146public:
147 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Plane Geometry")
148 FVector GetCenter() const { return Center; }
149
150 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Plane Geometry")
151 FVector GetExtent() const { return Extent; }
152
153 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Plane Geometry")
154 TArray<FVector> GetBoundaryPolygonInLocalSpace() const { return BoundaryPolygon; }
155
156 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Plane Geometry")
157 UARPlaneGeometry* GetSubsumedBy() const { return SubsumedBy; };
158
159 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Plane Geometry")
160 EARPlaneOrientation GetOrientation() const { return Orientation; }
162
163private:
164 UPROPERTY()
166
167 UPROPERTY()
169
170 UPROPERTY()
171 FVector Extent;
172
173 UPROPERTY()
174 TArray<FVector> BoundaryPolygon;
175
176 // Used by ARCore Only
177 UPROPERTY()
178 TObjectPtr<UARPlaneGeometry> SubsumedBy = nullptr;
179};
180
181UCLASS(MinimalAPI, BlueprintType)
183{
185
186public:
187 UE_API virtual void DebugDraw(UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const override;
188
189 UE_API void GetNetworkPayload(FARPointUpdatePayload& Payload);
190
192};
193
194UCLASS(MinimalAPI, BlueprintType)
196{
198
199public:
200 UE_API virtual void DebugDraw(UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const override;
201
202 UE_API void GetNetworkPayload(FARImageUpdatePayload& Payload);
203
205
207 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Image Detection")
208 UARCandidateImage* GetDetectedImage() const { return DetectedImage; };
209
210 /*
211 * Get the estimate size of the detected image, where X is the estimated width, and Y is the estimated height.
212 *
213 * Note that ARCore can return a valid estimate size of the detected image when the tracking state of the UARTrackedImage
214 * is tracking. The size should reflect the actual size of the image target, which could be different than the input physical
215 * size of the candidate image.
216 *
217 * ARKit will return the physical size of the ARCandidate image.
218 */
219 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Image Detection")
220 UE_API FVector2D GetEstimateSize();
221
224 UPROPERTY()
226
228 UPROPERTY()
229 FVector2D EstimatedSize;
230};
231
232UCLASS(MinimalAPI, BlueprintType)
235{
237
238public:
239 UE_API void GetNetworkPayload(FARQRCodeUpdatePayload& Payload);
240
242
244 UPROPERTY(BlueprintReadOnly, Category="QR Code")
245 FString QRCode;
246
248 UPROPERTY(BlueprintReadOnly, Category="QR Code")
249 int32 Version;
250};
251
252UENUM(BlueprintType, Category="AR AugmentedReality", meta=(Experimental))
260
261UENUM(BlueprintType, Category="AR AugmentedReality", meta=(Experimental))
263{
264 // Left eye blend shapes
272 // Right eye blend shapes
280 // Jaw blend shapes
282 JawLeft,
283 JawRight,
284 JawOpen,
285 // Mouth blend shapes
289 MouthLeft,
309 // Brow blend shapes
315 // Cheek blend shapes
316 CheekPuff,
319 // Nose blend shapes
322 TongueOut,
323 // Treat the head rotation as curves for LiveLink support
324 HeadYaw,
325 HeadPitch,
326 HeadRoll,
327 // Treat eye rotation as curves for LiveLink support
334 MAX
335};
336
337UENUM(BlueprintType, Category="AR AugmentedReality", meta=(Experimental))
339{
340 LeftEye,
342};
343
345
346UCLASS(MinimalAPI, BlueprintType)
348{
350
351public:
353
354 UE_API virtual void DebugDraw( UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const override;
355
356 UE_API void GetNetworkPayload(FARFaceUpdatePayload& Payload);
357
358public:
359 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Face Geometry")
360 UE_API float GetBlendShapeValue(EARFaceBlendShape BlendShape) const;
361
362 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Face Geometry")
363 UE_API const TMap<EARFaceBlendShape, float> GetBlendShapes() const;
364
365 const FARBlendShapeMap& GetBlendShapesRef() const { return BlendShapes; }
366
368 const TArray<int32>& GetIndexBuffer() const { return IndexBuffer; }
369 const TArray<FVector2D>& GetUVs() const { return UVs; }
370
371 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Face Geometry")
372 UE_API const FTransform& GetLocalSpaceEyeTransform(EAREye Eye) const;
373
374 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Face Geometry")
375 UE_API FTransform GetWorldSpaceEyeTransform(EAREye Eye) const;
376
378 UPROPERTY(BlueprintReadOnly, Category="AR AugmentedReality|Face Geometry")
379 FVector LookAtTarget;
380
381 UE_DEPRECATED(4.21, "This property is now deprecated, please use GetTrackingState() and check for EARTrackingState::Tracking or IsTracked() instead.")
383 UPROPERTY(BlueprintReadOnly, Category="AR AugmentedReality|Face Geometry", meta=(Deprecated, DeprecationMessage = "This property is now deprecated, please use GetTrackingState() and check for EARTrackingState::Tracking or IsTracked() instead."))
384 bool bIsTracked;
385
386private:
387 UPROPERTY()
388 TMap<EARFaceBlendShape, float> BlendShapes;
389
390 // Holds the face data for one or more face components that want access
393 // @todo JoeG - route the uvs in
395
397 UPROPERTY()
398 FTransform LeftEyeTransform;
399
401 UPROPERTY()
402 FTransform RightEyeTransform;
403};
404
406UCLASS(MinimalAPI, BlueprintType)
409{
411
412public:
414
416 UE_API virtual void DebugDraw(UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const override;
417
418 UE_API void GetNetworkPayload(FAREnvironmentProbeUpdatePayload& Payload);
419
421
423 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Environment Capture Probe")
424 UE_API FVector GetExtent() const;
426 UFUNCTION(BlueprintPure, Category="AR AugmentedReality|Environment Capture Probe")
427 UE_API UAREnvironmentCaptureProbeTexture* GetEnvironmentCaptureTexture();
428
429protected:
431 UPROPERTY()
432 FVector Extent;
433
435 UPROPERTY()
437};
438
439UCLASS(MinimalAPI, BlueprintType)
441{
443
444public:
445 UE_API virtual void DebugDraw(UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const override;
446
447 UE_API void GetNetworkPayload(FARObjectUpdatePayload& Payload);
448
450
452 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Object Detection")
453 UARCandidateObject* GetDetectedObject() const { return DetectedObject; };
454
455private:
457 UPROPERTY()
458 TObjectPtr<UARCandidateObject> DetectedObject;
459};
460
461UCLASS(MinimalAPI, BlueprintType)
463{
465
466public:
467 UE_API virtual void DebugDraw(UWorld* World, const FLinearColor& OutlineColor, float OutlineThickness, float PersistForSeconds = 0.0f) const override;
468
469 UE_API void GetNetworkPayload(FARPoseUpdatePayload& Payload);
470
472
473 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Pose Tracking")
474 const FARPose3D& GetTrackedPoseData() const { return TrackedPose; };
475
476private:
478 UPROPERTY()
479 FARPose3D TrackedPose;
480};
481
482UCLASS(MinimalAPI, BlueprintType)
484{
486
487public:
488
489 UE_API void GetNetworkPayload(FARMeshUpdatePayload& Payload);
490
499 UFUNCTION(BlueprintCallable, Category = "AR AugmentedReality|Classification")
500 virtual bool GetObjectClassificationAtLocation(const FVector& InWorldLocation, EARObjectClassification& OutClassification, FVector& OutClassificationLocation, float MaxLocationDiff = 10.f) { return false; }
501};
502
503
504UCLASS(MinimalAPI, BlueprintType)
506{
508
509public:
512
513 UE_API void GetNetworkPayload(FARGeoAnchorUpdatePayload& Payload);
514
515 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Geo Tracking")
516 float GetLongitude() const { return Longitude; }
517
518 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Geo Tracking")
519 float GetLatitude() const { return Latitude; }
520
521 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Geo Tracking")
522 float GetAltitudeMeters() const { return AltitudeMeters; }
523
524 UFUNCTION(BlueprintPure, Category = "AR AugmentedReality|Geo Tracking")
525 EARAltitudeSource GetAltitudeSource() const { return AltitudeSource; }
526
527private:
528 float Longitude = 0.f;
529 float Latitude = 0.f;
530 float AltitudeMeters = 0.f;
532};
533
534#undef UE_API
TMap< EARFaceBlendShape, float > FARBlendShapeMap
Definition ARTrackable.h:344
EARFaceBlendShape
Definition ARTrackable.h:263
#define UE_API
Definition ARTrackable.h:9
EARFaceTrackingDirection
Definition ARTrackable.h:254
EAREye
Definition ARTrackable.h:339
EARTrackingState
Definition ARTypes.h:30
EARPlaneOrientation
Definition ARTypes.h:166
EARSpatialMeshUsageFlags
Definition ARTypes.h:211
EARObjectClassification
Definition ARTypes.h:176
EARAltitudeSource
Definition ARTypes.h:239
#define check(expr)
Definition AssertionMacros.h:314
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
ESPMode
Definition SharedPointerFwd.h:12
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ARSupportInterface.h:29
Definition NameTypes.h:617
Definition UnrealType.h:3087
Definition ARTypes.h:292
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition UniquePtr.h:107
Definition SharedPointer.h:1295
Definition ARTypes.h:313
Definition ARTypes.h:381
Definition ARTextures.h:129
Definition ARTrackable.h:409
Definition ARTrackable.h:348
const FARBlendShapeMap & GetBlendShapesRef() const
Definition ARTrackable.h:365
const TArray< int32 > & GetIndexBuffer() const
Definition ARTrackable.h:368
const TArray< FVector2D > & GetUVs() const
Definition ARTrackable.h:369
const TArray< FVector > & GetVertexBuffer() const
Definition ARTrackable.h:367
Definition ARTrackable.h:506
Definition ARTrackable.h:484
Definition ARTrackable.h:133
void SetOrientation(EARPlaneOrientation InOrientation)
Definition ARTrackable.h:161
Definition ARTrackable.h:17
void SetSpatialMeshUsageFlags(const EARSpatialMeshUsageFlags InFlags)
Definition ARTrackable.h:83
void SetObjectClassification(EARObjectClassification InClassification)
Definition ARTrackable.h:79
void SetLastUpdateTimestamp(double InTimestamp)
Definition ARTrackable.h:68
Definition ARTrackable.h:196
Definition ARTrackable.h:441
Definition ARTrackable.h:183
Definition ARTrackable.h:463
Definition ARTrackable.h:235
Definition Object.h:95
Definition World.h:918
Definition RobinHoodHashTable.h:18
Definition ARComponent.h:150
Definition ARComponent.h:83
Definition ARComponent.h:185
Definition ARComponent.h:102
Definition ARComponent.h:169
Definition ARComponent.h:159
Definition ARComponent.h:52
Definition ARComponent.h:76
Definition ARTypes.h:577
Definition ARComponent.h:138
Definition ARComponent.h:120
Definition ARComponent.h:32
Definition Guid.h:109
Definition Color.h:48
Definition ObjectPtr.h:488