Class XREALFrameSource
- Espace de noms
- easyar
- Assembly
- EasyAR.Sense.dll
A MonoBehaviour that controls the XREAL camera device (easyar.XREALCameraDevice) in the scene and provides functional extensions in the Unity environment.
This frame source is a motion tracking device and outputs motion data in ARSession.
When using trial products (Personal license, trial XR license, trial Mega service, etc.) on custom cameras or headsets, EasyAR Sense will stop responding for a fixed limited time after each startup.
public class XREALFrameSource : FrameSource
- Héritage
-
XREALFrameSource
Propriétés
AvailableCenterMode
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during Assemble().
All center modes that can be used.
protected override IReadOnlyList<ARSession.ARCenterMode> AvailableCenterMode { get; }
Camera
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during Assemble().
On desktop devices or phones, this camera represents the Camera in the virtual world corresponding to the camera device in the real environment. Its projection matrix and position correspond to the real camera and are controlled by EasyAR. On headsets, this camera is used only to display diagnostic text in front of the eyes; it is not used for image rendering, and the camera is not controlled by EasyAR.
protected override Camera Camera { get; }
CameraFrameStarted
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed throughout the lifecycle of ARSession.
Whether camera frame input has started.
protected override bool CameraFrameStarted { get; }
DeviceCameras
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed when CameraFrameStarted is true.
Device cameras that provide camera frame data. If camera frame data is provided by multiple cameras, the list must contain all cameras.
Ensure that the value is correct when CameraFrameStarted is true.
protected override List<FrameSourceCamera> DeviceCameras { get; }
Display
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during Assemble().
Provides display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to get default display information.
protected override IDisplay Display { get; }
FrameRate
Frame rate range. Available only when Opened is true.
public double FrameRate { get; }
IsAvailable
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during Assemble().
Whether the current frame source is available.
If the value is null, CheckAvailability() will be called, and the value will be obtained after Coroutine ends.
protected override Optional<bool> IsAvailable { get; }
IsCameraUnderControl
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during Assemble().
When the value is true, session updates the camera transform and renders 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; }
IsHMD
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during Assemble().
Whether the current frame source is a headset. If it is a headset, diagnostic information will be displayed on a 3D board in front of the camera.
Some frame filters behave differently when running on device.
protected override bool IsHMD { get; }
Opened
Whether the camera is opened.
public bool Opened { get; }
ReceivedFrameCount
Number of frames obtained. Usually used in debug. If this value stops increasing, it is usually a hardware issue, and reconnecting the device may solve it.
public int ReceivedFrameCount { get; }
Size
Current image size. Available only when Opened is true.
public Vector2Int Size { get; }
enabled
Demarre/arrete collecting video stream data while ARSession is running. After session starts, collection starts only when MonoBehaviour.enabled is true.
public bool enabled { get; set; }
Méthodes
CheckAvailability()
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during Assemble().
The Coroutine used to check whether the frame source is available when IsAvailable is null.
protected override IEnumerator CheckAvailability()
Close()
Ferme the device.
public void Close()
OnSessionStart(ARSession)
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed only during StartSession().
Gere session startup if this frame source has been assembled into Assembly. This method is designed for lazy initialization; you can perform AR-specific initialization work in this method.
protected override void OnSessionStart(ARSession session)
Paramètres
session
OnSessionStop()
Fourni uniquement lors de la creation d'un nouveau frame source. It is accessed during StopSession(bool) or other session stop/damage processes.
Gere session stop if this frame source has been assembled into Assembly. You can use this method to destroy resources created by StartSession() and during session running, and restore internal state. This method is guaranteed to be called before session destruction. 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()
Ouvre the device. If Open() and Close() are not manually called, ARSession will automatically call Open() after startup.
public void Open()
Événements
DeviceClosed
Device closed event.
public event Action DeviceClosed
DeviceOpened
Device opened event. The bool value indicates whether it succeeded.
public event Action<bool, PermissionStatus, string> DeviceOpened