XREALFrameSource Class

Description

在场景中控制XREAL相机设备( XREALCameraDevice )的 MonoBehaviour ,在Unity环境下提供功能扩展。

这个frame source是一种运动跟踪设备,在 ARSession 中会输出运动数据。

在自定义相机或头显上使用试用产品(个人版license、试用版XR license或试用版Mega服务等)时,EasyAR Sense每次启动后会在固定的有限时间内停止响应。


Properties

enabled

C#

public bool enabled { get; set; }

ARSession 运行时开始/停止采集视频流数据。在session启动后, MonoBehaviour .enabled为true时才会开始采集。

Opened

C#

public bool Opened { get; }

相机是否打开。

FrameRate

C#

public double FrameRate { get; }

帧率范围。仅在 XREALFrameSource.Opened 为true时可用。

Size

C#

public Vector2Int Size { get; }

当前图像大小。仅在 XREALFrameSource.Opened 为true时可用。

ReceivedFrameCount

C#

public int ReceivedFrameCount { get; }

获取到的帧计数。通常在debug中使用。如果这个数值停止增长,通常是硬件问题,重新插拔可能能解决。


Events

DeviceOpened

C#

public event Action<bool, PermissionStatus , string> DeviceOpened

设备打开的事件,bool值表示是否成功。

DeviceClosed

C#

public event Action DeviceClosed

设备关闭的事件。


Methods

Open

C#

public void Open()

打开设备。如果未手动调用 XREALFrameSource.OpenXREALFrameSource.CloseARSession 启动后会自动 XREALFrameSource.Open

Close

C#

public void Close()

关闭设备。