UGoogleARCoreFrameFunctionLibrary

#include <GoogleARCoreFunctionLibrary.h>

A function library that provides static/Blueprint functions associated with most recent GoogleARCore tracking frame.

Summary

Inheritance

Inherits from: UBlueprintFunctionLibrary

Public static functions

ARCoreLineTrace(UObject *WorldContextObject, const FVector2D & ScreenPosition, TSet< EGoogleARCoreLineTraceChannel > TraceChannels, TArray< FARTraceResult > & OutHitResults)
bool
Traces a ray from the user's device in the direction of the given location in the camera view.
ARCoreLineTraceRay(UObject *WorldContextObject, const FVector & Start, const FVector & End, TSet< EGoogleARCoreLineTraceChannel > TraceChannels, TArray< FARTraceResult > & OutHitResults)
bool
Traces a ray along the given line.
AcquireCameraImage(UGoogleARCoreCameraImage *& OutLatestCameraImage)
Acquire a CPU-accessible camera image.
AcquirePointCloud(UGoogleARCorePointCloud *& OutLatestPointCloud)
Acquires latest point cloud.
GetCameraImageIntrinsics(UGoogleARCoreCameraIntrinsics *& OutCameraIntrinsics)
Get the camera intrinsics for the camera image (CPU image).
GetCameraTexture()
UTexture *
Get the pass-through camera texture that GoogleARCore plugin will use to render the passthrough camera background.
GetCameraTextureIntrinsics(UGoogleARCoreCameraIntrinsics *& OutCameraIntrinsics)
Get the camera intrinsics for the camera texture (GPU image).
GetLightEstimation(FGoogleARCoreLightEstimate & OutLightEstimate)
void
Gets the latest light estimation.
GetPointCloud(UGoogleARCorePointCloud *& OutLatestPointCloud)
Gets the latest point cloud that will be only available for this frame.
GetPose(FTransform & OutPose)
void
Gets the latest tracking pose of the ARCore device in Unreal AR Tracking Space.
GetTrackingState()
Returns the current ARCore session status.
GetUpdatedARPins(TArray< UARPin * > & OutAnchorList)
void
Gets a list of UARPin objects that were changed in this frame.
GetUpdatedPlanes(TArray< UARPlaneGeometry * > & OutPlaneList)
void
Gets a list of UARPlaneGeometry objects that were changed in this frame.
GetUpdatedTrackable(TArray< T * > & OutTrackableList)
void
Template function to get the updated trackables in this frame a given trackable type.
GetUpdatedTrackablePoints(TArray< UARTrackedPoint * > & OutTrackablePointList)
void
Gets a list of UARTrackedPoint objects that were changed in this frame.

Public static functions

ARCoreLineTrace

bool ARCoreLineTrace(
  UObject *WorldContextObject,
  const FVector2D & ScreenPosition,
  TSet< EGoogleARCoreLineTraceChannel > TraceChannels,
  TArray< FARTraceResult > & OutHitResults
)

Traces a ray from the user's device in the direction of the given location in the camera view.

Intersections with detected scene geometry are returned, sorted by distance from the device; the nearest intersection is returned first.

Details
Parameters
WorldContextObject
The world context.
ScreenPosition
The position on the screen to cast the ray from.
ARObjectType
A set of EGoogleARCoreLineTraceChannel indicate which type of line trace it should perform.
OutHitResults
The list of hit results sorted by distance.
Returns
True if there is a hit detected.

ARCoreLineTraceRay

bool ARCoreLineTraceRay(
  UObject *WorldContextObject,
  const FVector & Start,
  const FVector & End,
  TSet< EGoogleARCoreLineTraceChannel > TraceChannels,
  TArray< FARTraceResult > & OutHitResults
)

Traces a ray along the given line.

Intersections with detected scene geometry are returned, sorted by distance from the start of the line; the nearest intersection is returned first.

Details
Parameters
WorldContextObject
The world context.
Start
The start of line segment.
End
The end of line segment.
ARObjectType
A set of EGoogleARCoreLineTraceChannel indicate which type of line trace it should perform.
OutHitResults
The list of hit results sorted by distance.
Returns
True if there is a hit detected.

AcquireCameraImage

EGoogleARCoreFunctionStatus AcquireCameraImage(
  UGoogleARCoreCameraImage *& OutLatestCameraImage
)

Acquire a CPU-accessible camera image.

Details
Parameters
OutLatestCameraImage
A place to store the pointer to a new UGoogleARCoreCameraImage instance.
Returns
An EGoogleARCoreFunctionStatus. Possible value: Success, ResourceExhausted, NotAvailable.

AcquirePointCloud

EGoogleARCoreFunctionStatus AcquirePointCloud(
  UGoogleARCorePointCloud *& OutLatestPointCloud
)

Acquires latest point cloud.

This will make the point cloud remain valid unless you call UGoogleARCrePointCloud::ReleasePointCloud(). Be aware that this function could fail if the maximal number of point cloud has been acquired.

Details
Parameters
OutLatestPointCloud
A pointer point to the latest point cloud.
Returns
An EGoogleARCoreFunctionStatus. Possible value: Success, SessionPaused, ResourceExhausted.

GetCameraImageIntrinsics

EGoogleARCoreFunctionStatus GetCameraImageIntrinsics(
  UGoogleARCoreCameraIntrinsics *& OutCameraIntrinsics
)

Get the camera intrinsics for the camera image (CPU image).

Details
Parameters
OutCameraIntrinsics
The output intrinsics object.

GetCameraTexture

UTexture * GetCameraTexture()

Get the pass-through camera texture that GoogleARCore plugin will use to render the passthrough camera background.

Note that UTexture object this function returns may change every frame. If you want to use the camera texture, you should call the function every frame and update the texture parameter in your material.

Details
Returns
A pointer to the UTexture that will be used to render the passthrough camera background.

GetCameraTextureIntrinsics

EGoogleARCoreFunctionStatus GetCameraTextureIntrinsics(
  UGoogleARCoreCameraIntrinsics *& OutCameraIntrinsics
)

Get the camera intrinsics for the camera texture (GPU image).

Details
Parameters
OutCameraIntrinsics
The output intrinsics object.

GetLightEstimation

void GetLightEstimation(
  FGoogleARCoreLightEstimate & OutLightEstimate
)

Gets the latest light estimation.

Details
Parameters
OutLightEstimate
The struct that describes the latest light estimation.

GetPointCloud

EGoogleARCoreFunctionStatus GetPointCloud(
  UGoogleARCorePointCloud *& OutLatestPointCloud
)

Gets the latest point cloud that will be only available for this frame.

If you want to keep the point cloud data, you can either copy it to your own struct or call AcquireLatestPointCloud() to avoid the copy.

Details
Parameters
OutLatestPointCloud
A pointer point to the latest point cloud.
Returns
An EGoogleARCoreFunctionStatus. Possible value: Success, SessionPaused, ResourceExhausted.

GetPose

void GetPose(
  FTransform & OutPose
)

Gets the latest tracking pose of the ARCore device in Unreal AR Tracking Space.

Note that ARCore motion tracking has already integrated with HMD and the motion controller interface. Use this function only if you need to implement your own tracking component.

Details
Parameters
OutPose
The latest device pose.
Returns
True if the pose is updated successfully for this frame.

GetTrackingState

EGoogleARCoreTrackingState GetTrackingState()

Returns the current ARCore session status.

Details
Returns
A EARSessionStatus enum that describes the session status.

GetUpdatedARPins

void GetUpdatedARPins(
  TArray< UARPin * > & OutAnchorList
)

Gets a list of UARPin objects that were changed in this frame.

Details
Parameters
OutAnchorList
An array that contains the updated UARPin.

GetUpdatedPlanes

void GetUpdatedPlanes(
  TArray< UARPlaneGeometry * > & OutPlaneList
)

Gets a list of UARPlaneGeometry objects that were changed in this frame.

Details
Parameters
OutARCorePlaneList
An array that contains the updated UARPlaneGeometry.

GetUpdatedTrackable

void GetUpdatedTrackable(
  TArray< T * > & OutTrackableList
)

Template function to get the updated trackables in this frame a given trackable type.

GetUpdatedTrackablePoints

void GetUpdatedTrackablePoints(
  TArray< UARTrackedPoint * > & OutTrackablePointList
)

Gets a list of UARTrackedPoint objects that were changed in this frame.

Details
Parameters
OutARCorePlaneList
An array that contains the updated UARTrackedPoint.

Send feedback about...