Class InertialCameraDeviceFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Control the easyar.InertialCameraDevice's MonoBehaviour in the scene to provide function extensions in the Unity environment.
This frame source is a 5DOF (rotation + horizontal displacement) tracking device that outputs motion data in ARSession.
public class InertialCameraDeviceFrameSource : FrameSource
- Inheritance
-
InertialCameraDeviceFrameSource
- Inherited Members
Fields
DesiredFocusMode
Desired focus mode, effective only if modified before the DeviceOpened event or OnEnable.
Note: Due to hardware or system limitations, the focus switch may be ineffective on some devices.
public InertialCameraDeviceFocusMode DesiredFocusMode
Field Value
Properties
Camera
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
On desktop devices or mobile phones, this camera represents the Camera corresponding to the real-world camera device in the virtual world, and its projection matrix and position will correspond to the real camera and be controlled by EasyAR. On the headset, this camera is only used to display some diagnostic text in front of the eyes, not for picture rendering, and the camera is not controlled by EasyAR.
protected override Camera Camera { get; }
Property Value
CameraCandidate
Alternative for Camera, valid only when Unity XR Origin is not used, and will use Camera.main if not set.
public Camera CameraCandidate { get; set; }
Property Value
CameraFrameStarted
Provided only when creating a new frame source. It will be accessed throughout the lifecycle of ARSession.
Whether camera frames start to be input.
protected override bool CameraFrameStarted { get; }
Property Value
DesiredSize
Desired camera image size, effective only if modified before the DeviceOpened event.
Will use the closest size in SupportedSize. If not set, the default value will be used.
public Optional<Vector2Int> DesiredSize { get; set; }
Property Value
DeviceCameras
Provided only when creating a new frame source. It will be accessed when CameraFrameStarted is true.
Provide the device camera for camera frame data. If camera frame data is provided by multiple cameras, all cameras need to be included in the list.
Ensure the value is correct when CameraFrameStarted is true.
protected override List<FrameSourceCamera> DeviceCameras { get; }
Property Value
Display
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
Provide display system information. You can use DefaultSystemDisplay or DefaultHMDDisplay to get the default display information.
protected override IDisplay Display { get; }
Property Value
FrameRateRange
Frame rate range. Only available when Opened is true.
public Vector2 FrameRateRange { get; }
Property Value
IsAvailable
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
Whether the current frame source is available.
If the value is null, CheckAvailability() will be called, and the value will be obtained after the Coroutine ends.
protected override Optional<bool> IsAvailable { get; }
Property Value
IsCameraUnderControl
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
When the value is true, the session will update the transform of the camera and render the camera image.
When creating a headset extension, it should be false. You should have full control over the 3D camera in the scene. You should handle camera rendering, especially in VST mode.
protected override bool IsCameraUnderControl { get; }
Property Value
IsHMD
Provided only when creating a new frame source. It will only be accessed during the Assemble() process.
Whether the current frame source is a headset. If it is a headset, diagnostic information will be displayed on the 3D board in front of the camera.
Some frame filters behave differently on devices.
protected override bool IsHMD { get; }
Property Value
Opened
Whether the camera is open.
public bool Opened { get; }
Property Value
Size
Current image size. Only available when Opened is true.
Set will use the closest size in SupportedSize.
If the image size is modified during FrameRecorder recording, the recording data will stop updating and need to be closed and recorded again.
public Vector2Int Size { get; set; }
Property Value
SupportedSize
All image sizes supported by the current device. Only available when Opened is true.
public List<Vector2Int> SupportedSize { get; }
Property Value
Methods
Close()
Close the device.
public void Close()
OnSessionStart(ARSession)
Provided only when creating a new frame source. It will only be accessed during the StartSession() process.
Handle session startup if this frame source has been assembled into Assembly. This method is designed for lazy initialization, and you can do AR-specific initialization work in this method.
protected override void OnSessionStart(ARSession session)
Parameters
session
OnSessionStop()
Provided only when creating a new frame source. It will be accessed during StopSession(bool) or other session stop/damage processes.
Handle session stop if this frame source has been assembled into Assembly. You can use this method to destroy resources created during StartSession() and session operation and restore internal state. This method is guaranteed to be called before the session is destroyed. 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()
Open the device. If Open() and Close() are not manually called, ARSession will automatically Open() after startup.
public void Open()
ResetInertial()
Reset the state.
public void ResetInertial()
Events
DeviceClosed
Event when the device is closed.
public event Action DeviceClosed
Event Type
DeviceOpened
Event when the device is opened, with a bool value indicating whether it is successful.
public event Action<bool, PermissionStatus, string> DeviceOpened