From c0be012b9dcc6a501a87aff9b7eafb3d886d8c9e Mon Sep 17 00:00:00 2001 From: ForTehLose Date: Wed, 4 Dec 2024 13:51:43 -0500 Subject: [PATCH 1/3] moved default bindings for tracking utils into a pub function for prototyping, while I work on better solution --- crates/bevy_openxr/examples/tracking_utils.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/bevy_openxr/examples/tracking_utils.rs b/crates/bevy_openxr/examples/tracking_utils.rs index 7f79a54..c159d38 100644 --- a/crates/bevy_openxr/examples/tracking_utils.rs +++ b/crates/bevy_openxr/examples/tracking_utils.rs @@ -1,11 +1,10 @@ //! A simple 3D scene with light shining over a cube sitting on a plane. use bevy::prelude::*; -use bevy_mod_openxr::add_xr_plugins; -use bevy_mod_xr::session::{XrSessionCreated, XrTrackingRoot}; +use bevy_mod_openxr::{action_binding::OxrSendActionBindings, add_xr_plugins}; +use bevy_mod_xr::session::XrSessionCreated; use bevy_xr_utils::tracking_utils::{ - TrackingUtilitiesPlugin, XrTrackedLeftGrip, XrTrackedLocalFloor, XrTrackedRightGrip, - XrTrackedStage, XrTrackedView, + suggest_action_bindings, TrackingUtilitiesPlugin, XrTrackedLeftGrip, XrTrackedLocalFloor, XrTrackedRightGrip, XrTrackedStage, XrTrackedView }; fn main() { @@ -18,6 +17,8 @@ fn main() { //tracking utils plugin app.add_plugins(TrackingUtilitiesPlugin); + //default bindings only use for prototyping + app.add_systems(OxrSendActionBindings, suggest_action_bindings); app.run(); } From a260443a0d5dfba90449ded1b249b0b8992723e0 Mon Sep 17 00:00:00 2001 From: ForTehLose Date: Wed, 4 Dec 2024 13:55:27 -0500 Subject: [PATCH 2/3] adding a missed change --- crates/bevy_xr_utils/src/tracking_utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_xr_utils/src/tracking_utils.rs b/crates/bevy_xr_utils/src/tracking_utils.rs index e5a77ed..7019d32 100644 --- a/crates/bevy_xr_utils/src/tracking_utils.rs +++ b/crates/bevy_xr_utils/src/tracking_utils.rs @@ -54,7 +54,7 @@ impl Plugin for TrackingUtilitiesPlugin { ); //bindings - app.add_systems(OxrSendActionBindings, suggest_action_bindings); + // app.add_systems(OxrSendActionBindings, suggest_action_bindings); //sync actions app.add_systems( PreUpdate, @@ -200,7 +200,7 @@ fn update_right_grip( //tracking rig #[derive(Resource)] -struct ControllerActions { +pub struct ControllerActions { set: openxr::ActionSet, left: openxr::Action, right: openxr::Action, @@ -240,7 +240,7 @@ fn spawn_tracking_rig( //bindings //TODO figure out how to make these better, specifically not be controller specific -fn suggest_action_bindings( +pub fn suggest_action_bindings( actions: Res, mut bindings: EventWriter, ) { From 5b7db58fe6874370a3b8b832145b3f06ff3f3036 Mon Sep 17 00:00:00 2001 From: ForTehLose Date: Wed, 4 Dec 2024 14:03:31 -0500 Subject: [PATCH 3/3] making controller actions fields pub so users can use them --- crates/bevy_xr_utils/src/tracking_utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_xr_utils/src/tracking_utils.rs b/crates/bevy_xr_utils/src/tracking_utils.rs index 7019d32..5f16730 100644 --- a/crates/bevy_xr_utils/src/tracking_utils.rs +++ b/crates/bevy_xr_utils/src/tracking_utils.rs @@ -201,9 +201,9 @@ fn update_right_grip( //tracking rig #[derive(Resource)] pub struct ControllerActions { - set: openxr::ActionSet, - left: openxr::Action, - right: openxr::Action, + pub set: openxr::ActionSet, + pub left: openxr::Action, + pub right: openxr::Action, } fn spawn_tracking_rig(