refactor: move OxrSpaceSyncSet into bevy_mod_xr and put locate_hands in the new XrSpaceSyncSet

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-05-02 14:58:54 +02:00
parent 84a69ea1ae
commit 4074d4be7c
4 changed files with 18 additions and 14 deletions

View File

@@ -6,8 +6,8 @@ use bevy_mod_xr::hands::{
use bevy_mod_xr::hands::{LeftHand, RightHand, XrHandBoneEntities};
use bevy_mod_xr::session::{XrPreDestroySession, XrSessionCreated};
use bevy_mod_xr::spaces::{
XrPrimaryReferenceSpace, XrReferenceSpace, XrSpaceLocationFlags, XrSpaceVelocityFlags,
XrVelocity,
XrPrimaryReferenceSpace, XrReferenceSpace, XrSpaceLocationFlags, XrSpaceSyncSet,
XrSpaceVelocityFlags, XrVelocity,
};
use openxr::{SpaceLocationFlags, SpaceVelocityFlags};
@@ -31,7 +31,12 @@ impl Default for HandTrackingPlugin {
impl Plugin for HandTrackingPlugin {
fn build(&self, app: &mut App) {
app.add_systems(PreUpdate, locate_hands.run_if(openxr_session_running));
app.add_systems(
PreUpdate,
locate_hands
.in_set(XrSpaceSyncSet)
.run_if(openxr_session_running),
);
if self.default_hands {
app.add_systems(XrPreDestroySession, clean_up_default_hands)
.add_systems(XrSessionCreated, spawn_default_hands);