Table of Contents

Class MotionTrackerFrameSource

네임스페이스
easyar
어셈블리
EasyAR.Sense.dll

A MonoBehaviour that controls easyar.MotionTrackerCameraDevice 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.

public class MotionTrackerFrameSource : FrameSource
상속
MotionTrackerFrameSource
상속된 멤버

속성

Camera

새 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; }

CameraCandidate

Alternative to Camera. Effective only when Unity XR Origin is not used. If not set, Camera.main will be used.

public Camera CameraCandidate { get; set; }

CameraFrameStarted

새 frame source를 생성할 때만 제공됩니다. It is accessed throughout the lifecycle of ARSession.

Whether camera frame input has started.

protected override bool CameraFrameStarted { get; }

DesiredFocusMode

Desired focus mode. Changes take effect only before the DeviceOpened event or before OnEnable.

Note: Due to hardware or system limitations, focus switching may be ineffective on some devices.

public Optional<MotionTrackerCameraDeviceFocusMode> DesiredFocusMode { get; set; }

DesiredFrameRate

Desired device frame rate. Changes take effect only before the DeviceOpened event or before OnEnable.

public Optional<MotionTrackerCameraDeviceFPS> DesiredFrameRate { get; set; }

DesiredMinQualityLevel

Desired minimum allowed quality level. Changes take effect only before Assemble().

public Optional<MotionTrackerCameraDeviceQualityLevel> DesiredMinQualityLevel { get; set; }

DesiredResolution

Desired resolution. Changes take effect only before the DeviceOpened event or before OnEnable.

If the image size is changed while FrameRecorder is recording, recorded data will stop updating and recording needs to be restarted after closing.

public Optional<MotionTrackerCameraDeviceResolution> DesiredResolution { get; set; }

DesiredTrackingMode

Desired tracking mode. Changes take effect only before session starts.

public Optional<MotionTrackerCameraDeviceTrackingMode> DesiredTrackingMode { get; set; }

DeviceCameras

새 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; }

DeviceQualityLevel

가져옵니다 the Motion Tracking quality on the device. Combined with the application scenario, this value can be used to decide whether to start Motion Tracking.

public static MotionTrackerCameraDeviceQualityLevel DeviceQualityLevel { get; }

Display

새 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; }

FrameRateRange

Frame rate range. Available only when Opened is true.

public Vector2 FrameRateRange { get; }

IsAvailable

새 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

새 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

새 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; }

LocalPointCloud

Current point cloud position information. Available only when Opened is true.

public List<Vector3> LocalPointCloud { get; }

Opened

Whether the camera is opened.

public bool Opened { get; }

Size

Current image size. Available only when Opened and MonoBehaviour.enabled are both true.

public Vector2Int Size { get; }

enabled

시작/중지합니다 collecting video stream data while ARSession is running. After session starts, collection starts only when MonoBehaviour.enabled is true.

public bool enabled { get; set; }

메서드

Close()

닫습니다 the device.

public void Close()

HitTestAgainstHorizontalPlane(Vector2)

수행합니다 Hit Test on horizontal planes detected in real time within the current field of view. After hitting a horizontal plane, returns the position coordinate of the 3D point on that plane nearest to the Hit Test ray. pointInView needs to be normalized to [0, 1]^2.

public List<Vector3> HitTestAgainstHorizontalPlane(Vector2 pointInView)

매개 변수

pointInView

HitTestAgainstPointCloud(Vector2)

수행합니다 Hit Test in the current point cloud and obtains the nearest 3D point position coordinate on a ray from near to far relative to the camera. pointInView needs to be normalized to [0, 1]^2.

public List<Vector3> HitTestAgainstPointCloud(Vector2 pointInView)

매개 변수

pointInView

OnSessionStart(ARSession)

새 frame source를 생성할 때만 제공됩니다. It is accessed only during StartSession().

처리합니다 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)

매개 변수

session

OnSessionStop()

새 frame source를 생성할 때만 제공됩니다. It is accessed during StopSession(bool) or other session stop/damage processes.

처리합니다 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()

엽니다 the device. If Open() and Close() are not manually called, ARSession will automatically call Open() after startup.

public void Open()

이벤트

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