An open-source implementation of the Oculus Platform SDK intended to be used with the Quest platform. See the download page of the documentation for a list of supported Godot Engine and Oculus Platform SDK versions.
While you can use this plugin in the editor to get code suggestions, it only works with the Meta Quest (Android), not PCVR (Rift) at the moment. If you plan to develop for both the Quest and Rift, you should add a platform check and only use this plugin when the platform is Android.
Main branch (this branch) works with Godot 4.2+
Quick links:
After you have everything setup, you can start interacting with the Oculus Platform with the singleton GDOculusPlatform
. Here's an example of an Entitlement Check:
# Initializing android platform with the APP_ID as a parameter
GDOculusPlatform.initialize_android_async("314159265358979")\
.then(func(_initialization_resp):
print("Oculus Platform initialized!")
# Is the user entitled to this app?
GDOculusPlatform.get_is_viewer_entitled()\
.then(func(_is_viewer_entitled_resp):
print("User is entitled!")
)\
.error(func(is_viewer_entitled_err):
print("User not entitled/error! ", is_viewer_entitled_err)
)
)\
.error(func(initialization_err):
print("Oculus Platform initialization error: ", initialization_err)
)
We use a promise-based approach for every request that is asynchronous. The then
Callable
will only be called if the request was fulfilled (i.e. successful) and the error
Callable
will be called if there was an error with the request.
NOTE: The demo included in this repository won't work on its own. You still have to setup an app in the Oculus Dashboard, upload a release version and request all the required Data Use Checkup permissions to test, otherwise most fields will be empty/null. Also, it's missing the OpenXR Loaders.
You can find all the releases in the GitHub releases page.
You can also use the interactive version list in the documentation website to quickly find the version you need.
In-development precompiled versions can be found in the GitHub actions page.
After cloning this repository, initialize the submodules by running:
git submodule update --init --recursive
Then run:
scons platform=PLATFORM_HERE target=TARGET_HERE
The required compilation parameters are:
- platform:
windows
,macos
,linux
orandroid
- target:
template_debug
ortemplate_release
For android, you also have to add: arch=arm64v8
and you only need to generate the template_release
since template_debug
is not used.
You can optionally add -j<cores>
to use a set number of cores to build this asset. For example: -j4
The files will be placed in: demo/addons/godot_oculus_platform/bin
This addon also requires an Android plugin to work with the Quest platform. To build this plugin you have to navigate to tools/godotoculusplatform-android-plugin
and run:
On windows:
.\gradlew.bat build
On linux:
./gradlew build
Finally, you have to copy the files into place:
Source | Destination |
---|---|
demo/addons/godot_oculus_platform |
Your projet's addon folder |
tools/godotoculusplatform-android-plugin/godotoculusplatform-android-plugin/build/outputs/aar/godotoculusplatform-android-plugin-release.aar |
addons/godot_oculus_platform/android_plugin |
tools/godotoculusplatform-android-plugin/godotoculusplatform-android-plugin/build/outputs/aar/godotoculusplatform-android-plugin-debug.aar |
addons/godot_oculus_platform/android_plugin |
Make sure to enable the Godot Oculus Platform
plugin in your Project Settings.
- Most methods don't work or return an error: usually this is because the
INTERNET
permission is missing from the manifest.
Unless specified otherwise, sources in this repository are licensed under MIT, see LICENSE
for more information.
Note that some vendor-specific components are licensed under separate license terms, which are listed in their corresponding folders.
This repository was created and maintained by Daniel Castellanos (decacis).
Inspiration and code examples were taken from the following projects: