Upgrade to Bevy 0.12.

This commit is contained in:
Nolan Darilek 2024-02-09 14:59:16 -06:00
parent e381109cad
commit 4e0a36c4a5
9 changed files with 17 additions and 17 deletions

View File

@ -13,24 +13,25 @@ speech_dispatcher_0_10 = ["bevy_tts/speech_dispatcher_0_10"]
speech_dispatcher_0_11 = ["bevy_tts/speech_dispatcher_0_11"] speech_dispatcher_0_11 = ["bevy_tts/speech_dispatcher_0_11"]
[dependencies.bevy] [dependencies.bevy]
version = "0.11" version = "0.12"
default-features = false default-features = false
features = [ features = [
"bevy_gilrs", "bevy_gilrs",
"bevy_winit", "bevy_winit",
"x11", "x11",
"wayland", "wayland",
"multi-threaded",
"serialize", "serialize",
] ]
[dependencies] [dependencies]
bevy_rapier2d = "0.22" bevy_rapier2d = "0.24"
bevy_synthizer = "0.4" bevy_synthizer = "0.5"
bevy_tts = { version = "0.6", default-features = false, features = ["tolk"] } bevy_tts = { version = "0.7", default-features = false, features = ["tolk"] }
coord_2d = "0.3" coord_2d = "0.3"
futures-lite = "1" futures-lite = "1"
here_be_dragons = { version = "0.3", features = ["serde"] } here_be_dragons = { version = "0.3", features = ["serde"] }
leafwing-input-manager = "0.10" leafwing-input-manager = "0.11"
maze_generator = "2" maze_generator = "2"
once_cell = "1" once_cell = "1"
pathfinding = "4" pathfinding = "4"

View File

@ -521,7 +521,6 @@ impl GlobalTransformExt for GlobalTransform {
other: &GlobalTransform, other: &GlobalTransform,
other_collider: &Collider, other_collider: &Collider,
) -> ClosestPoints { ) -> ClosestPoints {
use bevy::math::Vec3Swizzles;
let scale = PHYSICS_SCALE.read().unwrap(); let scale = PHYSICS_SCALE.read().unwrap();
let pos1 = Isometry::new( let pos1 = Isometry::new(
(self.translation() / *scale).xy().into(), (self.translation() / *scale).xy().into(),
@ -540,7 +539,6 @@ impl GlobalTransformExt for GlobalTransform {
other: &GlobalTransform, other: &GlobalTransform,
other_collider: &Collider, other_collider: &Collider,
) -> String { ) -> String {
use bevy::math::Vec3Swizzles;
let scale = PHYSICS_SCALE.read().unwrap(); let scale = PHYSICS_SCALE.read().unwrap();
let pos1 = Isometry::new( let pos1 = Isometry::new(
(self.translation() / *scale).xy().into(), (self.translation() / *scale).xy().into(),

View File

@ -421,7 +421,7 @@ where
if !config.states.is_empty() { if !config.states.is_empty() {
let states = config.states; let states = config.states;
for state in states { for state in states {
app.configure_set(Update, Exploration.run_if(in_state(state.clone()))) app.configure_sets(Update, Exploration.run_if(in_state(state.clone())))
.add_systems(OnExit(state), cleanup); .add_systems(OnExit(state), cleanup);
} }
} }

View File

@ -308,7 +308,7 @@ fn remove_direction(
mut removed: RemovedComponents<Transform>, mut removed: RemovedComponents<Transform>,
directions: Query<&CardinalDirection>, directions: Query<&CardinalDirection>,
) { ) {
for entity in &mut removed { for entity in removed.read() {
if directions.contains(entity) { if directions.contains(entity) {
commands.entity(entity).remove::<CardinalDirection>(); commands.entity(entity).remove::<CardinalDirection>();
} }
@ -352,7 +352,7 @@ fn log_area_descriptions<State>(
if !config.log_area_descriptions { if !config.log_area_descriptions {
return; return;
} }
for event in events.iter() { for event in events.read() {
let (entity1, entity2, started) = match event { let (entity1, entity2, started) = match event {
CollisionEvent::Started(collider1, collider2, _) => (collider1, collider2, true), CollisionEvent::Started(collider1, collider2, _) => (collider1, collider2, true),
CollisionEvent::Stopped(collider1, collider2, _) => (collider1, collider2, false), CollisionEvent::Stopped(collider1, collider2, _) => (collider1, collider2, false),

View File

@ -262,7 +262,7 @@ fn remove_destination(
entities: &Entities, entities: &Entities,
mut removed: RemovedComponents<Destination>, mut removed: RemovedComponents<Destination>,
) { ) {
for entity in &mut removed { for entity in removed.read() {
if entities.contains(entity) { if entities.contains(entity) {
commands.entity(entity).remove::<Calculating>(); commands.entity(entity).remove::<Calculating>();
} }
@ -326,6 +326,7 @@ fn negotiate_path(
direction, direction,
collider, collider,
rapier_context.integration_parameters.dt, rapier_context.integration_parameters.dt,
true,
QueryFilter::new() QueryFilter::new()
.predicate(&|entity| obstructions.get(entity).is_ok()) .predicate(&|entity| obstructions.get(entity).is_ok())
.exclude_sensors() .exclude_sensors()

View File

@ -139,7 +139,7 @@ fn exploration_focus_removed(
children: Query<&Children>, children: Query<&Children>,
) { ) {
const ICON_GAIN: f64 = 3.; const ICON_GAIN: f64 = 3.;
for entity in &mut removed { for entity in removed.read() {
if let Ok(mut icon) = query.get_mut(entity) { if let Ok(mut icon) = query.get_mut(entity) {
icon.gain /= ICON_GAIN; icon.gain /= ICON_GAIN;
} }

View File

@ -74,7 +74,7 @@ fn behind_removed(
mut sounds: Query<&mut Sound>, mut sounds: Query<&mut Sound>,
) { ) {
let downshift = 1. / config.downshift; let downshift = 1. / config.downshift;
for entity in &mut removed { for entity in removed.read() {
if let Ok(mut icon) = icons.get_mut(entity) { if let Ok(mut icon) = icons.get_mut(entity) {
icon.pitch *= downshift; icon.pitch *= downshift;
last_icon_pitch.remove(&entity); last_icon_pitch.remove(&entity);

View File

@ -44,7 +44,7 @@ fn removed(
mut removed: RemovedComponents<Volumetric>, mut removed: RemovedComponents<Volumetric>,
transforms: Query<Entity, (With<Transform>, With<GlobalTransform>)>, transforms: Query<Entity, (With<Transform>, With<GlobalTransform>)>,
) { ) {
for entity in &mut removed { for entity in removed.read() {
if transforms.get(entity).is_ok() { if transforms.get(entity).is_ok() {
commands.entity(entity).insert(TransformBundle::default()); commands.entity(entity).insert(TransformBundle::default());
} }

View File

@ -267,7 +267,7 @@ fn viewshed_removed(
visible_entities: Query<&VisibleEntities>, visible_entities: Query<&VisibleEntities>,
mut events: EventWriter<VisibilityChanged>, mut events: EventWriter<VisibilityChanged>,
) { ) {
for entity in &mut query { for entity in query.read() {
if let Ok(visible) = visible_entities.get(entity) { if let Ok(visible) = visible_entities.get(entity) {
for e in visible.iter() { for e in visible.iter() {
events.send(VisibilityChanged::Lost { events.send(VisibilityChanged::Lost {
@ -344,7 +344,7 @@ fn remove_visible(
) { ) {
if !removed.is_empty() { if !removed.is_empty() {
let mut cache = HashMap::new(); let mut cache = HashMap::new();
for removed in &mut removed { for removed in removed.read() {
for (viewer_entity, mut viewshed, mut visible_entities, start) in &mut viewers { for (viewer_entity, mut viewshed, mut visible_entities, start) in &mut viewers {
if !visible_entities.contains(&removed) { if !visible_entities.contains(&removed) {
continue; continue;
@ -394,7 +394,7 @@ fn log_visible(
timer.tick(time.delta()); timer.tick(time.delta());
} }
recently_lost.retain(|_entity, timer| !timer.finished()); recently_lost.retain(|_entity, timer| !timer.finished());
for event in events.iter() { for event in events.read() {
let viewer = match event { let viewer = match event {
VisibilityChanged::Gained { viewer, .. } => viewer, VisibilityChanged::Gained { viewer, .. } => viewer,
VisibilityChanged::Lost { viewer, .. } => viewer, VisibilityChanged::Lost { viewer, .. } => viewer,