NrealFrameSource Class

Description

A custom frame source which connects Nreal output to EasyAR input in the scene, providing Nreal support using custom camera feature of EasyAR Sense.

This frame source is one type of motion tracking device, and will output motion data in a ARSession .

Nreal SDK For Unity is required to use this frame source, you need to setup Nreal SDK For Unity according to official documents.

NrealFrameSource.CameraRig and NrealFrameSource.WorldRoot are required for availability check, they will be automatically picked from scene objects if not setup. FrameSource.Camera will be created at runtime and attached to NrealFrameSource.CameraRig .


MonoBehaviour Messages

protected override void Awake()

protected override void OnEnable()

protected override void OnDisable()

protected virtual void OnDestroy()


Fields

CameraNearClipPlane

C#

public float CameraNearClipPlane

The distance of the near clipping plane from the the RGB Camera.

CameraFarClipPlane

C#

public float CameraFarClipPlane

The distance of the far clipping plane from the the RGB Camera.

EnableColorInput

C#

public bool EnableColorInput

If color image is used as frame input. Color image is usefull when recording a colored eif file, but not necessary for all EasyAR algorithms.


Properties

Type

C#

public override Optional< InputFrameSourceType > Type { get; }

Frame source type. Usually can be used only after device created.

CameraRig

C#

public NRKernal.NRHMDPoseTracker CameraRig { get; set; }

Nreal CameraRig.

WorldRoot

C#

public WorldRootController WorldRoot { get; set; }

The object Camera move against, will be automatically get from the scene or generate if not set.

ReceivedFrameCount

C#

public int ReceivedFrameCount { get; }

Received frame count from Nreal. Usually used for debug. There are usually hardware issues if this value stop to increase, and a device re-plug may help.

IsAvailable

C#

public override Optional<bool> IsAvailable { get; }

If the frame source is available.

If the value equals null, FrameSource.CheckAvailability must be called and the value can be accessed after Coroutine finish. This property is used by ARComponentPicker when picking frame source.

Origin

C#

public override GameObject Origin { get; }

Origin of ARSession if the frame source can output motion tracking data.

Each type of motion tracking frame source has its own method to set the origin object containing some specific component. Some frame source will automatic pick a usable object from active objects in the scene or generate an object if the value is not set.

AvailableCenterMode

C#

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

Available center mode of the frame source.

Camera

C#

public virtual Camera Camera { get; set; }

Camera used by the frame source in an ARSession .

Each type of frame source has its own method to check if the camera is usable, and will reject value set if the camera is not usable by the frame source. This property is used by ARComponentPicker when picking frame source to determine if the frame source is available, and some frame source will automatic pick a usable Camera from active objects in the scene in the process if the value is not set. You can set this value to a usable Camera before session start. The value cannot be changed after ARSession is ready if the frame source is selected in the session.


Methods

CheckAvailability

C#

public override System.Collections.IEnumerator CheckAvailability()

Coroutine to check frame source availability when FrameSource.IsAvailable equals null.