Merge pull request #164 from awtterpip/remove_default_bindings
Remove default bindings
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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<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(
|
||||
@@ -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>,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user