Table of Contents

Dukungan headset EasyAR di Unity

Dokumen ini memperkenalkan keseluruhan arsitektur dan catatan untuk dukungan headset EasyAR di Unity.

Sebelum mulai

  • Baca EasyAR headset support untuk memahami jenis headset yang sudah didukung EasyAR dan fitur EasyAR yang dapat berjalan di headset.

Ringkasan dukungan headset

Cara EasyAR mendukung headset di Unity cukup fleksibel. Ada dua pendekatan umum:

  • Built-in support: Biasanya langsung menghubungkan device SDK di EasyAR Sense library dan menyediakan interface terkait di Unity, seperti Apple Vision Pro
  • Extension support: Menghubungkan device SDK melalui Unity headset extension package, seperti 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

Pada gambar:

  • Device A termasuk extension support

    Dalam praktiknya, device A biasanya memiliki Unity SDK terkait untuk menghubungkan Unity XR SDK atau mengimplementasikan kemampuan headset rendering secara mandiri.

    Headset extension package device A bertanggung jawab menghubungkan EasyAR Sense Unity Plugin dengan Unity SDK device A, sehingga EasyAR dapat berjalan di device A. Support package ini dapat disediakan oleh EasyAR atau oleh device vendor.

  • Device B termasuk built-in support

    Dalam praktiknya, device B mungkin memiliki atau tidak memiliki Unity SDK terkait, bergantung pada implementasi device vendor. Misalnya, Apple Vision Pro tidak memiliki Unity SDK terkait, sedangkan XREAL memiliki Unity SDK terkait.

Headset dengan built-in support dan extension support sama-sama mendukung penggunaan custom camera.

Penting

Saat menggunakan produk uji coba pada kamera kustom atau headset (license Personal, license XR uji coba, atau layanan Mega uji coba, dll.), EasyAR Sense akan berhenti merespons 100 detik setelah setiap kali dimulai (pengguna Mega dapat menyesuaikan durasi ini melalui EasyAR Business setelah disetujui). Versi berbayar EasyAR Sense dan layanan berbayar EasyAR Mega tidak memiliki batasan ini.

Di Unity, rendering virtual camera, projection matrix, transform, dan sebagainya tidak dikontrol oleh EasyAR. Biasanya semuanya dikontrol oleh device SDK atau Unity XR SDK. Fitur device sendiri, seperti gesture recognition dan eye tracking, tetap disediakan oleh device dan device SDK. Saat digunakan, biasanya Anda perlu menggunakan EasyAR dan device SDK secara bersamaan.

Langkah berikutnya