Skip to content

The Meta Spatial SDK Samples is a collection of code samples and projects that demonstrate the capabilities of the Meta Spatial SDK. Meta Spatial SDK enables mobile developers to build Meta Horizon OS experiences using familiar Android languages, tools, and libraries.

License

Notifications You must be signed in to change notification settings

meta-quest/Meta-Spatial-SDK-Samples

Repository files navigation

Meta Spatial SDK Samples

This repository is a collection of code samples and projects that demonstrate the capabilities of Meta Spatial SDK. Meta Spatial SDK is a new way to build immersive apps for Meta Horizon OS. Meta Spatial SDK lets you combine the rich ecosystem of Android development and the unique capabilities of Meta Quest via accessible APIs.

The samples in this repository showcase various features of the SDK, such as spatial anchors, scene understanding, and object recognition. Each sample project includes source code, build scripts, and documentation to help developers understand how to use the SDK to build their own spatially-aware applications.

Whether you're a seasoned developer or just starting out with Meta Quest/Horizon OS, the Meta Spatial SDK Samples are a valuable resource for learning how to leverage the power of spatial computing in your applications.

Requirements

To try out these sample apps, you will need:

Getting Started

First, ensure that all of the requirements are met.

Then, to build and run a sample:

  1. Clone this repository to your computer
  2. Open the specific sample app with Android Studio
  3. Plug in your Quest device to your computer
  4. Click the "Run" button in the Android Studio toolbar, the app will now be running on your headset

Notes:

  • All samples, except MRUKSample, require you to install Meta Spatial Editor.
  • MediaPlayerSample contains an example of custom shaders, which requires the NDK to be installed and set up in app/build.gradle.kts (ex. ndkVersion = "27.0.12077973")
  • CustomComponentsSample supports our custom OVRMetrics integration

Samples

We have 10 sample apps, demonstrating various features of Meta Spatial SDK:

We also have a starter app CustomComponentsStarter, which only contains the boilerplate code of CustomComponentsSample. You can download this starter app and follow this tutorial to build a LookAt app with Meta Spatial Editor and SDK.

Showcases

The Showcases folder contains three apps which are deployed to the Meta Horizon Store. These are fully-featured applications built with Meta Spatial SDK, and are open-sourced here in this repository.

Documentation

The documentation for Meta Spatial SDK can be found here.

0.5.2 Updates

Our full update list can be found in our CHANGELOG.md file.

Added

  • Added Followable Component and FollowableSystem which allows devs to easily tether objects together. See Animations Sample for an example use.
  • Hot Reload: Adds the ability to reload your glb/gltf/glxf and Meta Spatial Editor scenes while running your app via the Gradle plugin.
    • Auto Export from Meta Spatial Editor: Saving in Spatial Editor automatically exports to the app and pushes to the headset for hot reload
    • Two Reload Types:
      • Delete all entities and recreate them: more stable but does not work for all apps
      • Keep entities and reload meshes only: works for all apps, but less stable and does not reload components

Changed

  • SamplerConfigs now also apply to layers instead of just non-layer panels
  • Cylinder panels now have a transparent back applied to them (instead of just being invisible)
  • Gradle Plugin: References to string paths in plugin configuration are replaced with file references.
    • NOTE: This requires changes to your build.gradle.kts. Example new usage can be found in the sample build.gradle.kts files.
  • Gradle Plugin: Telemetry now reports out simple usage statistics.

Deprecated

  • Deprecated QuadLayerConfig/CylinderLayerConfig/EquirectLayerConfig. Use LayerConfig instead for panel's layer configuration.

Fixed

  • Fixed a crash when garbage collecting a panel.
  • Fixed a crash when updating the Panel component on an entity that already had a Panel component.
  • Crash fixed in Focus showcase

Spatial SDK Gradle Plugin

The samples all include the Spatial SDK Gradle Plugin in their build files. This plugin is used for the Spatial Editor integration and for build-related features like custom shaders.

Meta collects telemetry data from the Spatial SDK Gradle Plugin to help improve MPT Products. You can read the Supplemental Meta Platforms Technologies Privacy Policy to learn more.

License

The Meta Spatial SDK Samples package is multi-licensed.

The majority of the project is licensed under the MIT License, as found in the LICENSE file.

The Meta Platform Technologies SDK license applies to the Meta Spatial SDK and supporting material, and to the assets used in the Meta Spatial SDK Samples package. The MPT SDK license can be found in the asset folder of each sample.

Specifically, all the supporting materials in each sample's app/src/main/res/raw and app/src/main/assets folders including 3D models, videos, sounds, and others, are licensed under the MPT SDK license.

About

The Meta Spatial SDK Samples is a collection of code samples and projects that demonstrate the capabilities of the Meta Spatial SDK. Meta Spatial SDK enables mobile developers to build Meta Horizon OS experiences using familiar Android languages, tools, and libraries.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published