1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

OpenXR: Add access to session state and change interaction profile update.

This commit is contained in:
Bastiaan Olij
2025-06-17 17:36:38 +10:00
parent 46c495ca21
commit df06aa8392
5 changed files with 104 additions and 13 deletions

View File

@@ -209,6 +209,7 @@ public:
void on_state_ready();
void on_state_visible();
void on_state_focused();
void on_state_synchronized();
void on_state_stopping();
void on_state_loss_pending();
void on_state_exiting();
@@ -216,6 +217,21 @@ public:
void on_refresh_rate_changes(float p_new_rate);
void tracker_profile_changed(RID p_tracker, RID p_interaction_profile);
/** Session */
enum OpenXrSessionState { // Should mirror XrSessionState
OPENXR_SESSION_STATE_UNKNOWN = 0,
OPENXR_SESSION_STATE_IDLE = 1,
OPENXR_SESSION_STATE_READY = 2,
OPENXR_SESSION_STATE_SYNCHRONIZED = 3,
OPENXR_SESSION_STATE_VISIBLE = 4,
OPENXR_SESSION_STATE_FOCUSED = 5,
OPENXR_SESSION_STATE_STOPPING = 6,
OPENXR_SESSION_STATE_LOSS_PENDING = 7,
OPENXR_SESSION_STATE_EXITING = 8,
};
OpenXrSessionState get_session_state();
/** Hand tracking. */
enum Hand {
HAND_LEFT,
@@ -321,6 +337,7 @@ public:
~OpenXRInterface();
};
VARIANT_ENUM_CAST(OpenXRInterface::OpenXrSessionState)
VARIANT_ENUM_CAST(OpenXRInterface::Hand)
VARIANT_ENUM_CAST(OpenXRInterface::HandMotionRange)
VARIANT_ENUM_CAST(OpenXRInterface::HandTrackedSource)