UGoogleARCoreSessionFunctionLibrary
#include <GoogleARCoreFunctionLibrary.h>
A function library that provides static/Blueprint functions associated with GoogleARCore session.
Summary
Inheritance
Inherits from: UBlueprintFunctionLibrary
Public static functions |
|
---|---|
AddRuntimeCandidateImageFromRawbytes(UARSessionConfig *SessionConfig, const TArray< uint8 > & ImageGrayscalePixels, int ImageWidth, int ImageHeight, FString FriendlyName, float PhysicalWidth, UTexture2D *CandidateTexture)
|
UARCandidateImage *
Create an ARCandidateImage object from the raw pixel data and add it to the ARCandidateImageList of the given
UARSessionConfig object. |
CheckARCoreAvailability(UObject *WorldContextObject, struct FLatentActionInfo LatentInfo, EGoogleARCoreAvailability & OutAvailability)
|
void
A Latent Action to check the availability of ARCore on this device.
|
CheckARCoreAvailableStatus()
|
EGoogleARCoreAvailability
A polling function to check the ARCore availability in C++.
|
GetARCoreAPKInstallResult()
|
EGoogleARCoreInstallRequestResult
A polling function to check the ARCore install request result in C++.
|
GetARCoreCameraConfig(FGoogleARCoreCameraConfig & OutCurrentCameraConfig)
|
bool
Get the FGoogleARCoreCameraConfig that the current ARCore session is using.
|
GetARCoreEventManager()
|
Get the UGoogleARCoreEventManager to bind BP events or c++ delegate in GoogleARCore plugins.
|
GetAllAugmentedFaces(TArray< UGoogleARCoreAugmentedFace * > & OutAugmentedFaceList)
|
void
Gets a list of all valid UGoogleARCoreAugmentedFace objects that ARCore is currently tracking.
|
GetAllAugmentedImages(TArray< UGoogleARCoreAugmentedImage * > & OutAugmentedImageList)
|
void
Gets a list of all valid UGoogleARCoreAugmentedImage objects that ARCore is currently tracking.
|
GetAllPlanes(TArray< UARPlaneGeometry * > & OutPlaneList)
|
void
Gets a list of all valid UARPlaneGeometry objects that ARCore is currently tracking.
|
GetAllTrackable(TArray< T * > & OutTrackableList)
|
void
Template function to get all trackables from a given type.
|
GetAllTrackablePoints(TArray< UARTrackedPoint * > & OutTrackablePointList)
|
void
Gets a list of all valid UARTrackedPoint objects that ARCore is currently tracking.
|
GetPassthroughCameraImageUV(const TArray< float > & InUV, TArray< float > & OutUV)
|
void
Gets the texture coordinate information about the passthrough camera texture.
|
InstallARCoreService(UObject *WorldContextObject, struct FLatentActionInfo LatentInfo, EGoogleARCoreInstallRequestResult & OutInstallResult)
|
void
A Latent Action to initiates installation of ARCore if required.
|
IsPassthroughCameraRenderingEnabled()
|
bool
Returns the state of the passthrough camera rendering in GoogleARCore ARSystem.
|
RequestInstallARCoreAPK()
|
EGoogleARCoreInstallStatus
Initiates installation of ARCore if required.
|
SetARCoreCameraConfig(FGoogleARCoreCameraConfig TargetCameraConfig)
|
bool
Configure the ARCoreSession with the desired camera configuration.
|
SetPassthroughCameraRenderingEnabled(bool bEnable)
|
void
Enables/Disables the passthrough camera rendering in GoogleARCore ARSystem.
|
StartARCoreSession(UObject *WorldContextObject, struct FLatentActionInfo LatentInfo, UGoogleARCoreSessionConfig *Configuration)
|
void
Starts a new ARCore tracking session GoogleARCore specific configuration.
|
Public static functions
AddRuntimeCandidateImageFromRawbytes
UARCandidateImage * AddRuntimeCandidateImageFromRawbytes( UARSessionConfig *SessionConfig, const TArray< uint8 > & ImageGrayscalePixels, int ImageWidth, int ImageHeight, FString FriendlyName, float PhysicalWidth, UTexture2D *CandidateTexture )
Create an ARCandidateImage object from the raw pixel data and add it to the ARCandidateImageList of the given UARSessionConfig
object.
Note that you need to restart the AR session with the UARSessionConfig
you are adding to to make the change take effect.
On ARCore platform, you can leave the PhysicalWidth and PhysicalHeight to 0 if you don't know the physical size of the image or the physical size is dynamic. And this function takes time to perform non-trivial image processing (20ms - 30ms), and should be run on a background thread.
Details | |
---|---|
Returns |
A
UARCandidateImage Object pointer if the underlying ARPlatform added the candidate image at runtime successfully. Return nullptr otherwise. |
CheckARCoreAvailability
void CheckARCoreAvailability( UObject *WorldContextObject, struct FLatentActionInfo LatentInfo, EGoogleARCoreAvailability & OutAvailability )
A Latent Action to check the availability of ARCore on this device.
This may initiate a query with a remote service to determine if the device is supported by ARCore. The Latent Action will complete when the check is finished.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
CheckARCoreAvailableStatus
EGoogleARCoreAvailability CheckARCoreAvailableStatus()
A polling function to check the ARCore availability in C++.
This may initiate a query with a remote service to determine if the device is supported by ARCore, so this function will EGoogleARCoreAvailability::UnknownChecking.
Details | |
---|---|
Returns |
The availability result as a EGoogleARCoreAvailability.
|
GetARCoreAPKInstallResult
EGoogleARCoreInstallRequestResult GetARCoreAPKInstallResult()
A polling function to check the ARCore install request result in C++.
After you call RequestInstallARCoreAPK() and it returns EGoogleARCoreInstallStatus::Requrested. You can call this function to check the install requst result.
Details | |
---|---|
Returns |
The install request result as a EGoogleARCoreInstallRequestResult.
|
GetARCoreCameraConfig
bool GetARCoreCameraConfig( FGoogleARCoreCameraConfig & OutCurrentCameraConfig )
Get the FGoogleARCoreCameraConfig that the current ARCore session is using.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
True if there is a valid ARCore session and the current camera config is returned. False if ARCore session hasn't been started or it is already stopped.
|
GetARCoreEventManager
UGoogleARCoreEventManager * GetARCoreEventManager()
Get the UGoogleARCoreEventManager to bind BP events or c++ delegate in GoogleARCore plugins.
GetAllAugmentedFaces
void GetAllAugmentedFaces( TArray< UGoogleARCoreAugmentedFace * > & OutAugmentedFaceList )
Gets a list of all valid UGoogleARCoreAugmentedFace objects that ARCore is currently tracking.
UGoogleARCoreAugmentedFace that have entered the EARTrackingState::StoppedTracking state will not be included.
Details | |||
---|---|---|---|
Parameters |
|
GetAllAugmentedImages
void GetAllAugmentedImages( TArray< UGoogleARCoreAugmentedImage * > & OutAugmentedImageList )
Gets a list of all valid UGoogleARCoreAugmentedImage objects that ARCore is currently tracking.
UGoogleARCoreAugmentedImage that have entered the EARTrackingState::StoppedTracking state will not be included.
Details | |||
---|---|---|---|
Parameters |
|
GetAllPlanes
void GetAllPlanes( TArray< UARPlaneGeometry * > & OutPlaneList )
Gets a list of all valid UARPlaneGeometry objects that ARCore is currently tracking.
Planes that have entered the EARTrackingState::StoppedTracking state or for which UARPlaneGeometry::GetSubsumedBy returns non-null will not be included.
Details | |||
---|---|---|---|
Parameters |
|
GetAllTrackable
void GetAllTrackable( TArray< T * > & OutTrackableList )
Template function to get all trackables from a given type.
GetAllTrackablePoints
void GetAllTrackablePoints( TArray< UARTrackedPoint * > & OutTrackablePointList )
Gets a list of all valid UARTrackedPoint objects that ARCore is currently tracking.
TrackablePoint that have entered the EARTrackingState::StoppedTracking state will not be included.
Details | |||
---|---|---|---|
Parameters |
|
GetPassthroughCameraImageUV
void GetPassthroughCameraImageUV( const TArray< float > & InUV, TArray< float > & OutUV )
Gets the texture coordinate information about the passthrough camera texture.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
InstallARCoreService
void InstallARCoreService( UObject *WorldContextObject, struct FLatentActionInfo LatentInfo, EGoogleARCoreInstallRequestResult & OutInstallResult )
A Latent Action to initiates installation of ARCore if required.
This function may cause your application be paused if installing ARCore is required.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
IsPassthroughCameraRenderingEnabled
bool IsPassthroughCameraRenderingEnabled()
Returns the state of the passthrough camera rendering in GoogleARCore ARSystem.
Details | |
---|---|
Returns |
True if the passthrough camera rendering is enabled.
|
RequestInstallARCoreAPK
EGoogleARCoreInstallStatus RequestInstallARCoreAPK()
Initiates installation of ARCore if required.
This function will return immediately and may pause your application if installing ARCore is required.
Details | |
---|---|
Returns |
EGoogleARCoreInstallStatus::Requrested if it started a install request.
|
SetARCoreCameraConfig
bool SetARCoreCameraConfig( FGoogleARCoreCameraConfig TargetCameraConfig )
Configure the ARCoreSession with the desired camera configuration.
The TargetCameraConfig must be from a list returned by UGoogleARCoreEventManager::OnCameraConfig delegate.
This function should be called when UGoogleARCoreEventManager::OnCameraConfig delegate got triggered.
SetPassthroughCameraRenderingEnabled
void SetPassthroughCameraRenderingEnabled( bool bEnable )
Enables/Disables the passthrough camera rendering in GoogleARCore ARSystem.
Note that when passthrough camera rendering is enabled, the camera FOV will be forced to match FOV of the physical camera on the device.
StartARCoreSession
void StartARCoreSession( UObject *WorldContextObject, struct FLatentActionInfo LatentInfo, UGoogleARCoreSessionConfig *Configuration )
Starts a new ARCore tracking session GoogleARCore specific configuration.
If the session already started and the config isn't the same, it will stop the previous session and start a new session with the new config. Note that this is a latent action, you can query the session start result by querying GetARCoreSessionStatus() after the latent action finished.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|