From 8c7ddece3cfd0d776da9001475ecf1465e05e244 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 9 Jun 2025 20:46:15 +0300 Subject: [PATCH] feat: implement missing initial_rotation --- Cargo.lock | 4 ++++ crates/bevy_dice/Cargo.toml | 3 +++ crates/bevy_dice/src/lib.rs | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 97cf9b0..edddd6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1071,6 +1071,8 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41c76ebff351c2123628086ccef32fb9ae476519dc13f605d3680c17da5c40fb" dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.6.4", "rand_core 0.9.3", "wyrand", ] @@ -1091,6 +1093,8 @@ dependencies = [ "bevy_ecs", "bevy_prng", "getrandom 0.3.3", + "rand_chacha 0.9.0", + "rand_core 0.6.4", "rand_core 0.9.3", ] diff --git a/crates/bevy_dice/Cargo.toml b/crates/bevy_dice/Cargo.toml index ce2423a..156487f 100644 --- a/crates/bevy_dice/Cargo.toml +++ b/crates/bevy_dice/Cargo.toml @@ -26,6 +26,9 @@ bevy = { version = "0.16", default-features = false, features = [ "std", ] } bevy_rand = { version = "0.11", default-features = false, features = [ + "compat", + "std", + "thread_local_entropy", "wyrand", ] } lazy_static = "1" diff --git a/crates/bevy_dice/src/lib.rs b/crates/bevy_dice/src/lib.rs index c10ff61..113bb60 100644 --- a/crates/bevy_dice/src/lib.rs +++ b/crates/bevy_dice/src/lib.rs @@ -158,7 +158,9 @@ fn throw_die( )], Transform { translation: Vec3::new(0.0, 4.0, 0.0), - //rotation: Quat::from_rng(rng.as_mut()), + rotation: trigger + .rotation + .unwrap_or_else(|| Quat::from_rng(rng.as_mut())), ..Default::default() }, RigidBody::Dynamic, -- 2.44.1