diff --git a/Cargo.toml b/Cargo.toml index 1404622..c86ac81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ speech_dispatcher_0_10 = ["bevy_tts/speech_dispatcher_0_10"] speech_dispatcher_0_11 = ["bevy_tts/speech_dispatcher_0_11"] [dependencies.bevy] -version = "0.14" +version = "0.15" default-features = false features = [ "android_shared_stdcxx", @@ -48,12 +48,12 @@ features = [ ] [dependencies] -avian2d = "0.1" -bevy_synthizer = "0.8" -bevy_tts = { version = "0.9", default-features = false, features = ["tolk"] } +avian2d = "0.2" +bevy_synthizer = "0.9" +bevy_tts = { version = "0.10", default-features = false, features = ["tolk"] } coord_2d = "0.3" here_be_dragons = { version = "0.3", features = ["serde"] } -leafwing-input-manager = "0.15" +leafwing-input-manager = "0.16" maze_generator = "2" once_cell = "1" pathfinding = "4" diff --git a/src/exploration.rs b/src/exploration.rs index 3270381..05be710 100644 --- a/src/exploration.rs +++ b/src/exploration.rs @@ -333,7 +333,7 @@ where &shape, exploring, 0., - SpatialQueryFilter::default(), + &default(), |entity| { if explorable.contains(entity) { commands.entity(entity).insert(ExplorationFocused); diff --git a/src/map.rs b/src/map.rs index f34089a..ab96906 100644 --- a/src/map.rs +++ b/src/map.rs @@ -73,7 +73,7 @@ impl ITileType for Tile { #[derive(Bundle, Default)] pub struct PortalBundle { - pub transform: TransformBundle, + pub transform: Transform, pub portal: Portal, pub mappable: Mappable, } @@ -83,12 +83,12 @@ pub struct MapBundle { pub map: Map, pub spawn_colliders: SpawnColliders, pub spawn_portals: SpawnPortals, - pub transform: TransformBundle, + pub transform: Transform, } #[derive(Bundle, Clone, Debug)] pub struct TileBundle { - pub transform: TransformBundle, + pub transform: Transform, pub collider: Collider, pub rigid_body: RigidBody, pub map_obstruction: MapObstruction, @@ -117,7 +117,7 @@ impl TileBundle { #[derive(Bundle, Clone, Debug)] pub struct ZoneBundle { pub collider: Collider, - pub transform: TransformBundle, + pub transform: Transform, pub zone: Zone, pub sensor: Sensor, } @@ -239,7 +239,7 @@ fn spawn_colliders( if tile.blocks_visibility() { commands.entity(id).insert(Visible::opaque()); } - commands.entity(map_entity).push_children(&[id]); + commands.entity(map_entity).add_children(&[id]); } } } diff --git a/src/navigation.rs b/src/navigation.rs index a2a0d4e..700d0ba 100644 --- a/src/navigation.rs +++ b/src/navigation.rs @@ -227,9 +227,12 @@ fn controls( transform.translation.truncate(), transform.yaw().as_radians(), dir, - pair.length(), - true, - SpatialQueryFilter::from_excluded_entities(&sensors), + &ShapeCastConfig { + max_distance: pair.length(), + ignore_origin_penetration: true, + ..default() + }, + &SpatialQueryFilter::from_excluded_entities(&sensors), |hit| { if hit.entity != entity { can_translate = false; @@ -255,7 +258,7 @@ fn controls( // velocity.angvel = // actions.value(&NavigationAction::SetAngularVelocity); transform.rotation *= Quat::from_rotation_z( - actions.value(&NavigationAction::SetAngularVelocity) * time.delta_seconds(), + actions.value(&NavigationAction::SetAngularVelocity) * time.delta_secs(), ); } } diff --git a/src/pathfinding.rs b/src/pathfinding.rs index d4cc5d9..498e041 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -139,7 +139,7 @@ fn calculate_path( collider, check, transform.yaw().as_radians(), - SpatialQueryFilter::from_excluded_entities(&sensors), + &SpatialQueryFilter::from_excluded_entities(&sensors), ); for entity in &hits { if obstructions.contains(*entity) { @@ -245,9 +245,12 @@ fn negotiate_path( start, global_transform.yaw().as_radians(), Dir2::new_unchecked(direction.normalize()), - time.delta_seconds(), - true, - SpatialQueryFilter::from_excluded_entities(&sensors), + &ShapeCastConfig { + max_distance: time.delta_secs(), + ignore_origin_penetration: true, + ..default() + }, + &SpatialQueryFilter::from_excluded_entities(&sensors), |hit| { if obstructions.contains(hit.entity) { hits.push(hit.entity); @@ -261,7 +264,7 @@ fn negotiate_path( next.y = next.y.trunc(); transform.translation = next.extend(0.); } else { - let delta = direction * time.delta_seconds(); + let delta = direction * time.delta_secs(); navigation_actions.set_axis_pair(&NavigationAction::Translate, delta); } if rotation_speed.is_some() { diff --git a/src/sound/volumetric.rs b/src/sound/volumetric.rs index 3a267ff..c5d0d5d 100644 --- a/src/sound/volumetric.rs +++ b/src/sound/volumetric.rs @@ -39,9 +39,7 @@ fn update( ); commands .entity(sound_entity) - .insert(TransformBundle::from_transform( - Transform::from_translation(sound_translation), - )); + .insert(Transform::from_translation(sound_translation)); } } else if closest == ClosestPoints::Intersecting && sound_transform.is_some() { commands @@ -60,7 +58,7 @@ fn removed( ) { for entity in removed.read() { if transforms.get(entity).is_ok() { - commands.entity(entity).insert(TransformBundle::default()); + commands.entity(entity).insert(Transform::default()); } } } diff --git a/src/visibility.rs b/src/visibility.rs index e40b861..f6e25b5 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -87,7 +87,7 @@ impl Viewshed { dir, dir.distance(*start), true, - default(), + &default(), &|entity| { if *e != entity && entities.contains(e) { // println!("{entities:?} contains {e}"); @@ -161,7 +161,7 @@ impl OpacityMap { &shape, shape_pos, 0., - default(), + &default(), |entity| { if let Ok((_, _, _, visible)) = visible.get(entity) { coord_entities.insert(entity); @@ -451,6 +451,6 @@ impl Plugin for VisibilityPlug ), ) .add_systems(FixedPostUpdate, (viewshed_removed, remove_visible)) - .observe(log_visible); + .add_observer(log_visible); } }