commit xr_input module

This commit is contained in:
Schmarni
2023-11-16 02:52:27 +01:00
parent e20c38c5db
commit 53ba18c157

View File

@@ -1,27 +1,30 @@
pub mod controllers; pub mod controllers;
pub mod debug_gizmos; pub mod debug_gizmos;
pub mod hand;
pub mod hand_poses;
pub mod hands;
pub mod handtracking;
pub mod interactions; pub mod interactions;
pub mod oculus_touch; pub mod oculus_touch;
pub mod prototype_locomotion; pub mod prototype_locomotion;
pub mod trackers; pub mod trackers;
pub mod xr_camera; pub mod xr_camera;
pub mod hand_poses; pub mod actions;
pub mod hand;
pub mod handtracking;
pub mod hands;
use crate::resources::XrSession; use crate::resources::{XrInstance, XrSession};
use crate::xr_begin_frame; use crate::xr_begin_frame;
use crate::xr_input::controllers::XrControllerType; use crate::xr_input::controllers::XrControllerType;
use crate::xr_input::oculus_touch::{setup_oculus_controller, ActionSets}; use crate::xr_input::oculus_touch::{setup_oculus_controller, ActionSets};
use crate::xr_input::xr_camera::{xr_camera_head_sync, Eye, XRProjection, XrCameraBundle}; use crate::xr_input::xr_camera::{xr_camera_head_sync, Eye, XRProjection, XrCameraBundle};
use bevy::app::{App, PostUpdate, Startup}; use bevy::app::{App, PostUpdate, Startup};
use bevy::log::warn; use bevy::log::warn;
use bevy::prelude::{BuildChildren, IntoSystemConfigs, Component}; use bevy::prelude::{BuildChildren, Component, Deref, DerefMut, IntoSystemConfigs, Resource};
use bevy::prelude::{Commands, Plugin, PreUpdate, Quat, Res, SpatialBundle, Update, Vec3}; use bevy::prelude::{Commands, Plugin, PreUpdate, Quat, Res, SpatialBundle, Update, Vec3};
use bevy::render::camera::CameraProjectionPlugin; use bevy::render::camera::CameraProjectionPlugin;
use bevy::render::view::{update_frusta, VisibilitySystems}; use bevy::render::view::{update_frusta, VisibilitySystems};
use bevy::transform::TransformSystem; use bevy::transform::TransformSystem;
use bevy::utils::HashMap;
use openxr::Binding;
use self::trackers::{ use self::trackers::{
adopt_open_xr_trackers, update_open_xr_controllers, OpenXRLeftEye, OpenXRRightEye, adopt_open_xr_trackers, update_open_xr_controllers, OpenXRLeftEye, OpenXRRightEye,
@@ -68,6 +71,17 @@ impl Plugin for OpenXrInput {
} }
} }
#[derive(Deref, DerefMut, Resource)]
pub struct InteractionProfileBindings(pub HashMap<&'static str, Vec<Binding<'static>>>);
fn setup_binding_recommendations(
mut commands: Commands,
instance: Res<XrInstance>,
bindings: Res<InteractionProfileBindings>,
) {
commands.remove_resource::<InteractionProfileBindings>();
}
fn setup_xr_cameras(mut commands: Commands) { fn setup_xr_cameras(mut commands: Commands) {
//this needs to do the whole xr tracking volume not just cameras //this needs to do the whole xr tracking volume not just cameras
//get the root? //get the root?