Class ARKitFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Controls the ARKit camera device (easyar.ARKitCameraDevice) in the scene, providing functional extensions in the Unity environment.
This frame source is a motion tracking device that outputs motion data in ARSession.
public class ARKitFrameSource : FrameSource
- Inheritance
-
ARKitFrameSource
- Inherited Members
Fields
DesiredFocusMode
Desired focus mode; must be modified before the DeviceOpened event or OnEnable to take effect.
Note: Due to hardware or system limitations, the focus switch may not work on some devices.
public ARKitCameraDeviceFocusMode DesiredFocusMode
Field Value
Properties
Camera
Provided only when a new frame source is created. It will only be accessed during the Assemble() process.
On desktop devices or mobile phones, this camera represents the Camera corresponding to the real camera device in the virtual world. Its projection matrix and position will correspond to the real camera and be controlled by EasyAR. On HMDs, this camera is only used to display diagnostic text in front of the eyes, not for rendering the screen, and the camera is not controlled by EasyAR.
protected override Camera Camera { get; }
Property Value
CameraCandidate
Alternative for Camera; only valid if Unity XR Origin is not used. If not set, Camera.main will be used.
public Camera CameraCandidate { get; set; }
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
DesiredFrameRate
Desired camera image frame rate; must be modified before the DeviceOpened event to take effect.
The closest value from SupportedFrameRate will be used. If not set, the default value will be used.
public Optional<double> DesiredFrameRate { get; set; }
Property Value
DesiredSize
Desired camera image size; must be modified before the DeviceOpened event to take effect.
The closest size from SupportedSize will be used. If not set, the default value will be used.
public Optional<Vector2Int> DesiredSize { get; set; }
Property Value
DeviceCameras
Provided only when a new frame source is created. It will be accessed when CameraFrameStarted is true.
The device camera(s) providing camera frame data. If camera frame data is provided by multiple cameras, all cameras should 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 system display information. You can use DefaultSystemDisplay or DefaultHMDDisplay to get default display information.
protected override IDisplay Display { get; }
Property Value
FrameRate
Current frame rate of the device. Only available when Opened is true.
Setting will use the closest value from SupportedFrameRate.
public double FrameRate { get; set; }
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 an HMD extension, it should be false. You should fully control the 3D camera in the scene and 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 head-mounted display (HMD). If it is an HMD, diagnostic information will be displayed on the 3D board in front of the camera.
Some frame filters may behave differently on different devices.
protected override bool IsHMD { get; }
Property Value
Opened
Whether the camera is open.
public bool Opened { get; }
Property Value
Size
Current image size. Only available when Opened is true.
Setting will use the closest size from SupportedSize.
If the image size is modified during the FrameRecorder recording process, the recording data will stop updating and need to be closed and then re-recorded.
public Vector2Int Size { get; set; }
Property Value
SupportedFrameRate
All frame rates supported by the current device. Only available when Opened is true.
public List<double> SupportedFrameRate { get; }
Property Value
SupportedSize
All image sizes supported by the current device. Only available when Opened is true.
public List<Vector2Int> SupportedSize { get; }
Property Value
Methods
Close()
Close the device.
public void Close()
OnSessionStart(ARSession)
Provided only when a new frame source is created. It will only be accessed during the StartSession() process.
Handle session startup if this frame source has been assembled into Assembly. This method is designed for deferred initialization, and you can perform AR-specific initialization work in this method.
protected override void OnSessionStart(ARSession session)
Parameters
session
OnSessionStop()
Provided only when a new frame source is created. It will be accessed during the StopSession(bool) or other session stopping/damaging processes.
Handle session stopping if this frame source has been assembled into Assembly. You can use this method to destroy StartSession() and resources created during session operation, and restore 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 damaged.
protected override void OnSessionStop()
Open()
Open the device. If Open() and Close() are not manually called, ARSession will automatically call Open() after starting.
public void Open()
Events
DeviceClosed
Event when the device is closed.
public event Action DeviceClosed
Event Type
DeviceOpened
Event when the device is opened; a bool value indicates success.
public event Action<bool, PermissionStatus, string> DeviceOpened