add support for hand tracking and configurable reference spaces
This commit is contained in:
@@ -8,6 +8,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
bevy_openxr.path = "../.."
|
||||
bevy.workspace = true
|
||||
bevy_xr_utils.path = "../../../bevy_xr_utils"
|
||||
|
||||
|
||||
[lib]
|
||||
|
||||
@@ -1,12 +1,31 @@
|
||||
//! A simple 3D scene with light shining over a cube sitting on a plane.
|
||||
|
||||
use bevy::prelude::*;
|
||||
use bevy_openxr::add_xr_plugins;
|
||||
use bevy_openxr::{
|
||||
add_xr_plugins, features::handtracking::HandTrackingPlugin, init::OxrInitPlugin,
|
||||
reference_space::OxrReferenceSpacePlugin, types::OxrExtensions,
|
||||
};
|
||||
|
||||
#[bevy_main]
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins(add_xr_plugins(DefaultPlugins))
|
||||
.add_plugins(add_xr_plugins(DefaultPlugins).set(OxrInitPlugin {
|
||||
app_info: default(),
|
||||
exts: {
|
||||
let mut exts = OxrExtensions::default();
|
||||
exts.enable_fb_passthrough();
|
||||
exts.enable_hand_tracking();
|
||||
exts
|
||||
},
|
||||
blend_modes: default(),
|
||||
backends: default(),
|
||||
formats: default(),
|
||||
resolutions: default(),
|
||||
synchronous_pipeline_compilation: default(),
|
||||
}))
|
||||
.add_plugins(HandTrackingPlugin::default())
|
||||
.add_plugins(OxrReferenceSpacePlugin::default())
|
||||
.add_plugins(bevy_xr_utils::hand_gizmos::HandGizmosPlugin)
|
||||
.add_systems(Startup, setup)
|
||||
.insert_resource(ClearColor(Color::NONE))
|
||||
.run();
|
||||
|
||||
Reference in New Issue
Block a user