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.
To try out these sample apps, you will need:
- A Meta Quest device (Quest 2/3/3S/Pro)
- Mac or Windows
- Android Studio Hedgehog or newer
- Meta Spatial Editor
First, ensure that all of the requirements are met.
Then, to build and run a sample:
- Clone this repository to your computer
- Open the specific sample app with Android Studio
- Plug in your Quest device to your computer
- 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
We have 10 sample apps, demonstrating various features of Meta Spatial SDK:
- AnimationsSample
- HybridSample
- CustomComponentsSample
- MediaPlayerSample
- MixedRealitySample
- MrukSample
- Object3DSample
- PhysicsSample
- SpatialVideoSample
- StarterSample
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.
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.
The documentation for Meta Spatial SDK can be found here.
- Removed the old Anchor Systems in toolkit, please use MRUK(Mixed Reality Utility Kit) in Meta Spatial SDK
- Added support for Secure layers Layers can now be marked as secure making them appear black while recording. This is possible at a global level or an individual layer level.
// globally enable
scene.setSecureLayers(true)
// individually enable
myLayerConfig.secure = true
In addition, this value can be set on a global level using your AndroidManifest
<meta-data
android:name="com.meta.spatial.SECURE_LAYERS"
android:value="true"
/>
- Init order issue for FeatureManager An overridden registerFeatures() was not able to reference the top level class variables. This was because the initialization was happening very early in the creation of a Feature. This was resolved by moving initialization later in activity startup.
- Memory leak on panel destruction Destroy the activity panel by calling lifecycle events onPause, onStop, onDestroy sequentially. Release the panel scene texture and mesh as panel destruction, which reclaims the resource early.
- Fixed the issue that the panel faced the user backwards when grabbed from behind. The panel will now always face the user correctly, regardless of the angle of grabbing.
- Fix the grabbable bug for the cylinder panel when the user is close to the panel. When the user is very close to the panel, i.e., the center of the cylinder is behind the user, the grabbable system does not work well for rotation.
- Fix compatibility issues with Android Studio Ladybug
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.