unreal.GoogleARCoreSessionFunctionLibrary

class unreal.GoogleARCoreSessionFunctionLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

A function library that provides static/Blueprint functions associated with GoogleARCore session.

C++ Source:

  • Plugin: GoogleARCore
  • Module: GoogleARCoreBase
  • File: GoogleARCoreFunctionLibrary.h
classmethod add_runtime_candidate_image_from_rawbytes(session_config, image_grayscale_pixels, image_width, image_height, friendly_name, physical_width, candidate_texture=None) → ARCandidateImage

Create an ARCandidateImage object from the raw pixel data and add it to the ARCandidateImageList of the given c UARSessionConfig object.

Note that you need to restart the AR session with the c 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.

Parameters:
  • session_config (ARSessionConfig) –
  • image_grayscale_pixels (Array(uint8)) –
  • image_width (int32) –
  • image_height (int32) –
  • friendly_name (str) –
  • physical_width (float) –
  • candidate_texture (Texture2D) –
Returns:

A c UARCandidateImage Object pointer if the underlying ARPlatform added the candidate image at runtime successfully. Return nullptr otherwise.

Return type:

ARCandidateImage

classmethod check_ar_core_availability(world_context_object, latent_info) → GoogleARCoreAvailability

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.

Parameters:
  • world_context_object (Object) – The world context.
  • latent_info (LatentActionInfo) – Unreal internal type required for all latent actions.
Returns:

out_availability (GoogleARCoreAvailability): The availability result as a EGoogleARCoreAvailability.

Return type:

GoogleARCoreAvailability

classmethod get_all_planes() -> Array(ARPlaneGeometry)

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.

Returns:out_plane_list (Array(ARPlaneGeometry)): An array that contains all the valid planes detected by ARCore.
Return type:Array(ARPlaneGeometry)
classmethod get_all_trackable_points() -> Array(ARTrackedPoint)

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.

Returns:out_trackable_point_list (Array(ARTrackedPoint)): An array that contains all the valid trackable points detected by ARCore.
Return type:Array(ARTrackedPoint)
classmethod get_ar_core_camera_config() → GoogleARCoreCameraConfig or None

Get the FGoogleARCoreCameraConfig that the current ARCore session is using.

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.

out_current_camera_config (GoogleARCoreCameraConfig): The FGoogleARCoreCameraConfig that the current ARCore session is using.

Return type:GoogleARCoreCameraConfig or None
classmethod get_ar_core_event_manager() → GoogleARCoreEventManager

Get the UGoogleARCoreEventManager to bind BP events or c++ delegate in GoogleARCore plugins.

Returns:
Return type:GoogleARCoreEventManager
classmethod get_passthrough_camera_image_uv(uv) -> Array(float)

Gets the texture coordinate information about the passthrough camera texture.

Parameters:uv (Array(float)) – The original UVs of on the quad. Should be an array with 8 floats.
Returns:out_uv (Array(float)): The orientated UVs that can be used to sample the passthrough camera texture and make sure it is displayed correctly.
Return type:Array(float)
classmethod install_ar_core_service(world_context_object, latent_info) → GoogleARCoreInstallRequestResult

A Latent Action to initiates installation of ARCore if required. This function may cause your application be paused if installing ARCore is required.

Parameters:
  • world_context_object (Object) – The world context.
  • latent_info (LatentActionInfo) – Unreal internal type required for all latent actions.
Returns:

out_install_result (GoogleARCoreInstallRequestResult): The install request result as a EGoogleARCoreInstallRequestResult.

Return type:

GoogleARCoreInstallRequestResult

classmethod is_passthrough_camera_rendering_enabled() → bool

Returns the state of the passthrough camera rendering in GoogleARCore ARSystem.

Returns:True if the passthrough camera rendering is enabled.
Return type:bool
classmethod set_ar_core_camera_config(target_camera_config) → bool

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.

Parameters:target_camera_config (GoogleARCoreCameraConfig) –
Returns:
Return type:bool
classmethod set_passthrough_camera_rendering_enabled(enable) → None

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.

Parameters:enable (bool) –
classmethod start_ar_core_session(world_context_object, latent_info, configuration) → None

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.

Parameters:
  • world_context_object (Object) – The world context.
  • latent_info (LatentActionInfo) – Unreal internal type required for all latent actions.
  • configuration (GoogleARCoreSessionConfig) – The ARCoreSession configuration to start the session.