Add OpenXR 1.1 support
This commit is contained in:
@ -62,7 +62,7 @@ void OpenXRAndroidThreadSettingsExtension::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(THREAD_TYPE_RENDERER_WORKER);
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRAndroidThreadSettingsExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRAndroidThreadSettingsExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
#ifdef XR_USE_PLATFORM_ANDROID
|
||||
|
||||
@ -50,7 +50,7 @@ public:
|
||||
OpenXRAndroidThreadSettingsExtension();
|
||||
virtual ~OpenXRAndroidThreadSettingsExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
virtual void on_instance_created(XrInstance p_instance) override;
|
||||
virtual void on_session_created(XrSession p_session) override;
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ OpenXRCompositionLayerDepthExtension::~OpenXRCompositionLayerDepthExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRCompositionLayerDepthExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRCompositionLayerDepthExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_KHR_COMPOSITION_LAYER_DEPTH_EXTENSION_NAME] = &available;
|
||||
|
||||
@ -44,7 +44,7 @@ public:
|
||||
OpenXRCompositionLayerDepthExtension();
|
||||
virtual ~OpenXRCompositionLayerDepthExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
bool is_available();
|
||||
virtual int get_composition_layer_count() override;
|
||||
virtual XrCompositionLayerBaseHeader *get_composition_layer(int p_index) override;
|
||||
|
||||
@ -56,7 +56,7 @@ OpenXRCompositionLayerExtension::~OpenXRCompositionLayerExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRCompositionLayerExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRCompositionLayerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_KHR_COMPOSITION_LAYER_CYLINDER_EXTENSION_NAME] = &cylinder_ext_available;
|
||||
|
||||
@ -126,7 +126,7 @@ public:
|
||||
OpenXRCompositionLayerExtension();
|
||||
virtual ~OpenXRCompositionLayerExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_session_created(const XrSession p_session) override;
|
||||
virtual void on_session_destroyed() override;
|
||||
|
||||
@ -50,7 +50,7 @@ OpenXRDebugUtilsExtension::~OpenXRDebugUtilsExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRDebugUtilsExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRDebugUtilsExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_EXT_DEBUG_UTILS_EXTENSION_NAME] = &debug_utils_ext;
|
||||
|
||||
@ -45,7 +45,7 @@ public:
|
||||
OpenXRDebugUtilsExtension();
|
||||
virtual ~OpenXRDebugUtilsExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ OpenXRDPadBindingExtension::~OpenXRDPadBindingExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRDPadBindingExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRDPadBindingExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
// Note, we're dependent on the binding modifier extension, this may be requested by multiple extension wrappers.
|
||||
|
||||
@ -48,7 +48,7 @@ public:
|
||||
OpenXRDPadBindingExtension();
|
||||
virtual ~OpenXRDPadBindingExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
#include "../openxr_api_extension.h"
|
||||
|
||||
void OpenXRExtensionWrapper::_bind_methods() {
|
||||
GDVIRTUAL_BIND(_get_requested_extensions);
|
||||
GDVIRTUAL_BIND(_get_requested_extensions, "xr_version");
|
||||
GDVIRTUAL_BIND(_set_system_properties_and_get_next_pointer, "next_pointer");
|
||||
GDVIRTUAL_BIND(_set_instance_create_info_and_get_next_pointer, "next_pointer");
|
||||
GDVIRTUAL_BIND(_set_instance_create_info_and_get_next_pointer, "xr_version", "next_pointer");
|
||||
GDVIRTUAL_BIND(_set_session_create_and_get_next_pointer, "next_pointer");
|
||||
GDVIRTUAL_BIND(_set_swapchain_create_info_and_get_next_pointer, "next_pointer");
|
||||
GDVIRTUAL_BIND(_set_hand_joint_locations_and_get_next_pointer, "hand_index", "next_pointer");
|
||||
@ -79,14 +79,19 @@ void OpenXRExtensionWrapper::_bind_methods() {
|
||||
GDVIRTUAL_BIND(_on_viewport_composition_layer_destroyed, "layer");
|
||||
GDVIRTUAL_BIND(_set_android_surface_swapchain_create_info_and_get_next_pointer, "property_values", "next_pointer");
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
GDVIRTUAL_BIND_COMPAT(_get_requested_extensions_bind_compat_109302);
|
||||
GDVIRTUAL_BIND_COMPAT(_set_instance_create_info_and_get_next_pointer_bind_compat_109302, "next_pointer");
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_openxr_api"), &OpenXRExtensionWrapper::_gdextension_get_openxr_api);
|
||||
ClassDB::bind_method(D_METHOD("register_extension_wrapper"), &OpenXRExtensionWrapper::_gdextension_register_extension_wrapper);
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRExtensionWrapper::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRExtensionWrapper::get_requested_extensions(XrVersion p_xr_version) {
|
||||
Dictionary request_extension;
|
||||
|
||||
if (GDVIRTUAL_CALL(_get_requested_extensions, request_extension)) {
|
||||
if (GDVIRTUAL_CALL(_get_requested_extensions, (uint64_t)p_xr_version, request_extension)) {
|
||||
HashMap<String, bool *> result;
|
||||
for (const KeyValue<Variant, Variant> &kv : request_extension) {
|
||||
GDExtensionPtr<bool> value = VariantCaster<GDExtensionPtr<bool>>::cast(kv.value);
|
||||
@ -95,6 +100,17 @@ HashMap<String, bool *> OpenXRExtensionWrapper::get_requested_extensions() {
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
if (GDVIRTUAL_CALL(_get_requested_extensions_bind_compat_109302, request_extension)) {
|
||||
HashMap<String, bool *> result;
|
||||
for (const KeyValue<Variant, Variant> &kv : request_extension) {
|
||||
GDExtensionPtr<bool> value = VariantCaster<GDExtensionPtr<bool>>::cast(kv.value);
|
||||
result.insert(kv.key, value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
return HashMap<String, bool *>();
|
||||
}
|
||||
|
||||
@ -108,13 +124,19 @@ void *OpenXRExtensionWrapper::set_system_properties_and_get_next_pointer(void *p
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void *OpenXRExtensionWrapper::set_instance_create_info_and_get_next_pointer(void *p_next_pointer) {
|
||||
void *OpenXRExtensionWrapper::set_instance_create_info_and_get_next_pointer(XrVersion p_xr_version, void *p_next_pointer) {
|
||||
uint64_t pointer;
|
||||
|
||||
if (GDVIRTUAL_CALL(_set_instance_create_info_and_get_next_pointer, GDExtensionPtr<void>(p_next_pointer), pointer)) {
|
||||
if (GDVIRTUAL_CALL(_set_instance_create_info_and_get_next_pointer, (uint64_t)p_xr_version, GDExtensionPtr<void>(p_next_pointer), pointer)) {
|
||||
return reinterpret_cast<void *>(pointer);
|
||||
}
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
if (GDVIRTUAL_CALL(_set_instance_create_info_and_get_next_pointer_bind_compat_109302, GDExtensionPtr<void>(p_next_pointer), pointer)) {
|
||||
return reinterpret_cast<void *>(pointer);
|
||||
}
|
||||
#endif
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -60,12 +60,15 @@ protected:
|
||||
|
||||
public:
|
||||
// `get_requested_extensions` should return a list of OpenXR extensions related to this extension.
|
||||
// This function can be called multiple times.
|
||||
// p_xr_version is the OpenXR version which we're attempting to initialize.
|
||||
// Note: when called from the editor, p_xr_version will be 0 and we should return any extension we may initialize.
|
||||
// If the bool * is a nullptr this extension is mandatory
|
||||
// If the bool * points to a boolean, the boolean will be updated
|
||||
// to true if the extension is enabled.
|
||||
virtual HashMap<String, bool *> get_requested_extensions();
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_xr_version);
|
||||
|
||||
GDVIRTUAL0R(Dictionary, _get_requested_extensions);
|
||||
GDVIRTUAL1R(Dictionary, _get_requested_extensions, uint64_t);
|
||||
|
||||
// These functions allow an extension to add entries to a struct chain.
|
||||
// `p_next_pointer` points to the last struct that was created for this chain
|
||||
@ -74,7 +77,7 @@ public:
|
||||
// If you are not adding any structs, just return `p_next_pointer`.
|
||||
// See existing extensions for examples of this implementation.
|
||||
virtual void *set_system_properties_and_get_next_pointer(void *p_next_pointer); // Add additional data structures when we interrogate OpenXR's system abilities.
|
||||
virtual void *set_instance_create_info_and_get_next_pointer(void *p_next_pointer); // Add additional data structures when we create our OpenXR instance.
|
||||
virtual void *set_instance_create_info_and_get_next_pointer(XrVersion p_xr_version, void *p_next_pointer); // Add additional data structures when we create our OpenXR instance.
|
||||
virtual void *set_session_create_and_get_next_pointer(void *p_next_pointer); // Add additional data structures when we create our OpenXR session.
|
||||
virtual void *set_swapchain_create_info_and_get_next_pointer(void *p_next_pointer); // Add additional data structures when creating OpenXR swap chains.
|
||||
virtual void *set_hand_joint_locations_and_get_next_pointer(int p_hand_index, void *p_next_pointer);
|
||||
@ -91,7 +94,7 @@ public:
|
||||
|
||||
//TODO workaround as GDExtensionPtr<void> return type results in build error in godot-cpp
|
||||
GDVIRTUAL1R(uint64_t, _set_system_properties_and_get_next_pointer, GDExtensionPtr<void>);
|
||||
GDVIRTUAL1R(uint64_t, _set_instance_create_info_and_get_next_pointer, GDExtensionPtr<void>);
|
||||
GDVIRTUAL2R(uint64_t, _set_instance_create_info_and_get_next_pointer, uint64_t, GDExtensionPtr<void>);
|
||||
GDVIRTUAL1R(uint64_t, _set_session_create_and_get_next_pointer, GDExtensionPtr<void>);
|
||||
GDVIRTUAL1R(uint64_t, _set_swapchain_create_info_and_get_next_pointer, GDExtensionPtr<void>);
|
||||
GDVIRTUAL2R(uint64_t, _set_hand_joint_locations_and_get_next_pointer, int, GDExtensionPtr<void>);
|
||||
@ -107,6 +110,11 @@ public:
|
||||
GDVIRTUAL2R(uint64_t, _set_view_configuration_and_get_next_pointer, uint32_t, GDExtensionPtr<void>);
|
||||
GDVIRTUAL1C(_print_view_configuration_info, int);
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
GDVIRTUAL0R_COMPAT(_get_requested_extensions_bind_compat_109302, Dictionary, _get_requested_extensions);
|
||||
GDVIRTUAL1R_COMPAT(_set_instance_create_info_and_get_next_pointer_bind_compat_109302, uint64_t, _set_instance_create_info_and_get_next_pointer, GDExtensionPtr<void>);
|
||||
#endif
|
||||
|
||||
virtual PackedStringArray get_suggested_tracker_names();
|
||||
|
||||
GDVIRTUAL0R(PackedStringArray, _get_suggested_tracker_names);
|
||||
|
||||
@ -51,7 +51,7 @@ OpenXREyeGazeInteractionExtension::~OpenXREyeGazeInteractionExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXREyeGazeInteractionExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXREyeGazeInteractionExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
// Only enable this extension when requested.
|
||||
|
||||
@ -44,7 +44,7 @@ public:
|
||||
OpenXREyeGazeInteractionExtension();
|
||||
~OpenXREyeGazeInteractionExtension();
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
virtual void *set_system_properties_and_get_next_pointer(void *p_next_pointer) override;
|
||||
|
||||
PackedStringArray get_suggested_tracker_names() override;
|
||||
|
||||
@ -45,7 +45,7 @@ OpenXRDisplayRefreshRateExtension::~OpenXRDisplayRefreshRateExtension() {
|
||||
display_refresh_rate_ext = false;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRDisplayRefreshRateExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRDisplayRefreshRateExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME] = &display_refresh_rate_ext;
|
||||
|
||||
@ -51,7 +51,7 @@ public:
|
||||
OpenXRDisplayRefreshRateExtension();
|
||||
virtual ~OpenXRDisplayRefreshRateExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -75,7 +75,7 @@ OpenXRFBFoveationExtension::~OpenXRFBFoveationExtension() {
|
||||
swapchain_update_state_ext = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRFBFoveationExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRFBFoveationExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_FB_FOVEATION_EXTENSION_NAME] = &fb_foveation_ext;
|
||||
|
||||
@ -52,7 +52,7 @@ public:
|
||||
OpenXRFBFoveationExtension(const String &p_rendering_driver);
|
||||
virtual ~OpenXRFBFoveationExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -61,7 +61,7 @@ OpenXRFBUpdateSwapchainExtension::~OpenXRFBUpdateSwapchainExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRFBUpdateSwapchainExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRFBUpdateSwapchainExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_FB_SWAPCHAIN_UPDATE_STATE_EXTENSION_NAME] = &fb_swapchain_update_state_ext;
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
OpenXRFBUpdateSwapchainExtension(const String &p_rendering_driver);
|
||||
virtual ~OpenXRFBUpdateSwapchainExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -68,7 +68,7 @@ OpenXRFrameSynthesisExtension::~OpenXRFrameSynthesisExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRFrameSynthesisExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRFrameSynthesisExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
if (GLOBAL_GET("xr/openxr/extensions/frame_synthesis")) {
|
||||
|
||||
@ -44,7 +44,7 @@ public:
|
||||
OpenXRFrameSynthesisExtension();
|
||||
virtual ~OpenXRFrameSynthesisExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -129,7 +129,7 @@ void OpenXRFutureExtension::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("cancel_future", "future"), &OpenXRFutureExtension::_cancel_future);
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRFutureExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRFutureExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_EXT_FUTURE_EXTENSION_NAME] = &future_ext;
|
||||
|
||||
@ -104,7 +104,7 @@ public:
|
||||
OpenXRFutureExtension();
|
||||
virtual ~OpenXRFutureExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include "openxr_hand_interaction_extension.h"
|
||||
|
||||
#include "../action_map/openxr_interaction_profile_metadata.h"
|
||||
#include "../openxr_api.h"
|
||||
#include "core/config/project_settings.h"
|
||||
|
||||
#include <openxr/openxr.h>
|
||||
@ -49,7 +50,7 @@ OpenXRHandInteractionExtension::~OpenXRHandInteractionExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRHandInteractionExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRHandInteractionExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
// Only enable this extension when requested.
|
||||
@ -78,7 +79,7 @@ void OpenXRHandInteractionExtension::on_register_metadata() {
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Pinch pose", user_path, user_path + "/input/pinch_ext/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Poke pose", user_path, user_path + "/input/poke_ext/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Pinch", user_path, user_path + "/input/pinch_ext/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Pinch ready", user_path, user_path + "/input/pinch_ext/ready_ext", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
OpenXRHandInteractionExtension();
|
||||
virtual ~OpenXRHandInteractionExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ OpenXRHandTrackingExtension::~OpenXRHandTrackingExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRHandTrackingExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRHandTrackingExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
unobstructed_data_source = GLOBAL_GET("xr/openxr/extensions/hand_tracking_unobstructed_data_source");
|
||||
|
||||
@ -76,7 +76,7 @@ public:
|
||||
OpenXRHandTrackingExtension();
|
||||
virtual ~OpenXRHandTrackingExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -31,12 +31,17 @@
|
||||
#include "openxr_htc_controller_extension.h"
|
||||
|
||||
#include "../action_map/openxr_interaction_profile_metadata.h"
|
||||
#include "../openxr_api.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRHTCControllerExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRHTCControllerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available[HTC_VIVE_COSMOS];
|
||||
request_extensions[XR_HTC_VIVE_FOCUS3_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available[HTC_VIVE_FOCUS3];
|
||||
if (p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extensions where promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
request_extensions[XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available[HTC_VIVE_COSMOS];
|
||||
request_extensions[XR_HTC_VIVE_FOCUS3_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available[HTC_VIVE_FOCUS3];
|
||||
}
|
||||
|
||||
request_extensions[XR_HTC_HAND_INTERACTION_EXTENSION_NAME] = &available[HTC_HAND_INTERACTION];
|
||||
|
||||
return request_extensions;
|
||||
@ -63,11 +68,11 @@ void OpenXRHTCControllerExtension::on_register_metadata() {
|
||||
|
||||
{ // HTC Vive Cosmos controller
|
||||
const String profile_path = "/interaction_profiles/htc/vive_cosmos_controller";
|
||||
openxr_metadata->register_interaction_profile("Vive Cosmos controller", profile_path, XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME);
|
||||
openxr_metadata->register_interaction_profile("Vive Cosmos controller", profile_path, XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Shoulder click", user_path, user_path + "/input/shoulder/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
@ -98,11 +103,11 @@ void OpenXRHTCControllerExtension::on_register_metadata() {
|
||||
|
||||
{ // HTC Vive Focus 3 controller
|
||||
const String profile_path = "/interaction_profiles/htc/vive_focus3_controller";
|
||||
openxr_metadata->register_interaction_profile("Vive Focus 3 controller", profile_path, XR_HTC_VIVE_FOCUS3_CONTROLLER_INTERACTION_EXTENSION_NAME);
|
||||
openxr_metadata->register_interaction_profile("Vive Focus 3 controller", profile_path, XR_HTC_VIVE_FOCUS3_CONTROLLER_INTERACTION_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger", user_path, user_path + "/input/trigger/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger click", user_path, user_path + "/input/trigger/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
@ -47,7 +47,7 @@ public:
|
||||
HTC_MAX_CONTROLLERS
|
||||
};
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
PackedStringArray get_suggested_tracker_names() override;
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
#include "core/string/print_string.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRHTCViveTrackerExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRHTCViveTrackerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_HTCX_VIVE_TRACKER_INTERACTION_EXTENSION_NAME] = &available;
|
||||
|
||||
@ -39,7 +39,7 @@ protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
PackedStringArray get_suggested_tracker_names() override;
|
||||
|
||||
|
||||
@ -31,8 +31,9 @@
|
||||
#include "openxr_huawei_controller_extension.h"
|
||||
|
||||
#include "../action_map/openxr_interaction_profile_metadata.h"
|
||||
#include "../openxr_api.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRHuaweiControllerExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRHuaweiControllerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_HUAWEI_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available;
|
||||
@ -55,6 +56,7 @@ void OpenXRHuaweiControllerExtension::on_register_metadata() {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Home click", user_path, user_path + "/input/home/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Back click", user_path, user_path + "/input/back/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
@ -39,7 +39,7 @@ protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -30,6 +30,8 @@
|
||||
|
||||
#include "openxr_local_floor_extension.h"
|
||||
|
||||
#include "../openxr_api.h"
|
||||
|
||||
OpenXRLocalFloorExtension *OpenXRLocalFloorExtension::singleton = nullptr;
|
||||
|
||||
OpenXRLocalFloorExtension *OpenXRLocalFloorExtension::get_singleton() {
|
||||
@ -44,10 +46,13 @@ OpenXRLocalFloorExtension::~OpenXRLocalFloorExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRLocalFloorExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRLocalFloorExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_EXT_LOCAL_FLOOR_EXTENSION_NAME] = &available;
|
||||
if (p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extension was promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
request_extensions[XR_EXT_LOCAL_FLOOR_EXTENSION_NAME] = &available;
|
||||
}
|
||||
|
||||
return request_extensions;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ public:
|
||||
OpenXRLocalFloorExtension();
|
||||
virtual ~OpenXRLocalFloorExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -31,13 +31,30 @@
|
||||
#include "openxr_meta_controller_extension.h"
|
||||
|
||||
#include "../action_map/openxr_interaction_profile_metadata.h"
|
||||
#include "../openxr_api.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRMetaControllerExtension::get_requested_extensions() {
|
||||
const char *touch_controller = "/interaction_profiles/oculus/touch_controller";
|
||||
const char *touch_pro_controller = "/interaction_profiles/meta/touch_pro_controller";
|
||||
const char *touch_plus_controller = "/interaction_profiles/meta/touch_plus_controller";
|
||||
const char *rift_cv1_controller = "/interaction_profiles/meta/touch_controller_rift_cv1";
|
||||
const char *quest1_rift_s_controller = "/interaction_profiles/meta/touch_controller_quest_1_rift_s";
|
||||
const char *quest2_controller = "/interaction_profiles/meta/touch_controller_quest_2";
|
||||
|
||||
// Vendor extension paths (promoted)
|
||||
const char *touch_controller_pro_fb = "/interaction_profiles/facebook/touch_controller_pro";
|
||||
const char *touch_controller_plus_fb = "/interaction_profiles/facebook/touch_controller_plus";
|
||||
const char *touch_controller_plus_meta = "/interaction_profiles/meta/touch_controller_plus";
|
||||
|
||||
HashMap<String, bool *> OpenXRMetaControllerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
if (p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extensions where promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
request_extensions[XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME] = &available[META_TOUCH_PRO];
|
||||
request_extensions[XR_META_TOUCH_CONTROLLER_PLUS_EXTENSION_NAME] = &available[META_TOUCH_PLUS];
|
||||
}
|
||||
|
||||
request_extensions[XR_FB_TOUCH_CONTROLLER_PROXIMITY_EXTENSION_NAME] = &available[META_TOUCH_PROXIMITY];
|
||||
request_extensions[XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME] = &available[META_TOUCH_PRO];
|
||||
request_extensions[XR_META_TOUCH_CONTROLLER_PLUS_EXTENSION_NAME] = &available[META_TOUCH_PLUS];
|
||||
|
||||
return request_extensions;
|
||||
}
|
||||
@ -50,34 +67,69 @@ void OpenXRMetaControllerExtension::on_register_metadata() {
|
||||
OpenXRInteractionProfileMetadata *openxr_metadata = OpenXRInteractionProfileMetadata::get_singleton();
|
||||
ERR_FAIL_NULL(openxr_metadata);
|
||||
|
||||
// Note, we register controllers regardless if they are supported on the current hardware.
|
||||
// Note, we register controllers regardless if they are supported on the current hardware,
|
||||
// this allows the editor to configure controllers for other platforms.
|
||||
// Unsupported entries will be filtered out of the action map if applicable.
|
||||
|
||||
{ // Normal touch controller is part of the core spec, but we do have some extensions.
|
||||
const String profile_path = "/interaction_profiles/oculus/touch_controller";
|
||||
// OpenXR 1.1 uses various new names for profile and input/output paths.
|
||||
// We use these new names in our action map and translate back IF OpenXR 1.1 is not supported.
|
||||
openxr_metadata->register_profile_rename(touch_controller_pro_fb, touch_pro_controller);
|
||||
openxr_metadata->register_profile_rename(touch_controller_plus_fb, touch_controller_plus_meta); // This was an incorrect profile path that we need to correct.
|
||||
openxr_metadata->register_profile_rename(touch_controller_plus_meta, touch_plus_controller);
|
||||
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/stylus_fb/force", "/user/hand/left/input/stylus/force");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/stylus_fb/force", "/user/hand/right/input/stylus/force");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/trigger/proximity_fb", "/user/hand/left/input/trigger/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/trigger/proximity_fb", "/user/hand/right/input/trigger/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/output/haptic_trigger_fb", "/user/hand/left/output/haptic_trigger");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/output/haptic_trigger_fb", "/user/hand/right/output/haptic_trigger");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/output/haptic_thumb_fb", "/user/hand/left/output/haptic_thumb");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/output/haptic_thumb_fb", "/user/hand/right/output/haptic_thumb");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/thumb_fb/proximity_fb", "/user/hand/left/input/thumb_resting_surfaces/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/thumb_fb/proximity_fb", "/user/hand/right/input/thumb_resting_surfaces/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/trigger/curl_fb", "/user/hand/left/input/trigger_curl/value");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/trigger/curl_fb", "/user/hand/right/input/trigger_curl/value");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/trigger/slide_fb", "/user/hand/left/input/trigger_slide/value");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/trigger/slide_fb", "/user/hand/right/input/trigger_slide/value");
|
||||
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/trigger/proximity_meta", "/user/hand/left/input/trigger/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/trigger/proximity_meta", "/user/hand/right/input/trigger/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/thumb_meta/proximity_meta", "/user/hand/left/input/thumb_resting_surfaces/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/thumb_meta/proximity_meta", "/user/hand/right/input/thumb_resting_surfaces/proximity");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/trigger/curl_meta", "/user/hand/left/input/trigger_curl/value");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/trigger/curl_meta", "/user/hand/right/input/trigger_curl/value");
|
||||
openxr_metadata->register_path_rename("/user/hand/left/input/trigger/slide_meta", "/user/hand/left/input/trigger_slide/value");
|
||||
openxr_metadata->register_path_rename("/user/hand/right/input/trigger/slide_meta", "/user/hand/right/input/trigger_slide/value");
|
||||
|
||||
{ // Normal touch controller is part of the core spec and still relies on the XR_FB_touch_controller_proximity extension for these two new paths.
|
||||
const String profile_path = touch_controller;
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger proximity", user_path, user_path + "/input/trigger/proximity_fb ", "XR_FB_touch_controller_proximity", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumb proximity", user_path, user_path + "/input/thumb_fb/proximity_fb ", "XR_FB_touch_controller_proximity", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger proximity", user_path, user_path + "/input/trigger/proximity", XR_FB_TOUCH_CONTROLLER_PROXIMITY_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumb proximity", user_path, user_path + "/input/thumb_resting_surfaces/proximity", XR_FB_TOUCH_CONTROLLER_PROXIMITY_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
}
|
||||
}
|
||||
|
||||
{ // Touch controller pro (Quest Pro)
|
||||
const String profile_path = "/interaction_profiles/facebook/touch_controller_pro";
|
||||
openxr_metadata->register_interaction_profile("Touch controller pro", profile_path, "XR_FB_touch_controller_pro");
|
||||
const String profile_path = touch_pro_controller;
|
||||
openxr_metadata->register_interaction_profile("Touch controller pro", profile_path, XR_FB_TOUCH_CONTROLLER_PRO_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Pinch pose", user_path, user_path + "/input/pinch_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Poke pose", user_path, user_path + "/input/poke_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger", user_path, user_path + "/input/trigger/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger touch", user_path, user_path + "/input/trigger/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger proximity", user_path, user_path + "/input/trigger/proximity_fb", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger curl", user_path, user_path + "/input/trigger/curl_fb", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger slide", user_path, user_path + "/input/trigger/slide_fb", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger proximity", user_path, user_path + "/input/trigger/proximity", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger curl", user_path, user_path + "/input/trigger_curl/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger slide", user_path, user_path + "/input/trigger_slide/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger force", user_path, user_path + "/input/trigger/force", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Squeeze", user_path, user_path + "/input/squeeze/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Thumb proximity", user_path, user_path + "/input/thumb_fb/proximity_fb", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumb proximity", user_path, user_path + "/input/thumb_resting_surfaces/proximity", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick", user_path, user_path + "/input/thumbstick", "", OpenXRAction::OPENXR_ACTION_VECTOR2);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick X", user_path, user_path + "/input/thumbstick/x", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
@ -92,11 +144,11 @@ void OpenXRMetaControllerExtension::on_register_metadata() {
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbrest touch", user_path, user_path + "/input/thumbrest/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbrest force", user_path, user_path + "/input/thumbrest/force", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Stylus force", user_path, user_path + "/input/stylus_fb/force", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Stylus force", user_path, user_path + "/input/stylus/force", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Haptic output", user_path, user_path + "/output/haptic", "", OpenXRAction::OPENXR_ACTION_HAPTIC);
|
||||
openxr_metadata->register_io_path(profile_path, "Haptic trigger output", user_path, user_path + "/output/haptic_trigger_fb", "", OpenXRAction::OPENXR_ACTION_HAPTIC);
|
||||
openxr_metadata->register_io_path(profile_path, "Haptic thumb output", user_path, user_path + "/output/haptic_thumb_fb", "", OpenXRAction::OPENXR_ACTION_HAPTIC);
|
||||
openxr_metadata->register_io_path(profile_path, "Haptic trigger output", user_path, user_path + "/output/haptic_trigger", "", OpenXRAction::OPENXR_ACTION_HAPTIC);
|
||||
openxr_metadata->register_io_path(profile_path, "Haptic thumb output", user_path, user_path + "/output/haptic_thumb", "", OpenXRAction::OPENXR_ACTION_HAPTIC);
|
||||
}
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Menu click", "/user/hand/left", "/user/hand/left/input/menu/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
@ -112,24 +164,27 @@ void OpenXRMetaControllerExtension::on_register_metadata() {
|
||||
openxr_metadata->register_io_path(profile_path, "B touch", "/user/hand/right", "/user/hand/right/input/b/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
}
|
||||
|
||||
{ // Touch controller plus (Quest 3)
|
||||
const String profile_path = "/interaction_profiles/meta/touch_controller_plus";
|
||||
openxr_metadata->register_interaction_profile("Touch controller plus", profile_path, "XR_META_touch_controller_plus");
|
||||
{ // Touch controller plus (Quest 3 + 3S)
|
||||
const String profile_path = touch_plus_controller;
|
||||
openxr_metadata->register_interaction_profile("Touch controller plus", profile_path, XR_META_TOUCH_CONTROLLER_PLUS_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Pinch pose", user_path, user_path + "/input/pinch_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Poke pose", user_path, user_path + "/input/poke_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger", user_path, user_path + "/input/trigger/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger touch", user_path, user_path + "/input/trigger/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger proximity", user_path, user_path + "/input/trigger/proximity_meta", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger curl", user_path, user_path + "/input/trigger/curl_meta", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger slide", user_path, user_path + "/input/trigger/slide_meta", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger proximity", user_path, user_path + "/input/trigger/proximity", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger curl", user_path, user_path + "/input/trigger_curl/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger slide", user_path, user_path + "/input/trigger_slide/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger force", user_path, user_path + "/input/trigger/force", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Squeeze", user_path, user_path + "/input/squeeze/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Thumb proximity", user_path, user_path + "/input/thumb_meta/proximity_meta", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumb proximity", user_path, user_path + "/input/thumb_resting_surfaces/proximity", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick", user_path, user_path + "/input/thumbstick", "", OpenXRAction::OPENXR_ACTION_VECTOR2);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick X", user_path, user_path + "/input/thumbstick/x", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
@ -158,4 +213,57 @@ void OpenXRMetaControllerExtension::on_register_metadata() {
|
||||
openxr_metadata->register_io_path(profile_path, "B click", "/user/hand/right", "/user/hand/right/input/b/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "B touch", "/user/hand/right", "/user/hand/right/input/b/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
}
|
||||
|
||||
{
|
||||
// In OpenXR 1.1 we have controller profiles for Meta legacy controllers. They are all the same as the normal touch controller profile.
|
||||
openxr_metadata->register_interaction_profile("Touch controller Rift CV1", rift_cv1_controller, XR_OPENXR_1_1_NAME);
|
||||
openxr_metadata->register_interaction_profile("Touch controller Quest 1 or Rift S", quest1_rift_s_controller, XR_OPENXR_1_1_NAME);
|
||||
openxr_metadata->register_interaction_profile("Touch controller Quest 2", quest2_controller, XR_OPENXR_1_1_NAME);
|
||||
|
||||
for (const String profile_path : { rift_cv1_controller, quest1_rift_s_controller, quest2_controller }) {
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Pinch pose", user_path, user_path + "/input/pinch_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Poke pose", user_path, user_path + "/input/poke_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger", user_path, user_path + "/input/trigger/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger touch", user_path, user_path + "/input/trigger/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Squeeze", user_path, user_path + "/input/squeeze/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
// Note, unlike the default touch controller interaction profile, these are not dependent on the XR_FB_touch_controller_proximity extension!
|
||||
openxr_metadata->register_io_path(profile_path, "Trigger proximity", user_path, user_path + "/input/trigger/proximity", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumb proximity", user_path, user_path + "/input/thumb_resting_surfaces/proximity", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick", user_path, user_path + "/input/thumbstick", "", OpenXRAction::OPENXR_ACTION_VECTOR2);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick X", user_path, user_path + "/input/thumbstick/x", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick Y", user_path, user_path + "/input/thumbstick/y", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick click", user_path, user_path + "/input/thumbstick/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick touch", user_path, user_path + "/input/thumbstick/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick Dpad Up", user_path, user_path + "/input/thumbstick/dpad_up", "XR_EXT_dpad_binding", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick Dpad Down", user_path, user_path + "/input/thumbstick/dpad_down", "XR_EXT_dpad_binding", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick Dpad Left", user_path, user_path + "/input/thumbstick/dpad_left", "XR_EXT_dpad_binding", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbstick Dpad Right", user_path, user_path + "/input/thumbstick/dpad_right", "XR_EXT_dpad_binding", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Thumbrest touch", user_path, user_path + "/input/thumbrest/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Haptic output", user_path, user_path + "/output/haptic", "", OpenXRAction::OPENXR_ACTION_HAPTIC);
|
||||
}
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Menu click", "/user/hand/left", "/user/hand/left/input/menu/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "System click", "/user/hand/right", "/user/hand/right/input/system/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "X click", "/user/hand/left", "/user/hand/left/input/x/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "X touch", "/user/hand/left", "/user/hand/left/input/x/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Y click", "/user/hand/left", "/user/hand/left/input/y/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "Y touch", "/user/hand/left", "/user/hand/left/input/y/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "A click", "/user/hand/right", "/user/hand/right/input/a/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "A touch", "/user/hand/right", "/user/hand/right/input/a/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "B click", "/user/hand/right", "/user/hand/right/input/b/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "B touch", "/user/hand/right", "/user/hand/right/input/b/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ public:
|
||||
META_MAX_CONTROLLERS
|
||||
};
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available(MetaControllers p_type);
|
||||
|
||||
|
||||
@ -31,11 +31,15 @@
|
||||
#include "openxr_ml2_controller_extension.h"
|
||||
|
||||
#include "../action_map/openxr_interaction_profile_metadata.h"
|
||||
#include "../openxr_api.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRML2ControllerExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRML2ControllerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_ML_ML2_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available;
|
||||
if (p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extension was promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
request_extensions[XR_ML_ML2_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available;
|
||||
}
|
||||
|
||||
return request_extensions;
|
||||
}
|
||||
@ -50,7 +54,7 @@ void OpenXRML2ControllerExtension::on_register_metadata() {
|
||||
|
||||
// Magic Leap 2 Controller
|
||||
const String profile_path = "/interaction_profiles/ml/ml2_controller";
|
||||
openxr_metadata->register_interaction_profile("Magic Leap 2 controller", profile_path, XR_ML_ML2_CONTROLLER_INTERACTION_EXTENSION_NAME);
|
||||
openxr_metadata->register_interaction_profile("Magic Leap 2 controller", profile_path, XR_ML_ML2_CONTROLLER_INTERACTION_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
@ -39,7 +39,7 @@ protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
// Not in base XR libs needs def
|
||||
#define XR_LOGITECH_MX_INK_STYLUS_INTERACTION_EXTENSION_NAME "XR_LOGITECH_mx_ink_stylus_interaction"
|
||||
|
||||
HashMap<String, bool *> OpenXRMxInkExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRMxInkExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_LOGITECH_MX_INK_STYLUS_INTERACTION_EXTENSION_NAME] = &available;
|
||||
|
||||
@ -39,7 +39,7 @@ protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -30,6 +30,8 @@
|
||||
|
||||
#include "openxr_palm_pose_extension.h"
|
||||
|
||||
#include "../openxr_api.h"
|
||||
|
||||
OpenXRPalmPoseExtension *OpenXRPalmPoseExtension::singleton = nullptr;
|
||||
|
||||
OpenXRPalmPoseExtension *OpenXRPalmPoseExtension::get_singleton() {
|
||||
@ -44,10 +46,13 @@ OpenXRPalmPoseExtension::~OpenXRPalmPoseExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRPalmPoseExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRPalmPoseExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_EXT_PALM_POSE_EXTENSION_NAME] = &available;
|
||||
if (p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extension was promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
request_extensions[XR_EXT_PALM_POSE_EXTENSION_NAME] = &available;
|
||||
}
|
||||
|
||||
return request_extensions;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ public:
|
||||
OpenXRPalmPoseExtension();
|
||||
virtual ~OpenXRPalmPoseExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ OpenXRPerformanceSettingsExtension::~OpenXRPerformanceSettingsExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRPerformanceSettingsExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRPerformanceSettingsExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME] = &available;
|
||||
|
||||
@ -41,7 +41,7 @@ public:
|
||||
OpenXRPerformanceSettingsExtension();
|
||||
virtual ~OpenXRPerformanceSettingsExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual bool on_event_polled(const XrEventDataBuffer &event) override;
|
||||
|
||||
@ -31,15 +31,20 @@
|
||||
#include "openxr_pico_controller_extension.h"
|
||||
|
||||
#include "../action_map/openxr_interaction_profile_metadata.h"
|
||||
#include "../openxr_api.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRPicoControllerExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRPicoControllerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
// Note, this used to be XR_PICO_controller_interaction but that has since been retired
|
||||
// and was never part of the OpenXX specification.
|
||||
// All PICO devices should be updated to an OS supporting the official extension.
|
||||
|
||||
request_extensions[XR_BD_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available;
|
||||
if (true || p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extension was promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
// Note, we still need it for pico4_interaction, hence the temporary `if (true || ...`
|
||||
request_extensions[XR_BD_CONTROLLER_INTERACTION_EXTENSION_NAME] = &available;
|
||||
}
|
||||
|
||||
return request_extensions;
|
||||
}
|
||||
@ -57,11 +62,11 @@ void OpenXRPicoControllerExtension::on_register_metadata() {
|
||||
|
||||
{ // Pico neo 3 controller.
|
||||
const String profile_path = "/interaction_profiles/bytedance/pico_neo3_controller";
|
||||
openxr_metadata->register_interaction_profile("Pico Neo3 controller", profile_path, XR_BD_CONTROLLER_INTERACTION_EXTENSION_NAME);
|
||||
openxr_metadata->register_interaction_profile("Pico Neo3 controller", profile_path, XR_BD_CONTROLLER_INTERACTION_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Menu click", user_path, user_path + "/input/menu/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
openxr_metadata->register_io_path(profile_path, "System click", user_path, user_path + "/input/system/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
@ -94,11 +99,11 @@ void OpenXRPicoControllerExtension::on_register_metadata() {
|
||||
|
||||
{ // Pico 4 controller.
|
||||
const String profile_path = "/interaction_profiles/bytedance/pico4_controller";
|
||||
openxr_metadata->register_interaction_profile("Pico 4 controller", profile_path, XR_BD_CONTROLLER_INTERACTION_EXTENSION_NAME);
|
||||
openxr_metadata->register_interaction_profile("Pico 4 controller", profile_path, XR_BD_CONTROLLER_INTERACTION_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "System click", user_path, user_path + "/input/system/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
@ -131,13 +136,13 @@ void OpenXRPicoControllerExtension::on_register_metadata() {
|
||||
openxr_metadata->register_io_path(profile_path, "B touch", "/user/hand/right", "/user/hand/right/input/b/touch", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
}
|
||||
|
||||
{ // Pico 4 Ultra controller.
|
||||
{ // Pico 4 Ultra controller, note: not provided by OpenXR 1.1
|
||||
const String profile_path = "/interaction_profiles/bytedance/pico4s_controller";
|
||||
openxr_metadata->register_interaction_profile("Pico 4 Ultra controller", profile_path, XR_BD_CONTROLLER_INTERACTION_EXTENSION_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "System click", user_path, user_path + "/input/system/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -71,11 +71,14 @@ OpenXRRenderModelExtension::~OpenXRRenderModelExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRRenderModelExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRRenderModelExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
if (GLOBAL_GET("xr/openxr/extensions/render_model")) {
|
||||
request_extensions[XR_EXT_UUID_EXTENSION_NAME] = &uuid_ext;
|
||||
if (p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extension was promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
request_extensions[XR_EXT_UUID_EXTENSION_NAME] = &uuid_ext;
|
||||
}
|
||||
request_extensions[XR_EXT_RENDER_MODEL_EXTENSION_NAME] = &render_model_ext;
|
||||
request_extensions[XR_EXT_INTERACTION_RENDER_MODEL_EXTENSION_NAME] = &interaction_render_model_ext;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public:
|
||||
OpenXRRenderModelExtension();
|
||||
virtual ~OpenXRRenderModelExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_session_created(const XrSession p_session) override;
|
||||
|
||||
@ -53,7 +53,7 @@ OpenXRValveAnalogThresholdExtension::~OpenXRValveAnalogThresholdExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRValveAnalogThresholdExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRValveAnalogThresholdExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
// Note, we're dependent on the binding modifier extension, this may be requested by multiple extension wrappers.
|
||||
|
||||
@ -48,7 +48,7 @@ public:
|
||||
OpenXRValveAnalogThresholdExtension();
|
||||
virtual ~OpenXRValveAnalogThresholdExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available();
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ OpenXRVisibilityMaskExtension::~OpenXRVisibilityMaskExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRVisibilityMaskExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRVisibilityMaskExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_KHR_VISIBILITY_MASK_EXTENSION_NAME] = &available;
|
||||
|
||||
@ -58,7 +58,7 @@ public:
|
||||
OpenXRVisibilityMaskExtension();
|
||||
virtual ~OpenXRVisibilityMaskExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
|
||||
|
||||
@ -31,13 +31,17 @@
|
||||
#include "openxr_wmr_controller_extension.h"
|
||||
|
||||
#include "../action_map/openxr_interaction_profile_metadata.h"
|
||||
#include "../openxr_api.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRWMRControllerExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRWMRControllerExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
// Note HP G2 is available on WMR and SteamVR, but Odessey is only available on WMR
|
||||
request_extensions[XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME] = &available[WMR_HPMR];
|
||||
request_extensions[XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME] = &available[WMR_SAMSUNG_ODESSY];
|
||||
if (p_version < XR_API_VERSION_1_1_0) {
|
||||
// Extensions where promoted in OpenXR 1.1, only include it in OpenXR 1.0.
|
||||
request_extensions[XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME] = &available[WMR_HPMR];
|
||||
request_extensions[XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME] = &available[WMR_SAMSUNG_ODESSY];
|
||||
}
|
||||
request_extensions[XR_MSFT_HAND_INTERACTION_EXTENSION_NAME] = &available[WMR_HAND_INTERACTION];
|
||||
|
||||
return request_extensions;
|
||||
@ -53,11 +57,11 @@ void OpenXRWMRControllerExtension::on_register_metadata() {
|
||||
|
||||
{ // HP MR controller (newer G2 controllers)
|
||||
const String profile_path = "/interaction_profiles/hp/mixed_reality_controller";
|
||||
openxr_metadata->register_interaction_profile("HPMR controller", profile_path, XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME);
|
||||
openxr_metadata->register_interaction_profile("HPMR controller", profile_path, XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Menu click", user_path, user_path + "/input/menu/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
@ -84,11 +88,11 @@ void OpenXRWMRControllerExtension::on_register_metadata() {
|
||||
|
||||
{ // Samsung Odyssey controller
|
||||
const String profile_path = "/interaction_profiles/samsung/odyssey_controller";
|
||||
openxr_metadata->register_interaction_profile("Samsung Odyssey controller", profile_path, XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME);
|
||||
openxr_metadata->register_interaction_profile("Samsung Odyssey controller", profile_path, XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME "," XR_OPENXR_1_1_NAME);
|
||||
for (const String user_path : { "/user/hand/left", "/user/hand/right" }) {
|
||||
openxr_metadata->register_io_path(profile_path, "Grip pose", user_path, user_path + "/input/grip/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Menu click", user_path, user_path + "/input/menu/click", "", OpenXRAction::OPENXR_ACTION_BOOL);
|
||||
|
||||
@ -125,7 +129,7 @@ void OpenXRWMRControllerExtension::on_register_metadata() {
|
||||
openxr_metadata->register_io_path(profile_path, "Aim pose", user_path, user_path + "/input/aim/pose", "", OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Pinch pose", user_path, user_path + "/input/pinch_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Poke pose", user_path, user_path + "/input/poke_ext/pose", XR_EXT_HAND_INTERACTION_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Palm pose", user_path, user_path + "/input/palm_ext/pose", XR_EXT_PALM_POSE_EXTENSION_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
openxr_metadata->register_io_path(profile_path, "Grip surface pose", user_path, user_path + "/input/grip_surface/pose", XR_EXT_PALM_POSE_EXTENSION_NAME "," XR_KHR_MAINTENANCE1_EXTENSION_NAME "," XR_OPENXR_1_1_NAME, OpenXRAction::OPENXR_ACTION_POSE);
|
||||
|
||||
openxr_metadata->register_io_path(profile_path, "Select (pinch)", user_path, user_path + "/input/select/value", "", OpenXRAction::OPENXR_ACTION_FLOAT);
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ public:
|
||||
WMR_MAX_CONTROLLERS
|
||||
};
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
bool is_available(WMRControllers p_type);
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ OpenXRAndroidExtension::OpenXRAndroidExtension() {
|
||||
activity_object = env->NewGlobalRef(static_cast<OS_Android *>(OS::get_singleton())->get_godot_java()->get_activity());
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRAndroidExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRAndroidExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
// XR_KHR_LOADER_INIT_EXTENSION_NAME is a dependency of XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME
|
||||
@ -87,7 +87,7 @@ void OpenXRAndroidExtension::on_before_instance_created() {
|
||||
// This is reasonably safe as the struct is only used during initialization and the extension is a singleton.
|
||||
static XrInstanceCreateInfoAndroidKHR instance_create_info;
|
||||
|
||||
void *OpenXRAndroidExtension::set_instance_create_info_and_get_next_pointer(void *p_next_pointer) {
|
||||
void *OpenXRAndroidExtension::set_instance_create_info_and_get_next_pointer(XrVersion p_xr_version, void *p_next_pointer) {
|
||||
if (!create_instance_extension_available) {
|
||||
if (!loader_init_android_extension_available) {
|
||||
WARN_PRINT("No Android extensions available, couldn't pass JVM and Activity to OpenXR");
|
||||
|
||||
@ -41,9 +41,9 @@ public:
|
||||
|
||||
OpenXRAndroidExtension();
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
virtual void on_before_instance_created() override;
|
||||
virtual void *set_instance_create_info_and_get_next_pointer(void *p_next_pointer) override;
|
||||
virtual void *set_instance_create_info_and_get_next_pointer(XrVersion p_xr_version, void *p_next_pointer) override;
|
||||
|
||||
virtual ~OpenXRAndroidExtension() override;
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
#include "servers/rendering/rendering_server_globals.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRD3D12Extension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRD3D12Extension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_KHR_D3D12_ENABLE_EXTENSION_NAME] = nullptr;
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
class OpenXRD3D12Extension : public OpenXRGraphicsExtensionWrapper, D3D12Hooks {
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void *set_session_create_and_get_next_pointer(void *p_next_pointer) override;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
class OpenXRMetalExtension : public OpenXRGraphicsExtensionWrapper {
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void *set_session_create_and_get_next_pointer(void *p_next_pointer) override;
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#import "drivers/metal/rendering_device_driver_metal.h"
|
||||
#include "servers/rendering/rendering_server_globals.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRMetalExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRMetalExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_KHR_METAL_ENABLE_EXTENSION_NAME] = nullptr;
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
// feature off.
|
||||
// See: https://registry.khronos.org/OpenGL/extensions/EXT/EXT_sRGB_write_control.txt
|
||||
|
||||
HashMap<String, bool *> OpenXROpenGLExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXROpenGLExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
#ifdef ANDROID_ENABLED
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
class OpenXROpenGLExtension : public OpenXRGraphicsExtensionWrapper {
|
||||
public:
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void *set_session_create_and_get_next_pointer(void *p_next_pointer) override;
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
#include "servers/rendering/rendering_server_globals.h"
|
||||
|
||||
HashMap<String, bool *> OpenXRVulkanExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRVulkanExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
request_extensions[XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME] = nullptr; // must be available
|
||||
|
||||
@ -45,7 +45,7 @@ public:
|
||||
OpenXRVulkanExtension() = default;
|
||||
virtual ~OpenXRVulkanExtension() override = default;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void *set_session_create_and_get_next_pointer(void *p_next_pointer) override;
|
||||
|
||||
@ -332,7 +332,7 @@ void OpenXRSpatialAnchorCapability::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(PERSISTENCE_SCOPE_LOCAL_ANCHORS);
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRSpatialAnchorCapability::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRSpatialAnchorCapability::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
if (GLOBAL_GET_CACHED(bool, "xr/openxr/extensions/spatial_entity/enabled") && GLOBAL_GET_CACHED(bool, "xr/openxr/extensions/spatial_entity/enable_spatial_anchors")) {
|
||||
|
||||
@ -158,7 +158,7 @@ public:
|
||||
OpenXRSpatialAnchorCapability();
|
||||
virtual ~OpenXRSpatialAnchorCapability() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -106,7 +106,7 @@ OpenXRSpatialEntityExtension::~OpenXRSpatialEntityExtension() {
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRSpatialEntityExtension::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRSpatialEntityExtension::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
if (GLOBAL_GET_CACHED(bool, "xr/openxr/extensions/spatial_entity/enabled")) {
|
||||
|
||||
@ -69,7 +69,7 @@ public:
|
||||
OpenXRSpatialEntityExtension();
|
||||
virtual ~OpenXRSpatialEntityExtension() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_instance_created(const XrInstance p_instance) override;
|
||||
virtual void on_instance_destroyed() override;
|
||||
|
||||
@ -444,7 +444,7 @@ void OpenXRSpatialMarkerTrackingCapability::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("is_april_tag_supported"), &OpenXRSpatialMarkerTrackingCapability::is_april_tag_supported);
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRSpatialMarkerTrackingCapability::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRSpatialMarkerTrackingCapability::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
if (GLOBAL_GET_CACHED(bool, "xr/openxr/extensions/spatial_entity/enabled") && GLOBAL_GET_CACHED(bool, "xr/openxr/extensions/spatial_entity/enable_marker_tracking")) {
|
||||
|
||||
@ -228,7 +228,7 @@ public:
|
||||
OpenXRSpatialMarkerTrackingCapability();
|
||||
virtual ~OpenXRSpatialMarkerTrackingCapability() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_session_created(const XrSession p_session) override;
|
||||
virtual void on_session_destroyed() override;
|
||||
|
||||
@ -583,7 +583,7 @@ void OpenXRSpatialPlaneTrackingCapability::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("is_supported"), &OpenXRSpatialPlaneTrackingCapability::is_supported);
|
||||
}
|
||||
|
||||
HashMap<String, bool *> OpenXRSpatialPlaneTrackingCapability::get_requested_extensions() {
|
||||
HashMap<String, bool *> OpenXRSpatialPlaneTrackingCapability::get_requested_extensions(XrVersion p_version) {
|
||||
HashMap<String, bool *> request_extensions;
|
||||
|
||||
if (GLOBAL_GET_CACHED(bool, "xr/openxr/extensions/spatial_entity/enabled") && GLOBAL_GET_CACHED(bool, "xr/openxr/extensions/spatial_entity/enable_plane_tracking")) {
|
||||
|
||||
@ -219,7 +219,7 @@ public:
|
||||
OpenXRSpatialPlaneTrackingCapability();
|
||||
virtual ~OpenXRSpatialPlaneTrackingCapability() override;
|
||||
|
||||
virtual HashMap<String, bool *> get_requested_extensions() override;
|
||||
virtual HashMap<String, bool *> get_requested_extensions(XrVersion p_version) override;
|
||||
|
||||
virtual void on_session_created(const XrSession p_session) override;
|
||||
virtual void on_session_destroyed() override;
|
||||
|
||||
Reference in New Issue
Block a user