refactor: move hand debug gizmos into bevy_mod_xr
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -930,6 +930,7 @@ version = "0.2.1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"bevy_mod_openxr",
|
"bevy_mod_openxr",
|
||||||
|
"bevy_mod_xr",
|
||||||
"bevy_xr_utils",
|
"bevy_xr_utils",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"zip",
|
"zip",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ fn main() -> AppExit {
|
|||||||
]),
|
]),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.add_plugins(bevy_xr_utils::hand_gizmos::HandGizmosPlugin)
|
.add_plugins(bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin)
|
||||||
.add_systems(Startup, setup)
|
.add_systems(Startup, setup)
|
||||||
.insert_resource(ClearColor(Color::NONE))
|
.insert_resource(ClearColor(Color::NONE))
|
||||||
.run()
|
.run()
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ publish = false
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
bevy_mod_openxr.workspace = true
|
bevy_mod_openxr.workspace = true
|
||||||
bevy_xr_utils.workspace = true
|
bevy_xr_utils.workspace = true
|
||||||
|
bevy_mod_xr.workspace = true
|
||||||
bevy = { workspace = true, default-features = false, features = [
|
bevy = { workspace = true, default-features = false, features = [
|
||||||
# Bevy 0.15 made GameActivity the default which breaks Quest builds
|
# Bevy 0.15 made GameActivity the default which breaks Quest builds
|
||||||
# To use NativeActivity instead of GameActivity all of the features have to be listed manually
|
# To use NativeActivity instead of GameActivity all of the features have to be listed manually
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ fn main() {
|
|||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
}))
|
}))
|
||||||
.add_plugins(bevy_xr_utils::hand_gizmos::HandGizmosPlugin)
|
.add_plugins(bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin)
|
||||||
.add_systems(Startup, setup)
|
.add_systems(Startup, setup)
|
||||||
.add_systems(Update, modify_msaa)
|
.add_systems(Update, modify_msaa)
|
||||||
.insert_resource(AmbientLight {
|
.insert_resource(AmbientLight {
|
||||||
|
|||||||
@@ -16,9 +16,10 @@ use bevy_mod_xr::{
|
|||||||
};
|
};
|
||||||
use openxr::Posef;
|
use openxr::Posef;
|
||||||
|
|
||||||
fn main() {
|
fn main() -> AppExit {
|
||||||
let mut app = App::new();
|
let mut app = App::new();
|
||||||
app.add_plugins(add_xr_plugins(DefaultPlugins));
|
app.add_plugins(add_xr_plugins(DefaultPlugins));
|
||||||
|
app.add_plugins(bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin);
|
||||||
app.add_systems(XrSessionCreated, spawn_hands);
|
app.add_systems(XrSessionCreated, spawn_hands);
|
||||||
app.add_systems(XrSessionCreated, attach_set);
|
app.add_systems(XrSessionCreated, attach_set);
|
||||||
app.add_systems(
|
app.add_systems(
|
||||||
@@ -31,7 +32,7 @@ fn main() {
|
|||||||
app.add_systems(Startup, create_actions.run_if(session_available));
|
app.add_systems(Startup, create_actions.run_if(session_available));
|
||||||
app.add_systems(Startup, setup);
|
app.add_systems(Startup, setup);
|
||||||
|
|
||||||
app.run();
|
app.run()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attach_set(actions: Res<ControllerActions>, mut attach: EventWriter<OxrAttachActionSet>) {
|
fn attach_set(actions: Res<ControllerActions>, mut attach: EventWriter<OxrAttachActionSet>) {
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ use bevy::prelude::*;
|
|||||||
use bevy_mod_openxr::{action_binding::OxrSendActionBindings, add_xr_plugins};
|
use bevy_mod_openxr::{action_binding::OxrSendActionBindings, add_xr_plugins};
|
||||||
use bevy_mod_xr::session::{XrSessionCreated, XrTracker};
|
use bevy_mod_xr::session::{XrSessionCreated, XrTracker};
|
||||||
use bevy_xr_utils::tracking_utils::{
|
use bevy_xr_utils::tracking_utils::{
|
||||||
suggest_action_bindings, TrackingUtilitiesPlugin, XrTrackedLeftGrip, XrTrackedLocalFloor, XrTrackedRightGrip, XrTrackedStage, XrTrackedView
|
suggest_action_bindings, TrackingUtilitiesPlugin, XrTrackedLeftGrip, XrTrackedLocalFloor,
|
||||||
|
XrTrackedRightGrip, XrTrackedStage, XrTrackedView,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut app = App::new();
|
let mut app = App::new();
|
||||||
app.add_plugins(add_xr_plugins(DefaultPlugins));
|
app.add_plugins(add_xr_plugins(DefaultPlugins));
|
||||||
|
app.add_plugins(bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin);
|
||||||
app.add_systems(Startup, setup);
|
app.add_systems(Startup, setup);
|
||||||
|
|
||||||
//things?
|
//things?
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ use bevy_xr_utils::xr_utils_actions::{
|
|||||||
XRUtilsActionsPlugin, XRUtilsBinding,
|
XRUtilsActionsPlugin, XRUtilsBinding,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() -> AppExit {
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins(add_xr_plugins(DefaultPlugins))
|
.add_plugins(add_xr_plugins(DefaultPlugins))
|
||||||
.add_plugins(bevy_xr_utils::hand_gizmos::HandGizmosPlugin)
|
.add_plugins(bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin)
|
||||||
.add_plugins(transform_utils::TransformUtilitiesPlugin)
|
.add_plugins(transform_utils::TransformUtilitiesPlugin)
|
||||||
.add_systems(Startup, setup)
|
.add_systems(Startup, setup)
|
||||||
.add_plugins(XRUtilsActionsPlugin)
|
.add_plugins(XRUtilsActionsPlugin)
|
||||||
@@ -31,7 +31,7 @@ fn main() {
|
|||||||
brightness: 500.0,
|
brightness: 500.0,
|
||||||
..AmbientLight::default()
|
..AmbientLight::default()
|
||||||
})
|
})
|
||||||
.run();
|
.run()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// set up a simple 3D scene
|
/// set up a simple 3D scene
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use crate::error::OxrError;
|
use crate::error::OxrError;
|
||||||
use crate::graphics::{GraphicsExt, GraphicsType, GraphicsWrap};
|
use crate::graphics::GraphicsExt;
|
||||||
|
|
||||||
pub use crate::openxr::exts::OxrExtensions;
|
pub use crate::openxr::exts::OxrExtensions;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
use crate::hands::{HandBone, XrHandBoneRadius};
|
||||||
|
use crate::spaces::XrSpaceLocationFlags;
|
||||||
use bevy::color::palettes::css;
|
use bevy::color::palettes::css;
|
||||||
use bevy::{prelude::*, transform::TransformSystem};
|
use bevy::{prelude::*, transform::TransformSystem};
|
||||||
use bevy_mod_xr::hands::{HandBone, XrHandBoneRadius};
|
|
||||||
use bevy_mod_xr::spaces::XrSpaceLocationFlags;
|
|
||||||
pub struct HandGizmosPlugin;
|
pub struct HandGizmosPlugin;
|
||||||
impl Plugin for HandGizmosPlugin {
|
impl Plugin for HandGizmosPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
@@ -4,3 +4,4 @@ pub mod hands;
|
|||||||
pub mod session;
|
pub mod session;
|
||||||
pub mod types;
|
pub mod types;
|
||||||
pub mod spaces;
|
pub mod spaces;
|
||||||
|
pub mod hand_debug_gizmos;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
pub mod hand_gizmos;
|
|
||||||
#[cfg(not(target_family = "wasm"))]
|
#[cfg(not(target_family = "wasm"))]
|
||||||
pub mod tracking_utils;
|
pub mod tracking_utils;
|
||||||
#[cfg(not(target_family = "wasm"))]
|
#[cfg(not(target_family = "wasm"))]
|
||||||
|
|||||||
Reference in New Issue
Block a user