Skip to content

Commit

Permalink
Merge pull request #306 from janhohenheim/misc-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
janhohenheim authored Mar 12, 2024
2 parents 7696d10 + b2036d3 commit 92c28be
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@ jobs:
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Check format
run: cargo fmt --all -- --check
- name: Run clippy with native dev features
- name: Run clippy with dev features
run: cargo clippy
- name: Run clippy without dev features
run: cargo clippy --no-default-features

17 changes: 5 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ bevy_egui = "0.25"
oxidized_navigation = { version = "0.10", features = ["xpbd", "debug_draw"] }
iyes_progress = "0.11"
leafwing-input-manager = { version = "0.13", features = ["egui"] }
## Waiting for https://github.com/BlackPhlox/bevy_dolly/pull/51
bevy_dolly = { git = "https://github.com/rparrett/bevy_dolly/", branch = "bevy-0.13" }
bevy_dolly = "0.0.3"
bevy_mod_sysfail = "7"
bevy_editor_pls = { version = "0.8.1", optional = true }
bevy_hanabi = "0.10"
Expand All @@ -61,10 +60,6 @@ warbler_grass = "0.6"
bevy_gltf_blueprints = { version = "0.9", git = "https://github.com/janhohenheim/Blender_bevy_components_workflow", branch = "fix-crashe" }
bevy_registry_export = "0.3"

[patch."https://github.com/rparrett/bevy_dolly/"]
## Waiting for https://github.com/BlackPhlox/bevy_dolly/pull/51
dolly = { git = "https://github.com/janhohenheim/dolly", branch = "bevy-0.13" }

[build-dependencies]
embed-resource = "2"

Expand Down
9 changes: 7 additions & 2 deletions src/movement/character_controller/models.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
use crate::movement::character_controller::FloatHeight;
use crate::GameState;
use bevy::transform::TransformSystem;
use bevy::{prelude::*, render::view::NoFrustumCulling};
use bevy_tnua::controller::TnuaController;
use bevy_xpbd_3d::prelude::*;

pub(super) fn plugin(app: &mut App) {
app.add_systems(
Update,
prepare_models_of_controllers.after(PhysicsSet::Sync),
prepare_models_of_controllers
.after(PhysicsSet::Sync)
.before(TransformSystem::TransformPropagate)
.run_if(in_state(GameState::Playing)),
);
}

Expand All @@ -18,7 +23,7 @@ fn prepare_models_of_controllers(
meshes: Query<&Handle<Mesh>>,
) {
for (entity, transform, float_height) in controllers.iter() {
// Shift models down because XPBD will make controllers float,
// Shift models down because Tnua will make controllers float,
// but our models definitely should not be floating!
let offset = (float_height.0 / transform.scale.y) * 2.;
let children = children_q.get(entity).unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/player_control/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::{
GameState,
};
use bevy::prelude::*;
use bevy::transform::TransformSystem;
use bevy_atmosphere::prelude::AtmospherePlugin;
use bevy_dolly::prelude::Dolly;
use bevy_xpbd_3d::PhysicsSet;
Expand Down Expand Up @@ -76,6 +77,7 @@ pub(super) fn plugin(app: &mut App) {
.chain()
.in_set(CameraUpdateSystemSet)
.after(PhysicsSet::Sync)
.before(TransformSystem::TransformPropagate)
.run_if(in_state(GameState::Playing))
.run_if(any_with_component::<Player>),
);
Expand Down

0 comments on commit 92c28be

Please sign in to comment.