From 9e778743e03764624123b7ef410edc10fad19de9 Mon Sep 17 00:00:00 2001 From: Joona Aalto Date: Thu, 5 Dec 2024 09:52:24 +0200 Subject: [PATCH] Bevy 0.15 (#34) Migrate to the Bevy 0.15 RC. - Migrate examples - Add `with_child` to `ReferenceFrameCommands` and `SpatialEntityCommands` to match Bevy's `EntityCommands::with_child` - Add `Typed` bound to `GridPrecision` (required for `register_type`) --------- Co-authored-by: Aevyrie --- Cargo.toml | 31 +++--- README.md | 1 + examples/debug.rs | 54 ++++------ examples/demo.rs | 88 +++++++---------- examples/error.rs | 54 ++++------ examples/error_child.rs | 73 ++++++-------- examples/planets.rs | 146 ++++++++++++--------------- examples/split_screen.rs | 147 ++++++++++------------------ src/bundles.rs | 12 --- src/camera.rs | 2 +- src/commands.rs | 23 +++-- src/floating_origins.rs | 2 + src/grid_cell.rs | 1 + src/precision.rs | 3 +- src/reference_frame/local_origin.rs | 10 +- src/reference_frame/mod.rs | 2 + src/tests.rs | 26 ++--- src/validation.rs | 2 +- 18 files changed, 274 insertions(+), 403 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aa9d8a1..8c3cd51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,23 +9,23 @@ repository = "https://github.com/aevyrie/big_space" documentation = "https://docs.rs/crate/big_space/latest" [dependencies] -bevy_app = { version = "0.14.0", default-features = false } -bevy_ecs = { version = "0.14.0", default-features = false } -bevy_hierarchy = { version = "0.14.0", default-features = false } -bevy_log = { version = "0.14.0", default-features = false } -bevy_math = { version = "0.14.0", default-features = false } -bevy_reflect = { version = "0.14.0", default-features = false } -bevy_transform = { version = "0.14.0", default-features = false } -bevy_utils = { version = "0.14.0", default-features = false } +bevy_app = { version = "0.15.0", default-features = false } +bevy_ecs = { version = "0.15.0", default-features = false } +bevy_hierarchy = { version = "0.15.0", default-features = false } +bevy_log = { version = "0.15.0", default-features = false } +bevy_math = { version = "0.15.0", default-features = false } +bevy_reflect = { version = "0.15.0", default-features = false } +bevy_transform = { version = "0.15.0", default-features = false } +bevy_utils = { version = "0.15.0", default-features = false } # Optional -bevy_color = { version = "0.14.0", default-features = false, optional = true } -bevy_gizmos = { version = "0.14.0", default-features = false, optional = true } -bevy_render = { version = "0.14.0", default-features = false, optional = true } -bevy_input = { version = "0.14.0", default-features = false, optional = true } -bevy_time = { version = "0.14.0", default-features = false, optional = true } +bevy_color = { version = "0.15.0", default-features = false, optional = true } +bevy_gizmos = { version = "0.15.0", default-features = false, optional = true } +bevy_render = { version = "0.15.0", default-features = false, optional = true } +bevy_input = { version = "0.15.0", default-features = false, optional = true } +bevy_time = { version = "0.15.0", default-features = false, optional = true } [dev-dependencies] -bevy = { version = "0.14.0", default-features = false, features = [ +bevy = { version = "0.15.0", default-features = false, features = [ "bevy_scene", "bevy_gltf", "bevy_winit", @@ -33,11 +33,12 @@ bevy = { version = "0.14.0", default-features = false, features = [ "bevy_ui", "bevy_pbr", "bevy_gizmos", + "animation", + "bevy_window", "x11", "tonemapping_luts", "multi_threaded", ] } -# bevy-inspector-egui = "0.24" rand = "0.8.5" [features] diff --git a/README.md b/README.md index 298e307..3e9a9c0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ From the docs: https://docs.rs/big_space/latest/big_space/precision/trait.GridPr | bevy | big_space | | ---- | --------- | +| 0.15 | 0.8 | | 0.14 | 0.7 | | 0.13 | 0.5, 0.6 | | 0.12 | 0.4 | diff --git a/examples/debug.rs b/examples/debug.rs index 58b9263..1c576bc 100644 --- a/examples/debug.rs +++ b/examples/debug.rs @@ -30,8 +30,8 @@ fn movement( )>, ) { let delta_translation = |offset: f32, scale: f32| -> Vec3 { - let t_1 = time.elapsed_seconds() * 0.1 + offset; - let dt = time.delta_seconds() * 0.1; + let t_1 = time.elapsed_secs() * 0.1 + offset; + let dt = time.delta_secs() * 0.1; let t_0 = t_1 - dt; let pos = |t: f32| -> Vec3 { Vec3::new(t.cos() * 2.0, t.sin() * 2.0, (t * 1.3).sin() * 2.0) }; @@ -51,7 +51,7 @@ struct Rotator; fn rotation(time: Res