From eba802290d1bb05c6f8d01be30d448e799dc2da5 Mon Sep 17 00:00:00 2001 From: Charlton Rodda Date: Sat, 11 Nov 2023 05:41:10 +0000 Subject: [PATCH] Spawn controllers --- skills/openxr-6dof/src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/skills/openxr-6dof/src/lib.rs b/skills/openxr-6dof/src/lib.rs index c88f54f..9289b9a 100644 --- a/skills/openxr-6dof/src/lib.rs +++ b/skills/openxr-6dof/src/lib.rs @@ -6,6 +6,9 @@ use bevy_oxr::resources::XrFrameState; use bevy_oxr::xr_input::oculus_touch::OculusController; use bevy_oxr::xr_input::{QuatConv, Vec3Conv}; use bevy_oxr::DefaultXrPlugins; +use bevy_oxr::xr_input::trackers::{ + OpenXRController, OpenXRLeftController, OpenXRRightController, OpenXRTracker, +}; #[bevy_main] pub fn main() { @@ -55,6 +58,21 @@ fn setup( transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y), ..default() },)); + //left hand + commands.spawn(( + OpenXRLeftController, + OpenXRController, + OpenXRTracker, + SpatialBundle::default(), + )); + //right hand + commands.spawn(( + OpenXRRightController, + OpenXRController, + OpenXRTracker, + SpatialBundle::default(), + )); + } fn hands(