Class ThreeDofCameraDeviceFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Controls the MonoBehaviour for the 3DOF camera device (ThreeDofCameraDeviceFrameSource) in the scene, providing functional extensions within the Unity environment.
This frame source is a 3DOF rotation tracking device that outputs rotation data in the ARSession.
public class ThreeDofCameraDeviceFrameSource : FrameSource
- Inheritance
-
ThreeDofCameraDeviceFrameSource
- Inherited Members
Fields
DesiredFocusMode
The desired focus mode. Modifications are only effective before the DeviceOpened event or OnEnable.
Note: Due to hardware or system limitations, the focus switch may be ineffective on some devices.
public ThreeDofCameraDeviceFocusMode DesiredFocusMode
Properties
Camera
Provided only when creating a new frame source. Accessed only during the Assemble() process.
On desktop or mobile devices, this camera represents the Camera corresponding to the physical camera device in the virtual world. Its projection matrix and position will correspond to the real camera and are controlled by EasyAR. On HMDs, this camera is only used to display diagnostic text in front of the eyes, not for rendering the scene image, and the camera is not controlled by EasyAR.
protected override Camera Camera { get; }
CameraCandidate
Alternative to Camera, only effective when Unity XR Origin is not used. Uses Camera.main if not set.
public Camera CameraCandidate { get; set; }
CameraFrameStarted
Provided only when creating a new frame source. Accessed throughout the lifetime of the ARSession.
Indicates whether camera frame input has started.
protected override bool CameraFrameStarted { get; }
DesiredSize
Desired camera image size. Modifications are only effective before the DeviceOpened event.
Uses the size closest to the value in SupportedSize. If not set, the default value is used.
public Optional<Vector2Int> DesiredSize { get; set; }
DeviceCameras
Provided only when creating a new frame source. Accessed only when CameraFrameStarted is true.
Provides the device camera supplying the camera frame data. If the frame data comes from multiple cameras, the list must include all of them.
Ensure the value is correct when CameraFrameStarted is true.
protected override List<FrameSourceCamera> DeviceCameras { get; }
Display
Provided only when creating a new frame source. Accessed only during the Assemble() process.
Provides display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to obtain default display information.
protected override IDisplay Display { get; }
FrameRateRange
Frame rate range. Only available when Opened is true.
public Vector2 FrameRateRange { get; }
IsAvailable
Provided only when creating a new frame source. Accessed only during the Assemble() process.
Indicates whether this frame source is available.
If the value is null, CheckAvailability() will be called, and the value will be obtained after the Coroutine finishes.
protected override Optional<bool> IsAvailable { get; }
IsCameraUnderControl
Provided only when creating a new frame source. Accessed only during the Assemble() process.
When true, the session updates the camera's transform and renders the camera image.
When creating HMD extensions, this should be false. You should have full control over the 3D camera in the scene. You should handle camera rendering, especially in Video See-Through (VST) mode.
protected override bool IsCameraUnderControl { get; }
IsHMD
Provided only when creating a new frame source. Accessed only during the Assemble() process.
Whether this frame source is a head-mounted display (HMD). If it is an HMD, diagnostic information will be displayed on a 3D board in front of the camera.
Some frame filters behave differently when running on HMD devices.
protected override bool IsHMD { get; }
Opened
Whether the camera is open.
public bool Opened { get; }
Size
Current image size. Only available when Opened is true.
Set uses the size closest to the value in SupportedSize.
If the image size is modified during FrameRecorder recording, recorded data will stop updating; recording needs to be restarted after closing.
public Vector2Int Size { get; set; }
SupportedSize
All supported image sizes for the current device. Only available when Opened is true.
public List<Vector2Int> SupportedSize { get; }
enabled
Controls when the ARSession starts/stops capturing the video stream. After session startup, capture only starts when MonoBehaviour.enabled is true.
public bool enabled { get; set; }
Methods
Close()
Closes the device.
public void Close()
OnSessionStart(ARSession)
Provided only when creating a new frame source. Accessed only during the StartSession() process.
Handles session startup if this frame source is assembled into the Assembly. This method is designed for lazy initialization; you can perform AR-specific initialization here.
protected override void OnSessionStart(ARSession session)
Parameters
session
OnSessionStop()
Provided only when creating a new frame source. Accessed during StopSession(bool) or other session stop/corruption processes.
Handles session stop if this frame source is assembled into the Assembly. Use this method to destroy resources created during StartSession() and session runtime, and to restore internal state. This method is guaranteed to be called before the session is destroyed. If the frame source is destroyed before the session, this method will not be called, and the session will be corrupted.
protected override void OnSessionStop()
Open()
Opens the device. If Open() and Close() are not called manually, ARSession will automatically call Open() after startup.
public void Open()
Events
DeviceClosed
The device closed event.
public event Action DeviceClosed
DeviceOpened
The device opened event. The bool value indicates success.
public event Action<bool, PermissionStatus, string> DeviceOpened