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(); } diff --git a/crates/bevy_xr_utils/src/tracking_utils.rs b/crates/bevy_xr_utils/src/tracking_utils.rs index e5a77ed..5f16730 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,10 +200,10 @@ fn update_right_grip( //tracking rig #[derive(Resource)] -struct ControllerActions { - set: openxr::ActionSet, - left: openxr::Action, - right: openxr::Action, +pub struct ControllerActions { + pub set: openxr::ActionSet, + pub left: openxr::Action, + pub right: openxr::Action, } fn spawn_tracking_rig( @@ -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, ) {