Table of Contents

Class ARFoundationFrameSource

Namespace
easyar
Assembly
EasyAR.Sense.dll

In the scene, connect the output of AR Foundation to the custom frame source for EasyAR input. Provide AR Foundation support through the custom camera feature of EasyAR Sense.

This frame source is a motion tracking device that outputs motion data in ARSession.

To use this frame source, ``AR Foundation`` is required. You need to configure AR Foundation according to the official documentation.

public abstract class ARFoundationFrameSource : FrameSource
Inheritance
ARFoundationFrameSource
Derived

Properties

AvailableCenterMode

Provided only when a new frame source is created. It will only be accessed during the Assemble() process.

All available center modes.

protected override IReadOnlyList<ARSession.ARCenterMode> AvailableCenterMode { get; }

Property Value

Camera

Provided only when a new frame source is created. It will only be accessed during the Assemble() process.

On desktop or mobile devices, this camera represents the Camera corresponding to the real-world camera device in the virtual world. Its projection matrix and position will correspond to the real camera and be controlled by EasyAR. On headsets, this camera is only used to display diagnostic text in front of the eyes, not for rendering images, and the camera is not controlled by EasyAR.

protected override Camera Camera { get; }

Property Value

CameraFrameStarted

Provided only when a new frame source is created. It will be accessed throughout the entire lifecycle of ARSession.

Whether the camera frame has started inputting.

protected override bool CameraFrameStarted { get; }

Property Value

DeviceCameras

Provided only when a new frame source is created. It will be accessed when CameraFrameStarted is true.

The device camera that provides camera frame data. If camera frame data is provided by multiple cameras, all cameras need to be included in the list.

Ensure the value is correct when CameraFrameStarted is true.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Property Value

Display

Provided only when a new frame source is created. It will only be accessed during the Assemble() process.

Provides display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to get default display information.

protected override IDisplay Display { get; }

Property Value

IsAvailable

Provided only when a new frame source is created. It will only be accessed during the Assemble() process.

Whether the current frame source is available.

If the value is null, CheckAvailability() will be called, and the value will be obtained after the Coroutine ends.

protected override Optional<bool> IsAvailable { get; }

Property Value

IsCameraUnderControl

Provided only when a new frame source is created. It will only be accessed during the Assemble() process.

When the value is true, the session will update the camera's transform and render the camera image.

When creating a headset extension, it should be false. You should fully control the 3D camera in the scene. You should handle camera rendering, especially in VST mode.

protected override bool IsCameraUnderControl { get; }

Property Value

IsHMD

Provided only when a new frame source is created. It will only be accessed during the Assemble() process.

Whether the current frame source is a headset. If it is a headset, diagnostic information will be displayed on the 3D board in front of the camera.

Some frame filters will behave differently on different devices.

protected override bool IsHMD { get; }

Property Value

Methods

CheckAvailability()

Provided only when a new frame source is created. It will only be accessed during the Assemble() process.

When IsAvailable is null, it is used to check whether the frame source is available via Coroutine.

protected override IEnumerator CheckAvailability()

Returns

OnSessionStart(ARSession)

Provided only when a new frame source is created. It will only be accessed during the StartSession() process.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Provided only when a new frame source is created. It will be accessed during StopSession(bool) or other session stop/damage processes.

Handle session stop if this frame source has been assembled into Assembly. You can use this method to destroy StartSession() and the resources created during session operation, and restore the internal state. This method will be guaranteed to be called before the session is destroyed. If the frame source is destroyed before the session, it will not be called and the session will be corrupted.

protected override void OnSessionStop()