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.
|
//! A simple 3D scene with light shining over a cube sitting on a plane.
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_mod_openxr::add_xr_plugins;
|
use bevy_mod_openxr::{action_binding::OxrSendActionBindings, add_xr_plugins};
|
||||||
use bevy_mod_xr::session::{XrSessionCreated, XrTrackingRoot};
|
use bevy_mod_xr::session::XrSessionCreated;
|
||||||
use bevy_xr_utils::tracking_utils::{
|
use bevy_xr_utils::tracking_utils::{
|
||||||
TrackingUtilitiesPlugin, XrTrackedLeftGrip, XrTrackedLocalFloor, XrTrackedRightGrip,
|
suggest_action_bindings, TrackingUtilitiesPlugin, XrTrackedLeftGrip, XrTrackedLocalFloor, XrTrackedRightGrip, XrTrackedStage, XrTrackedView
|
||||||
XrTrackedStage, XrTrackedView,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -18,6 +17,8 @@ fn main() {
|
|||||||
|
|
||||||
//tracking utils plugin
|
//tracking utils plugin
|
||||||
app.add_plugins(TrackingUtilitiesPlugin);
|
app.add_plugins(TrackingUtilitiesPlugin);
|
||||||
|
//default bindings only use for prototyping
|
||||||
|
app.add_systems(OxrSendActionBindings, suggest_action_bindings);
|
||||||
|
|
||||||
app.run();
|
app.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ impl Plugin for TrackingUtilitiesPlugin {
|
|||||||
);
|
);
|
||||||
|
|
||||||
//bindings
|
//bindings
|
||||||
app.add_systems(OxrSendActionBindings, suggest_action_bindings);
|
// app.add_systems(OxrSendActionBindings, suggest_action_bindings);
|
||||||
//sync actions
|
//sync actions
|
||||||
app.add_systems(
|
app.add_systems(
|
||||||
PreUpdate,
|
PreUpdate,
|
||||||
@@ -200,10 +200,10 @@ fn update_right_grip(
|
|||||||
|
|
||||||
//tracking rig
|
//tracking rig
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
struct ControllerActions {
|
pub struct ControllerActions {
|
||||||
set: openxr::ActionSet,
|
pub set: openxr::ActionSet,
|
||||||
left: openxr::Action<Posef>,
|
pub left: openxr::Action<Posef>,
|
||||||
right: openxr::Action<Posef>,
|
pub right: openxr::Action<Posef>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn spawn_tracking_rig(
|
fn spawn_tracking_rig(
|
||||||
@@ -240,7 +240,7 @@ fn spawn_tracking_rig(
|
|||||||
|
|
||||||
//bindings
|
//bindings
|
||||||
//TODO figure out how to make these better, specifically not be controller specific
|
//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>,
|
actions: Res<ControllerActions>,
|
||||||
mut bindings: EventWriter<OxrSuggestActionBinding>,
|
mut bindings: EventWriter<OxrSuggestActionBinding>,
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user