Table of Contents

Class VisionOSARKitFrameSource

Namespace
easyar
Assembly
EasyAR.Sense.dll

AMonoBehaviourthat controls the VisionOS ARKit camera device (easyar.VisionOSARKitCameraDevice) in the scene, providing functional extensions within the Unity environment.

This frame source is a motion tracking device that outputs motion data within theARSession.

When using trial products (Personal license, Trial XR license, or Trial Mega service, etc.) on custom cameras or headsets, EasyAR Sense will stop responding after a fixed, limited time following each startup.

public class VisionOSARKitFrameSource : FrameSource
Inheritance
VisionOSARKitFrameSource
Inherited Members

Properties

AvailableCenterMode

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Allcentermodesthatcanbeused.

protected override IReadOnlyList<ARSession.ARCenterMode> AvailableCenterMode { get; }

Camera

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Ondesktopdevicesorphones,thiscameracorrespondstotheinthevirtualworldthatrepresentsthecameradeviceintherealenvironment;itsprojectionmatrixandpositionwillcorrespondtotherealcamerasandbecontrolledbyEasyAR.Onheadsets,thiscameraisonlyusedtodisplaysomediagnostictextinfrontoftheeyesandisnotusedforrendering;thecameraisnotcontrolledbyEasyAR.

protected override Camera Camera { get; }

CameraFrameStarted

Providedonlywhencreatinganewframesource.Itisaccessedthroughouttheentirelifecycleof.

Whetherthecameraframehasstartedinput.

protected override bool CameraFrameStarted { get; }

DeviceCameras

Providedonlywhencreatinganewframesource.Itisaccessedwhenistrue.

Thedevicecamerathatprovidesthecameraframedata.Ifthecameraframedataisprovidedbymultiplecameras,thelistshouldincludeallofthem.

Ensurethatthevalueiscorrectwhenistrue.

protected override List<FrameSourceCamera> DeviceCameras { get; }

Display

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Providesdisplaysysteminformation.Youcanuseortoobtaindefaultdisplayinformation.

protected override IDisplay Display { get; }

FrameRateRange

Frame rate range. Only available whenOpenedis true.

public Vector2 FrameRateRange { get; }

IsAvailable

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheAssembleprocessof.

Whetherthecurrentframesourceisavailable.

Ifthevalueisnull,willbecalled,andthevaluewillbeobtainedaftertheends.

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 whenOpenedis true.

public Vector2Int Size { get; }

enabled

Starts/stopscollectingvideostreamdataduringruntime.Collectionwillonlystartafterthesessionstartsandwhen.enabledistrue.

public bool enabled { get; set; }

Methods

Close()

Closethedevice.

public void Close()

OnSessionStart(ARSession)

Providedonlywhencreatinganewframesource.ItisaccessedonlyduringtheStartSessionprocessof.

Handlessessionstartupifthisframesourcehasbeenassembledinto.Thismethodisdesignedforlazyinitialization;youcanperformAR-specificinitializationworkinthismethod.

protected override void OnSessionStart(ARSession session)

Parameters

session

OnSessionStop()

Providedonlywhencreatinganewframesource.Itisaccessedduringorothersessionsessionstop/corruptionprocesses.

Handlessessionstopifthisframesourcehasbeenassembledinto.Youcanusethismethodtodestroyresourcescreatedduringandsessionoperationandrestoreinternalstate.Thismethodisguaranteedtobecalledbeforesessiondestruction.Iftheframesourceisdestroyedbeforethesession,itwillnotbecalled,andthesessionwillbecorrupted.

protected override void OnSessionStop()

Open()

Opens the device. IfOpen()andClose()are not manually called, theARSessionwill automatically callOpen()upon startup.

public void Open()

Events

DeviceClosed

Theeventfordeviceclosing.

public event Action DeviceClosed

DeviceOpened

Theeventfordeviceopening,whereabooleanvalueindicateswhetheritwassuccessful.

public event Action<bool, PermissionStatus, string> DeviceOpened