Table of Contents

Supporto headset EasyAR in Unity

Questo documento introduce l'architettura generale e le note per il supporto headset EasyAR in Unity.

Prima di iniziare

  • Leggere EasyAR headset support per conoscere i tipi di headset già supportati da EasyAR e le funzioni EasyAR che possono essere eseguite su headsets.

Panoramica del supporto headset

EasyAR supporta headsets in Unity in modo flessibile. Esistono due approcci comuni:

  • Built-in support: di solito si collega direttamente al device SDK nella EasyAR Sense library e fornisce le interfaces corrispondenti in Unity, ad esempio Apple Vision Pro
  • Extension support: si collega al device SDK tramite un Unity headset extension package, ad esempio Pico
block
  columns 4
  block:groupApp:4
    block:groupAppWrapper
      space
      App1["EasyAR + Device A<br>App"]
      space
      App2["EasyAR<br>App"]
      space
      App3["EasyAR + Device B<br>App"]
    end
  end
  
  block:groupSensePluginExtension
    columns 1
    SensePluginExtension["EasyAR Sense Unity Plugin<br>Extension for Device A"]
    space
  end
  block:groupSensePlugin
    columns 1
    SensePlugin["EasyAR Sense Unity Plugin"]
    space
  end
  block:groupXRI
    columns 1
    XRI["XR Interaction Toolkit"]
    space
  end
  block:groupARF
    columns 1
    ARF["AR Foundation"]
    space
  end
  
  block:groupDeviceAUnity
    columns 1
    DeviceAUnity["Device A<br>Unity SDK"]
    space
  end
  block:groupSense
    columns 1
    Sense["EasyAR Sense"]
    block:groupSenseWrapper
      MDeviceB["Device B<br>CameraDevice"]
      Others["..."]
    end
  end
  block:groupXRSubsystem:2
    columns 1
    XRSubsystem["XR Subsystems"]
    XRSDK["Unity XR SDK"]
  end

  block:groupSystem:4
    columns 1
    System["Native Library"]
    block:groupSystemWrapper
      space
      DeviceA["Device A<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Library&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"]
      space
      space
      DeviceB["Device B<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Library&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"]
      space
    end
  end
  
  SensePluginExtension --> App1
  SensePlugin --> App1
  SensePlugin --> App2
  SensePlugin --> App3
  ARF --> App3
  XRI --> App1
  XRI --> App3
  groupSense --> SensePlugin
  groupDeviceAUnity --> SensePluginExtension
  SensePlugin --> SensePluginExtension
  DeviceA --> groupDeviceAUnity
  DeviceA --> XRSDK
  XRSubsystem --> ARF
  XRSubsystem --> XRI
  DeviceB --> MDeviceB
  DeviceB --> XRSDK
  
  style groupApp fill:none,stroke:none,stroke-width:0px
  style groupAppWrapper fill:none,stroke:none,stroke-width:0px
  style groupSensePlugin fill:none,stroke:none,stroke-width:0px
  style groupARF fill:none,stroke:none,stroke-width:0px
  style groupXRI fill:none,stroke:none,stroke-width:0px
  style DeviceAUnity fill:none,stroke:none,stroke-width:0px,color:#fff
  style Sense fill:none,stroke:none,stroke-width:0px,color:#fff
  style groupSenseWrapper fill:none,stroke:none,stroke-width:0px
  style XRSubsystem fill:none,stroke:none,stroke-width:0px,color
  style System fill:none,stroke:none,stroke-width:0px
  style groupSystemWrapper fill:none,stroke:none,stroke-width:0px
  style groupSensePluginExtension fill:none,stroke:none,stroke-width:0px  

  classDef EasyAR fill:#6e6ce6,stroke:#333,color:#fff
  class groupSense EasyAR
  class SensePlugin EasyAR
  class SensePluginExtension EasyAR

  classDef Device fill:#636,stroke:#333,color:#fff
  class groupDeviceAUnity Device
  class DeviceB Device
  class DeviceA Device

Nella figura:

  • Device A appartiene a extension support

    In pratica, device A di solito ha un Unity SDK corrispondente per collegarsi a Unity XR SDK o implementare autonomamente capacità di headset rendering.

    L'headset extension package di device A è responsabile del collegamento tra EasyAR Sense Unity Plugin e Unity SDK di device A, consentendo così a EasyAR di funzionare su device A. Questo support package può essere fornito da EasyAR o dal device vendor.

  • Device B appartiene a built-in support

    In pratica, device B può avere o non avere un Unity SDK corrispondente, a seconda dell'implementazione del device vendor. Ad esempio, Apple Vision Pro non ha un Unity SDK corrispondente, mentre XREAL ha un Unity SDK corrispondente.

Gli headsets con built-in support e extension support supportano entrambi l'uso di custom camera.

Importante

Quando si utilizzano prodotti di prova su una fotocamera personalizzata o su un visore (license Personal Edition, license XR di prova o servizio Mega di prova, ecc.), EasyAR Sense smetterà di rispondere 100 secondi dopo ogni avvio (gli utenti Mega possono modificare la durata tramite EasyAR Business dopo l'approvazione). Le versioni a pagamento di EasyAR Sense e i servizi EasyAR Mega a pagamento non hanno questa limitazione.

In Unity, rendering della virtual camera, projection matrix, transform e così via non sono controllati da EasyAR. Di solito sono controllati dal device SDK o da Unity XR SDK. Le funzioni proprie del device, come gesture recognition e eye tracking, sono ancora fornite dal device e dal device SDK. Durante l'uso, di solito è necessario usare EasyAR e device SDK contemporaneamente.

Passaggi successivi