diff --git a/examples/xr.rs b/examples/xr.rs index 35d766a..f6459ee 100644 --- a/examples/xr.rs +++ b/examples/xr.rs @@ -1,7 +1,11 @@ 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::xr_input::debug_gizmos::OpenXrDebugRenderer; +use bevy_openxr::xr_input::oculus_touch::OculusController; +use bevy_openxr::xr_input::{Hand, TrackingRoot}; use bevy_openxr::DefaultXrPlugins; fn main() { @@ -14,6 +18,7 @@ fn main() { .add_plugins(LogDiagnosticsPlugin::default()) .add_plugins(FrameTimeDiagnosticsPlugin) .add_systems(Startup, setup) + .add_systems(Update, proto_locomotion) .run(); } @@ -36,6 +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() + }); // light commands.spawn(PointLightBundle { point_light: PointLight { @@ -52,3 +64,29 @@ fn setup( ..default() },)); } + +fn proto_locomotion( + time: Res