Skip to content

Commit

Permalink
Merge pull request #164 from awtterpip/remove_default_bindings
Browse files Browse the repository at this point in the history
Remove default bindings
  • Loading branch information
Schmarni-Dev authored Dec 4, 2024
2 parents 690b433 + 5b7db58 commit aa97263
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions crates/bevy_openxr/examples/tracking_utils.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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();
}
Expand Down
12 changes: 6 additions & 6 deletions crates/bevy_xr_utils/src/tracking_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -200,10 +200,10 @@ fn update_right_grip(

//tracking rig
#[derive(Resource)]
struct ControllerActions {
set: openxr::ActionSet,
left: openxr::Action<Posef>,
right: openxr::Action<Posef>,
pub struct ControllerActions {
pub set: openxr::ActionSet,
pub left: openxr::Action<Posef>,
pub right: openxr::Action<Posef>,
}

fn spawn_tracking_rig(
Expand Down Expand Up @@ -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<ControllerActions>,
mut bindings: EventWriter<OxrSuggestActionBinding>,
) {
Expand Down

0 comments on commit aa97263

Please # to comment.