From 9043ebeb4d06427e0fea91832d6228d15dfced23 Mon Sep 17 00:00:00 2001 From: Jay Christy Date: Tue, 19 Sep 2023 23:13:37 -0400 Subject: [PATCH] first pass i think --- examples/xr.rs | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/examples/xr.rs b/examples/xr.rs index f6459ee..64ae62a 100644 --- a/examples/xr.rs +++ b/examples/xr.rs @@ -2,10 +2,10 @@ use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; use bevy::prelude::*; use bevy::transform::components::Transform; use bevy_openxr::input::XrInput; -use bevy_openxr::resources::{XrFrameState, XrInstance, XrSession}; +use bevy_openxr::resources::{XrFrameState, XrInstance, XrSession, XrViews}; use bevy_openxr::xr_input::debug_gizmos::OpenXrDebugRenderer; use bevy_openxr::xr_input::oculus_touch::OculusController; -use bevy_openxr::xr_input::{Hand, TrackingRoot}; +use bevy_openxr::xr_input::{Hand, QuatConv, TrackingRoot}; use bevy_openxr::DefaultXrPlugins; fn main() { @@ -41,13 +41,13 @@ fn setup( transform: Transform::from_xyz(0.0, 0.5, 0.0), ..default() }); - // cube - commands.spawn(PbrBundle { - mesh: meshes.add(Mesh::from(shape::Cube { size: 0.1 })), - material: materials.add(Color::rgb(0.8, 0.0, 0.0).into()), - transform: Transform::from_xyz(0.0, 0.5, 1.0), - ..default() - }); + // cube + commands.spawn(PbrBundle { + mesh: meshes.add(Mesh::from(shape::Cube { size: 0.1 })), + material: materials.add(Color::rgb(0.8, 0.0, 0.0).into()), + transform: Transform::from_xyz(0.0, 0.5, 1.0), + ..default() + }); // light commands.spawn(PointLightBundle { point_light: PointLight { @@ -65,6 +65,11 @@ fn setup( },)); } +pub enum LocomotionType { + Head, + Hand, +} + fn proto_locomotion( time: Res