summaryrefslogtreecommitdiffstats
path: root/modules/openxr/openxr_api.h
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2022-04-17 12:58:09 +1000
committerBastiaan Olij <mux213@gmail.com>2022-09-26 19:47:06 +1000
commit23d32c0e166b19011f816431a4705e43d6c41eb2 (patch)
treeb0b5157bdd2397a0e3047a41a264d141c623267b /modules/openxr/openxr_api.h
parent3472bdd6b6dd7c085b716caabdda16f88e6f167e (diff)
downloadredot-engine-23d32c0e166b19011f816431a4705e43d6c41eb2.tar.gz
Adding OpenXR hand tracking support
Diffstat (limited to 'modules/openxr/openxr_api.h')
-rw-r--r--modules/openxr/openxr_api.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/openxr/openxr_api.h b/modules/openxr/openxr_api.h
index 4f84cc3b5b..fd32c2633e 100644
--- a/modules/openxr/openxr_api.h
+++ b/modules/openxr/openxr_api.h
@@ -102,7 +102,7 @@ private:
XrFormFactor form_factor = XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY;
XrViewConfigurationType view_configuration = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
XrReferenceSpaceType reference_space = XR_REFERENCE_SPACE_TYPE_STAGE;
- XrEnvironmentBlendMode environment_blend_mode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE;
+ // XrEnvironmentBlendMode environment_blend_mode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE;
// state
XrInstance instance = XR_NULL_HANDLE;
@@ -139,7 +139,10 @@ private:
bool openxr_loader_init();
bool resolve_instance_openxr_symbols();
+#ifdef ANDROID_ENABLED
+ // On Android we keep tracker of our external OpenXR loader
void *openxr_loader_library_handle = nullptr;
+#endif
// function pointers
#ifdef ANDROID_ENABLED
@@ -269,9 +272,7 @@ private:
// convencience
void copy_string_to_char_buffer(const String p_string, char *p_buffer, int p_buffer_len);
-protected:
- friend class OpenXRVulkanExtension;
-
+public:
XrInstance get_instance() const { return instance; };
XrSystemId get_system_id() const { return system_id; };
XrSession get_session() const { return session; };
@@ -284,7 +285,6 @@ protected:
XRPose::TrackingConfidence transform_from_location(const XrHandJointLocationEXT &p_location, Transform3D &r_transform);
void parse_velocities(const XrSpaceVelocity &p_velocity, Vector3 &r_linear_velocity, Vector3 &r_angular_velocity);
-public:
static bool openxr_is_enabled(bool p_check_run_in_editor = true);
static OpenXRAPI *get_singleton();
@@ -301,8 +301,9 @@ public:
bool initialize_session();
void finish();
- XrTime get_next_frame_time() { return frame_state.predictedDisplayTime + frame_state.predictedDisplayPeriod; };
- bool can_render() { return instance != XR_NULL_HANDLE && session != XR_NULL_HANDLE && running && view_pose_valid && frame_state.shouldRender; };
+ XrSpace get_play_space() const { return play_space; }
+ XrTime get_next_frame_time() { return frame_state.predictedDisplayTime + frame_state.predictedDisplayPeriod; }
+ bool can_render() { return instance != XR_NULL_HANDLE && session != XR_NULL_HANDLE && running && view_pose_valid && frame_state.shouldRender; }
Size2 get_recommended_target_size();
XRPose::TrackingConfidence get_head_center(Transform3D &r_transform, Vector3 &r_linear_velocity, Vector3 &r_angular_velocity);