VIOCameraDeviceUnion Class¶
This type is obsolete and will be removed in future releases. Do not use it anymore.
VIOCameraDeviceUnion is obsolete and will be removed in the future. Please re-create your AR Session from ‘GameObject’ menu or context menu in ‘Hierarchy’ window. You can find replacement for VIOCameraDeviceUnion from ‘EasyAR Sense -> Motion Tracking -> AR Session (Motion Tracking Preset)’.
Description¶
MonoBehaviour which controls VIO camera device ( MotionTrackerCameraDevice , ARKitCameraDevice or ARCoreCameraDevice ) in the scene, providing a few extensions in the Unity environment. Use VIOCameraDeviceUnion.Device directly when necessary.
Enums¶
public enum VIOCameraDeviceUnion.DeviceChooseStrategy |
Strategy of choosing VIO device. |
Classes¶
public class VIOCameraDeviceUnion.DeviceUnion |
VIO device Union. |
public class VIOCameraDeviceUnion.MotionTrackerCameraDeviceParameters |
Motion tracker parameters. |
MonoBehaviour Messages¶
protected override void Awake() |
protected override void OnEnable() |
protected override void OnDisable() |
protected virtual void OnDestroy() |
Fields¶
DeviceStrategy¶
- C#
public VIOCameraDeviceUnion.DeviceChooseStrategy DeviceStrategy
Strategy of choosing VIO device.
DesiredMotionTrackerParameters¶
- C#
public VIOCameraDeviceUnion.MotionTrackerCameraDeviceParameters DesiredMotionTrackerParameters
Desired motion tracker parameters, used only when VIOCameraDeviceUnion.Device start. Effective only when MotionTrackerCameraDevice is used.
CalibrationDownloaderTimeout¶
- C#
public float CalibrationDownloaderTimeout
Timeout in seconds to update device list from server when checking availability using VIOCameraDeviceUnion.CheckAvailability . Set value less than or equal to 0 to skip update from server.
Properties¶
Device¶
- C#
public VIOCameraDeviceUnion.DeviceUnion Device { get; }
EasyAR Sense API (Union). Accessible between VIOCameraDeviceUnion.DeviceCreated and VIOCameraDeviceUnion.DeviceClosed event if available.
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.
WorldRoot¶
- C#
public WorldRootController WorldRoot { get; set; }
The object Camera move against, will be automatically get from the scene or generate if not set.
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 virtual 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.
Events¶
DeviceCreated¶
- C#
public event Action DeviceCreated
Event when VIOCameraDeviceUnion.Device created.
DeviceOpened¶
- C#
public event Action DeviceOpened
Event when VIOCameraDeviceUnion.Device opened.
DeviceClosed¶
- C#
public event Action DeviceClosed
Event when VIOCameraDeviceUnion.Device closed.
Methods¶
CheckAvailability¶
- C#
public override System.Collections.IEnumerator CheckAvailability()
Coroutine to check frame source availability when FrameSource.IsAvailable equals null.
HitTestAgainstHorizontalPlane¶
Performs ray cast from the user’s device in the direction of given screen point. Intersections with horizontal plane is detected in real time in the current field of view,and return the 3D point nearest to ray on horizontal plane. pointInView should be normalized to [0, 1]^2.
HitTestAgainstPointCloud¶
Perform hit test against the point cloud and return the nearest 3D point. pointInView should be normalized to [0, 1]^2.
Open¶
- C#
public void Open()
Open device.
Close¶
- C#
public void Close()
Close device.