renamed public components
This commit is contained in:
@@ -4,8 +4,8 @@ use bevy::prelude::*;
|
|||||||
use bevy_mod_openxr::add_xr_plugins;
|
use bevy_mod_openxr::add_xr_plugins;
|
||||||
use bevy_mod_xr::session::{XrSessionCreated, XrTrackingRoot};
|
use bevy_mod_xr::session::{XrSessionCreated, XrTrackingRoot};
|
||||||
use bevy_xr_utils::tracking_utils::{
|
use bevy_xr_utils::tracking_utils::{
|
||||||
TrackingUtilitiesPlugin, XRTrackedLeftGrip, XRTrackedLocalFloor, XRTrackedRightGrip,
|
TrackingUtilitiesPlugin, XrTrackedLeftGrip, XrTrackedLocalFloor, XrTrackedRightGrip,
|
||||||
XRTrackedStage, XRTrackedView,
|
XrTrackedStage, XrTrackedView,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -63,7 +63,7 @@ fn spawn_hands(
|
|||||||
transform: Transform::from_xyz(0.0, 0.5, 0.0),
|
transform: Transform::from_xyz(0.0, 0.5, 0.0),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
XRTrackedLeftGrip,
|
XrTrackedLeftGrip,
|
||||||
))
|
))
|
||||||
.id();
|
.id();
|
||||||
let bundle = (
|
let bundle = (
|
||||||
@@ -73,7 +73,7 @@ fn spawn_hands(
|
|||||||
transform: Transform::from_xyz(0.0, 0.5, 0.0),
|
transform: Transform::from_xyz(0.0, 0.5, 0.0),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
XRTrackedRightGrip,
|
XrTrackedRightGrip,
|
||||||
);
|
);
|
||||||
let right = cmds.spawn(bundle).id();
|
let right = cmds.spawn(bundle).id();
|
||||||
//head
|
//head
|
||||||
@@ -86,7 +86,7 @@ fn spawn_hands(
|
|||||||
transform: Transform::from_xyz(0.0, 0.0, 0.0),
|
transform: Transform::from_xyz(0.0, 0.0, 0.0),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
XRTrackedView,
|
XrTrackedView,
|
||||||
))
|
))
|
||||||
.id();
|
.id();
|
||||||
//local_floor emulated
|
//local_floor emulated
|
||||||
@@ -98,7 +98,7 @@ fn spawn_hands(
|
|||||||
transform: Transform::from_xyz(0.0, 0.0, 0.0),
|
transform: Transform::from_xyz(0.0, 0.0, 0.0),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
XRTrackedLocalFloor,
|
XrTrackedLocalFloor,
|
||||||
))
|
))
|
||||||
.id();
|
.id();
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ fn spawn_hands(
|
|||||||
transform: Transform::from_xyz(0.0, 0.0, 0.0),
|
transform: Transform::from_xyz(0.0, 0.0, 0.0),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
XRTrackedStage,
|
XrTrackedStage,
|
||||||
))
|
))
|
||||||
.id();
|
.id();
|
||||||
|
|
||||||
|
|||||||
@@ -19,19 +19,19 @@ use openxr::Posef;
|
|||||||
|
|
||||||
//exernal api
|
//exernal api
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct XRTrackedStage;
|
pub struct XrTrackedStage;
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct XRTrackedLocalFloor;
|
pub struct XrTrackedLocalFloor;
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct XRTrackedView;
|
pub struct XrTrackedView;
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct XRTrackedLeftGrip;
|
pub struct XrTrackedLeftGrip;
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct XRTrackedRightGrip;
|
pub struct XrTrackedRightGrip;
|
||||||
|
|
||||||
pub struct TrackingUtilitiesPlugin;
|
pub struct TrackingUtilitiesPlugin;
|
||||||
|
|
||||||
@@ -93,8 +93,8 @@ impl Plugin for TrackingUtilitiesPlugin {
|
|||||||
|
|
||||||
//stage
|
//stage
|
||||||
fn update_stage(
|
fn update_stage(
|
||||||
mut root_query: Query<&mut Transform, (With<XrTrackingRoot>, Without<XRTrackedStage>)>,
|
mut root_query: Query<&mut Transform, (With<XrTrackingRoot>, Without<XrTrackedStage>)>,
|
||||||
mut stage_query: Query<&mut Transform, (With<XRTrackedStage>, Without<XrTrackingRoot>)>,
|
mut stage_query: Query<&mut Transform, (With<XrTrackedStage>, Without<XrTrackingRoot>)>,
|
||||||
) {
|
) {
|
||||||
let tracking_root_transform = root_query.get_single_mut();
|
let tracking_root_transform = root_query.get_single_mut();
|
||||||
match tracking_root_transform {
|
match tracking_root_transform {
|
||||||
@@ -143,8 +143,8 @@ fn update_head_transforms(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn update_view(
|
fn update_view(
|
||||||
mut head_query: Query<&mut Transform, (With<HeadXRSpace>, Without<XRTrackedView>)>,
|
mut head_query: Query<&mut Transform, (With<HeadXRSpace>, Without<XrTrackedView>)>,
|
||||||
mut view_query: Query<&mut Transform, (With<XRTrackedView>, Without<HeadXRSpace>)>,
|
mut view_query: Query<&mut Transform, (With<XrTrackedView>, Without<HeadXRSpace>)>,
|
||||||
) {
|
) {
|
||||||
let head_transform = head_query.get_single_mut();
|
let head_transform = head_query.get_single_mut();
|
||||||
match head_transform {
|
match head_transform {
|
||||||
@@ -183,8 +183,8 @@ fn update_local_floor_transforms(
|
|||||||
}
|
}
|
||||||
//external
|
//external
|
||||||
fn update_local_floor(
|
fn update_local_floor(
|
||||||
mut local_floor: Query<&mut Transform, (With<LocalFloor>, Without<XRTrackedLocalFloor>)>,
|
mut local_floor: Query<&mut Transform, (With<LocalFloor>, Without<XrTrackedLocalFloor>)>,
|
||||||
mut tracked_floor: Query<&mut Transform, (With<XRTrackedLocalFloor>, Without<LocalFloor>)>,
|
mut tracked_floor: Query<&mut Transform, (With<XrTrackedLocalFloor>, Without<LocalFloor>)>,
|
||||||
) {
|
) {
|
||||||
let head_transform = local_floor.get_single_mut();
|
let head_transform = local_floor.get_single_mut();
|
||||||
match head_transform {
|
match head_transform {
|
||||||
@@ -202,8 +202,8 @@ fn update_local_floor(
|
|||||||
struct LeftGrip;
|
struct LeftGrip;
|
||||||
|
|
||||||
fn update_left_grip(
|
fn update_left_grip(
|
||||||
mut left_grip: Query<&mut Transform, (With<LeftGrip>, Without<XRTrackedLeftGrip>)>,
|
mut left_grip: Query<&mut Transform, (With<LeftGrip>, Without<XrTrackedLeftGrip>)>,
|
||||||
mut tracked_left_grip: Query<&mut Transform, (With<XRTrackedLeftGrip>, Without<LeftGrip>)>,
|
mut tracked_left_grip: Query<&mut Transform, (With<XrTrackedLeftGrip>, Without<LeftGrip>)>,
|
||||||
) {
|
) {
|
||||||
let head_transform = left_grip.get_single_mut();
|
let head_transform = left_grip.get_single_mut();
|
||||||
match head_transform {
|
match head_transform {
|
||||||
@@ -221,8 +221,8 @@ fn update_left_grip(
|
|||||||
struct RightGrip;
|
struct RightGrip;
|
||||||
|
|
||||||
fn update_right_grip(
|
fn update_right_grip(
|
||||||
mut right_grip: Query<&mut Transform, (With<RightGrip>, Without<XRTrackedRightGrip>)>,
|
mut right_grip: Query<&mut Transform, (With<RightGrip>, Without<XrTrackedRightGrip>)>,
|
||||||
mut tracked_right_grip: Query<&mut Transform, (With<XRTrackedRightGrip>, Without<RightGrip>)>,
|
mut tracked_right_grip: Query<&mut Transform, (With<XrTrackedRightGrip>, Without<RightGrip>)>,
|
||||||
) {
|
) {
|
||||||
let head_transform = right_grip.get_single_mut();
|
let head_transform = right_grip.get_single_mut();
|
||||||
match head_transform {
|
match head_transform {
|
||||||
|
|||||||
Reference in New Issue
Block a user