refactored input again

This commit is contained in:
MalekiRe
2023-09-13 23:57:48 -07:00
parent efc0065307
commit 5363a2d382
7 changed files with 240 additions and 31 deletions

View File

@@ -6,15 +6,11 @@ use crate::resources::XrSession;
use crate::xr_begin_frame;
use crate::xr_input::controllers::XrControllerType;
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::log::warn;
use bevy::prelude::IntoSystemConfigs;
use bevy::prelude::{
Commands, Plugin, PreUpdate, Quat, Res, Vec3,
};
use bevy::prelude::{Commands, Plugin, PreUpdate, Quat, Res, Vec3};
use bevy::render::camera::CameraProjectionPlugin;
use bevy::render::view::{update_frusta, VisibilitySystems};
use bevy::transform::TransformSystem;
@@ -23,6 +19,11 @@ use bevy::transform::TransformSystem;
pub struct OpenXrInput {
pub controller_type: XrControllerType,
}
#[derive(Clone, Copy, Debug, Ord, PartialOrd, Eq, PartialEq)]
pub enum Hand {
Left,
Right,
}
impl OpenXrInput {
pub fn new(controller_type: XrControllerType) -> Self {
Self { controller_type }