Class ARCoreFrameSource
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Aeasyar.ARCoreCameraDevice-controllingMonoBehaviour in the scene, providing functionality extensions within the Unity environment.
This frame source is a motion-tracking device that outputs motion data in anARSession.
public class ARCoreFrameSource : FrameSource
- Inheritance
-
ARCoreFrameSource
- Inherited Members
Fields
DesiredFocusMode
The desired focus mode; changes are only effective before theDeviceOpened event or OnEnable.
Note: Due to hardware or system limitations, the focus switch might be ineffective on some devices.
public ARCoreCameraDeviceFocusMode DesiredFocusMode
Properties
Camera
Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof
Ondesktopdevicesorphones,thiscameracorrespondstothe
protected override Camera Camera { get; }
CameraCandidate
Alternative toCamera, only valid when not using Unity XR Origin. If unset, Camera.main will be used.
public Camera CameraCandidate { get; set; }
CameraFrameStarted
Providedonlywhencreatinganewframesource.Itisaccessedthroughouttheentirelifecycleof
Whetherthecameraframehasstartedinput.
protected override bool CameraFrameStarted { get; }
DeviceCameras
Providedonlywhencreatinganewframesource.Itisaccessedwhen
Thedevicecamerathatprovidesthecameraframedata.Ifthecameraframedataisprovidedbymultiplecameras,thelistshouldincludeallofthem.
Ensurethatthevalueiscorrectwhen
protected override List<FrameSourceCamera> DeviceCameras { get; }
Display
Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof
Providesdisplaysysteminformation.Youcanuse
protected override IDisplay Display { get; }
FrameRateRange
Frame rate range. Only available whenOpened is true.
public Vector2 FrameRateRange { get; }
IsAvailable
Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof
Whetherthecurrentframesourceisavailable.
Ifthevalueisnull,
protected override Optional<bool> IsAvailable { get; }
IsCameraUnderControl
Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof
Whenthevalueistrue,thesessionwillupdatethecamera'stransformandrenderthecameraimage.
Whencreatingaheadsetextension,itshouldbefalse.Youshouldhavefullcontroloverthe3Dcamerainthescene.Youshouldhandlecamerarendering,especiallyinVSTmode.
protected override bool IsCameraUnderControl { get; }
IsHMD
Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof
Whetherthecurrentframesourceisaheadset.Ifitisaheadset,diagnosticinformationwillbedisplayedona3Dboardinfrontofthecamera.
Someframefiltersmayoperatedifferentlyonthedevice.
protected override bool IsHMD { get; }
Opened
Whetherthecameraisopen.
public bool Opened { get; }
Size
Current image size. Only available whenOpened is true.
public Vector2Int Size { get; }
enabled
Starts/stopscollectingvideostreamdataduring
public bool enabled { get; set; }
Methods
Close()
Closethedevice.
public void Close()
OnSessionStart(ARSession)
Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheStartSessionprocessof
Handlessessionstartupifthisframesourcehasbeenassembledinto
protected override void OnSessionStart(ARSession session)
Parameters
session
OnSessionStop()
Providedonlywhencreatinganewframesource.Itisaccessedduring
Handlessessionstopifthisframesourcehasbeenassembledinto
protected override void OnSessionStop()
Open()
Opens the device. IfOpen() andClose() are not manually called, it will automaticallyOpen() afterARSession starts.
public void Open()
Events
DeviceClosed
Theeventfordeviceclosing.
public event Action DeviceClosed
DeviceOpened
Theeventfordeviceopening,whereabooleanvalueindicateswhetheritwassuccessful.
public event Action<bool, PermissionStatus, string> DeviceOpened