@@ -4,8 +4,7 @@ use bevy::prelude::*;
|
||||
use bevy_mod_openxr::add_xr_plugins;
|
||||
use bevy_mod_xr::session::{XrSessionCreated, XrTracker};
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,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,
|
||||
@@ -190,10 +190,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(
|
||||
@@ -225,7 +225,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