From e6aa02b95240fa6f1c083ad797725a4dc5262d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Wed, 12 Feb 2025 00:08:21 +0100 Subject: [PATCH 1/3] fix required feature declaration --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c7f5c67889eac..a1abdb1a58059 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2159,13 +2159,13 @@ wasm = false name = "fallible_systems" path = "examples/ecs/fallible_systems.rs" doc-scrape-examples = true +required-features = ["bevy_mesh_picking_backend"] [package.metadata.example.fallible_systems] name = "Fallible Systems" description = "Systems that return results to handle errors" category = "ECS (Entity Component System)" wasm = false -required-features = ["bevy_mesh_picking_backend"] [[example]] name = "startup_system" From 94398e5cc50b9dcc64cb753e1d644a301f3bc8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Wed, 12 Feb 2025 00:11:49 +0100 Subject: [PATCH 2/3] use seeded rng --- examples/ecs/fallible_systems.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/ecs/fallible_systems.rs b/examples/ecs/fallible_systems.rs index 6d24cc3ca2388..59e82371a353a 100644 --- a/examples/ecs/fallible_systems.rs +++ b/examples/ecs/fallible_systems.rs @@ -6,6 +6,8 @@ use bevy::math::sampling::UniformMeshSampler; use bevy::prelude::*; use rand::distributions::Distribution; +use rand::SeedableRng; +use rand_chacha::ChaCha8Rng; fn main() { let mut app = App::new(); @@ -68,7 +70,7 @@ fn setup( mut meshes: ResMut>, mut materials: ResMut>, ) -> Result { - let mut rng = rand::thread_rng(); + let mut seeded_rng = ChaCha8Rng::seed_from_u64(19878367467712); // Make a plane for establishing space. commands.spawn(( @@ -116,7 +118,7 @@ fn setup( }); // Add sample points as children of the sphere: - for point in distribution.sample_iter(&mut rng).take(10000) { + for point in distribution.sample_iter(&mut seeded_rng).take(10000) { sphere.with_child(( Mesh3d(point_mesh.clone()), MeshMaterial3d(point_material.clone()), From b61206f801d865a8bef9acc8625f29b72c02e4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Wed, 12 Feb 2025 00:12:21 +0100 Subject: [PATCH 3/3] drive-by: remove not-needed field --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a1abdb1a58059..65bbc514271b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4003,7 +4003,6 @@ name = "Sprite Picking" description = "Demonstrates picking sprites and sprite atlases" category = "Picking" wasm = true -required-features = ["bevy_sprite_picking_backend"] [[example]] name = "debug_picking"