Table of Contents

Class ExternalDeviceRotationFrameSource

Namespace
easyar
Assembly
EasyAR.Sense.dll

Represents a frame source for external devices with 3DOF rotational tracking capability. Typically refers to head-mounted devices where camera rendering and device tracking are both handled by the device SDK.

This frame source is a 3DOF rotational tracking device that outputs rotation data in ARSession.

You can implement device inputs such as head-mounted displays by inheriting from it, but you must handle the tracking functionality yourself, as EasyAR's 3DOF rotational tracking cannot be used directly on external devices. You need to obtain image and rotation data from hardware or other sources and input it into EasyAR. EasyAR does not provide the capability to acquire this data, but it does provide the ability to run EasyAR features after inputting this data into EasyAR.

When using trial products (such as personal edition licenses, trial XR licenses, or trial Mega services, etc.) on custom cameras or head-mounted displays, EasyAR Sense will stop responding after a fixed limited time each time it is started.

public abstract class ExternalDeviceRotationFrameSource : ExternalDeviceFrameSource
Inheritance
ExternalDeviceRotationFrameSource
Inherited Members

Methods

HandleCameraFrameData(DeviceFrameSourceCamera, double, Image, CameraParameters, Quaternion)

Inputs camera frame data.

It is recommended to input data at 30 or 60 fps. The minimum acceptable frame rate = 2, but some algorithm response times may be affected. It can be called from any thread, as long as your APIs are thread-safe. This data needs to be consistent with the data when the camera sensor is exposed. Whenever possible, it is recommended to input color data to EasyAR Sense, as this is beneficial for EasyAR Mega effects. For optimal efficiency, you can design the entire data chain to pass raw YUV data directly through shared memory and directly use data pointers to input into EasyAR Sense. Please note data ownership.

protected bool HandleCameraFrameData(DeviceFrameSourceCamera deviceCamera, double timestamp, Image image, CameraParameters cameraParameters, Quaternion deviceRotation)

Parameters

deviceCamera
timestamp
image
cameraParameters
deviceRotation

Returns

HandleRenderFrameData(double, Quaternion)

Inputs rendered frame data.

Please ensure it is called every frame after the device data is ready, without skipping frames. This data needs to match the data driving the current Unity rendering camera within the same frame.

protected bool HandleRenderFrameData(double timestamp, Quaternion rotation)

Parameters

timestamp
rotation

Returns