Upgrade to Bevy 0.14.

This commit is contained in:
Nolan Darilek 2024-07-07 13:07:28 -05:00
parent 5a746660e1
commit 3d000a4d7f
4 changed files with 19 additions and 13 deletions

View File

@ -14,24 +14,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.13" version = "0.14"
default-features = false default-features = false
features = [ features = [
"bevy_gilrs", "bevy_gilrs",
"bevy_state",
"bevy_winit", "bevy_winit",
"x11", "x11",
"wayland", "wayland",
"multi-threaded", "multi_threaded",
"serialize", "serialize",
] ]
[dependencies] [dependencies]
bevy_rapier2d = "0.25" bevy_rapier2d = "0.27.0-rc.1"
bevy_synthizer = "0.6" bevy_synthizer = "0.7"
bevy_tts = { version = "0.8", default-features = false, features = ["tolk"] } bevy_tts = { version = "0.9", default-features = false, features = ["tolk"] }
coord_2d = "0.3" coord_2d = "0.3"
here_be_dragons = { version = "0.3", features = ["serde"] } here_be_dragons = { version = "0.3", features = ["serde"] }
leafwing-input-manager = "0.13" leafwing-input-manager = "0.14"
maze_generator = "2" maze_generator = "2"
once_cell = "1" once_cell = "1"
pathfinding = "4" pathfinding = "4"

View File

@ -6,7 +6,7 @@ use std::{
sync::RwLock, sync::RwLock,
}; };
use bevy::{app::PluginGroupBuilder, prelude::*, utils::FloatOrd}; use bevy::{app::PluginGroupBuilder, math::FloatOrd, prelude::*};
use bevy_rapier2d::{ use bevy_rapier2d::{
parry::query::{closest_points, distance, ClosestPoints}, parry::query::{closest_points, distance, ClosestPoints},
prelude::*, prelude::*,

View File

@ -111,7 +111,6 @@ fn find_path_for_shape(
let mut should_push = true; let mut should_push = true;
let dest = Vector2::new(exit.0 .0 as f32, exit.0 .1 as f32); let dest = Vector2::new(exit.0 .0 as f32, exit.0 .1 as f32);
let shape_vel = dest - pos; let shape_vel = dest - pos;
let max_toi = 1.;
if query_pipeline if query_pipeline
.cast_shape( .cast_shape(
&rigid_body_set, &rigid_body_set,
@ -119,8 +118,11 @@ fn find_path_for_shape(
&shape_pos, &shape_pos,
&shape_vel, &shape_vel,
&*shape.raw, &*shape.raw,
max_toi, ShapeCastOptions {
true, max_time_of_impact: 1.,
stop_at_penetration: true,
..default()
},
bevy_rapier2d::rapier::pipeline::QueryFilter::new() bevy_rapier2d::rapier::pipeline::QueryFilter::new()
.predicate(&|h, _c| h != initiator), .predicate(&|h, _c| h != initiator),
) )
@ -308,8 +310,11 @@ fn negotiate_path(
transform.yaw().radians(), transform.yaw().radians(),
direction, direction,
collider, collider,
rapier_context.integration_parameters.dt, ShapeCastOptions {
true, max_time_of_impact: 1.,
stop_at_penetration: true,
..default()
},
QueryFilter::new() QueryFilter::new()
.predicate(&|entity| obstructions.get(entity).is_ok()) .predicate(&|entity| obstructions.get(entity).is_ok())
.exclude_sensors() .exclude_sensors()

View File

@ -26,7 +26,7 @@ fn tag_behind(
continue; continue;
} }
let v = transform.translation() - listener_transform.translation(); let v = transform.translation() - listener_transform.translation();
let dot = v.dot(listener_forward); let dot = v.dot(*listener_forward);
let is_behind = dot <= 0.; let is_behind = dot <= 0.;
if is_behind { if is_behind {
commands.entity(entity).insert(Behind); commands.entity(entity).insert(Behind);