Skip to content

Commit

Permalink
fix ci(hopefully) and fix suboptimal behavior in bevy_xr_utils
Browse files Browse the repository at this point in the history
Signed-off-by: Schmarni <marnistromer@gmail.com>
  • Loading branch information
Schmarni-Dev committed Oct 21, 2024
1 parent da65989 commit 6666339
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ jobs:

- run: rustup toolchain install stable --profile minimal --no-self-update

- uses: ./
with:
workspaces: .

- run: cargo check
- run: cargo check --all --all-targets
working-directory: .

check_wasm:
Expand All @@ -43,9 +39,8 @@ jobs:

- run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown --no-self-update

- uses: ./
with:
workspaces: .

- run: cargo check --target wasm32-unknown-unknown
- run: cargo check --target wasm32-unknown-unknown -p bevy_mod_xr
- run: cargo check --target wasm32-unknown-unknown -p bevy_mod_openxr
- run: cargo check --target wasm32-unknown-unknown -p bevy_mod_webxr
- run: cargo check --target wasm32-unknown-unknown -p bevy_mod_xr_utils
working-directory: .
1 change: 0 additions & 1 deletion crates/bevy_xr_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// use bevy::prelude::*;
pub mod hand_gizmos;
#[cfg(not(target_family = "wasm"))]
pub mod tracking_utils;
Expand Down
14 changes: 4 additions & 10 deletions crates/bevy_xr_utils/src/tracking_utils.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
use bevy::prelude::*;
use bevy_mod_openxr::{
action_binding::{OxrSendActionBindings, OxrSuggestActionBinding},
action_set_attaching::OxrAttachActionSet,
action_set_syncing::{OxrActionSetSyncSet, OxrSyncActionSet},
helper_traits::{ToQuat, ToVec3},
resources::{OxrFrameState, OxrInstance, Pipelined},
session::OxrSession,
spaces::{OxrSpaceLocationFlags, OxrSpaceSyncSet},
action_binding::{OxrSendActionBindings, OxrSuggestActionBinding}, action_set_attaching::OxrAttachActionSet, action_set_syncing::{OxrActionSetSyncSet, OxrSyncActionSet}, helper_traits::{ToQuat, ToVec3}, openxr_session_available, openxr_session_running, resources::{OxrFrameState, OxrInstance, Pipelined}, session::OxrSession, spaces::{OxrSpaceLocationFlags, OxrSpaceSyncSet}
};
use bevy_mod_xr::{
session::{session_available, session_running, XrSessionCreated, XrTrackingRoot},
Expand Down Expand Up @@ -48,7 +42,7 @@ impl Plugin for TrackingUtilitiesPlugin {
PreUpdate,
update_head_transforms
.in_set(OxrSpaceSyncSet)
.run_if(session_running),
.run_if(openxr_session_running),
);
//external
app.add_systems(PreUpdate, update_view.after(update_head_transforms));
Expand All @@ -66,12 +60,12 @@ impl Plugin for TrackingUtilitiesPlugin {
PreUpdate,
sync_actions
.before(OxrActionSetSyncSet)
.run_if(session_running),
.run_if(openxr_session_running),
);
//attach sets
app.add_systems(XrSessionCreated, attach_set);
//create actions
app.add_systems(Startup, create_actions.run_if(session_available));
app.add_systems(Startup, create_actions.run_if(openxr_session_available));

app.add_systems(PreUpdate, update_left_grip.after(OxrSpaceSyncSet));
app.add_systems(PreUpdate, update_right_grip.after(OxrSpaceSyncSet));
Expand Down
27 changes: 16 additions & 11 deletions crates/bevy_xr_utils/src/xr_utils_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@
//!
use bevy::prelude::*;
use bevy_mod_openxr::{
action_binding::OxrSuggestActionBinding, action_set_attaching::OxrAttachActionSet,
action_set_syncing::OxrActionSetSyncSet, action_set_syncing::OxrSyncActionSet,
resources::OxrInstance, session::OxrSession,
action_binding::OxrSuggestActionBinding,
action_set_attaching::OxrAttachActionSet,
action_set_syncing::{OxrActionSetSyncSet, OxrSyncActionSet},
openxr_session_available, openxr_session_running,
resources::OxrInstance,
session::OxrSession,
};
use bevy_mod_xr::session::{session_available, session_running};
use openxr::{Path, Vector2f};

use std::borrow::Cow;
Expand All @@ -69,37 +71,40 @@ impl Plugin for XRUtilsActionsPlugin {
fn build(&self, app: &mut App) {
app.configure_sets(
Startup,
XRUtilsActionSystemSet::CreateEvents.run_if(session_available),
XRUtilsActionSystemSet::CreateEvents.run_if(openxr_session_available),
);
app.configure_sets(
PreUpdate,
XRUtilsActionSystemSet::SyncActionStates.run_if(session_running),
XRUtilsActionSystemSet::SyncActionStates.run_if(openxr_session_running),
);
app.add_systems(
Startup,
create_openxr_events
.in_set(XRUtilsActionSystemSet::CreateEvents)
.run_if(session_available),
.run_if(openxr_session_available),
);
app.add_systems(
Update,
sync_active_action_sets.run_if(openxr_session_running),
);
app.add_systems(Update, sync_active_action_sets.run_if(session_running));
app.add_systems(
PreUpdate,
sync_and_update_action_states_f32
.run_if(session_running)
.run_if(openxr_session_running)
.in_set(XRUtilsActionSystemSet::SyncActionStates)
.after(OxrActionSetSyncSet),
);
app.add_systems(
PreUpdate,
sync_and_update_action_states_bool
.run_if(session_running)
.run_if(openxr_session_running)
.in_set(XRUtilsActionSystemSet::SyncActionStates)
.after(OxrActionSetSyncSet),
);
app.add_systems(
PreUpdate,
sync_and_update_action_states_vector
.run_if(session_running)
.run_if(openxr_session_running)
.in_set(XRUtilsActionSystemSet::SyncActionStates)
.after(OxrActionSetSyncSet),
);
Expand Down

0 comments on commit 6666339

Please sign in to comment.