From 70a18d26e2c2a0ed21f4721cdb9b7ce10da93d3a Mon Sep 17 00:00:00 2001 From: Robert Walter <26892280+RobWalt@users.noreply.github.com> Date: Tue, 6 Aug 2024 03:28:00 +0200 Subject: [PATCH] Glam 0.28 update - adopted (#14613) Basically it's https://github.com/bevyengine/bevy/pull/13792 with the bumped versions of `encase` and `hexasphere`. --------- Co-authored-by: Robert Swain Co-authored-by: Alice Cecile --- benches/Cargo.toml | 2 +- crates/bevy_color/Cargo.toml | 2 +- crates/bevy_math/Cargo.toml | 5 ++--- crates/bevy_math/src/direction.rs | 2 +- crates/bevy_mikktspace/Cargo.toml | 2 +- crates/bevy_pbr/src/cluster/assign.rs | 4 ++-- crates/bevy_reflect/Cargo.toml | 2 +- crates/bevy_render/Cargo.toml | 4 ++-- crates/bevy_render/src/primitives/mod.rs | 2 +- 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/benches/Cargo.toml b/benches/Cargo.toml index d1163b0cd1..d4d308ebe8 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -6,7 +6,7 @@ publish = false license = "MIT OR Apache-2.0" [dev-dependencies] -glam = "0.27" +glam = "0.28" rand = "0.8" rand_chacha = "0.3" criterion = { version = "0.3", features = ["html_reports"] } diff --git a/crates/bevy_color/Cargo.toml b/crates/bevy_color/Cargo.toml index 4b2436ca12..25c79a1f47 100644 --- a/crates/bevy_color/Cargo.toml +++ b/crates/bevy_color/Cargo.toml @@ -18,7 +18,7 @@ bytemuck = { version = "1", features = ["derive"] } serde = { version = "1.0", features = ["derive"], optional = true } thiserror = "1.0" wgpu-types = { version = "0.20", default-features = false, optional = true } -encase = { version = "0.8", default-features = false } +encase = { version = "0.9", default-features = false } [features] default = ["bevy_reflect"] diff --git a/crates/bevy_math/Cargo.toml b/crates/bevy_math/Cargo.toml index 3db49afe32..d158075608 100644 --- a/crates/bevy_math/Cargo.toml +++ b/crates/bevy_math/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["bevy"] rust-version = "1.68.2" [dependencies] -glam = { version = "0.27", features = ["bytemuck"] } +glam = { version = "0.28", features = ["bytemuck"] } thiserror = "1.0" itertools = "0.13.0" serde = { version = "1", features = ["derive"], optional = true } @@ -33,8 +33,7 @@ rand = "0.8" rand_chacha = "0.3" # Enable the approx feature when testing. bevy_math = { path = ".", version = "0.15.0-dev", features = ["approx"] } -glam = { version = "0.27", features = ["approx"] } - +glam = { version = "0.28", features = ["approx"] } [features] default = ["rand", "bevy_reflect"] diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs index 87eeed58c8..2ecb33ebf2 100644 --- a/crates/bevy_math/src/direction.rs +++ b/crates/bevy_math/src/direction.rs @@ -208,7 +208,7 @@ impl Dir2 { /// ``` #[inline] pub fn slerp(self, rhs: Self, s: f32) -> Self { - let angle = self.angle_between(rhs.0); + let angle = self.angle_to(rhs.0); Rot2::radians(angle * s) * self } diff --git a/crates/bevy_mikktspace/Cargo.toml b/crates/bevy_mikktspace/Cargo.toml index 51d6f11d80..30372a6997 100644 --- a/crates/bevy_mikktspace/Cargo.toml +++ b/crates/bevy_mikktspace/Cargo.toml @@ -16,7 +16,7 @@ keywords = ["bevy", "3D", "graphics", "algorithm", "tangent"] rust-version = "1.76.0" [dependencies] -glam = "0.27" +glam = "0.28" [[example]] name = "generate" diff --git a/crates/bevy_pbr/src/cluster/assign.rs b/crates/bevy_pbr/src/cluster/assign.rs index 9727659bf6..f2a6cdc3ae 100644 --- a/crates/bevy_pbr/src/cluster/assign.rs +++ b/crates/bevy_pbr/src/cluster/assign.rs @@ -478,7 +478,7 @@ pub(crate) fn assign_objects_to_clusters( // as they often assume that the widest part of the sphere under projection is the // center point on the axis of interest plus the radius, and that is not true! let view_clusterable_object_sphere = Sphere { - center: Vec3A::from( + center: Vec3A::from_vec4( view_from_world * clusterable_object_sphere.center.extend(1.0), ), radius: clusterable_object_sphere.radius * view_from_world_scale_max, @@ -798,7 +798,7 @@ fn cluster_space_clusterable_object_aabb( clusterable_object_sphere: &Sphere, ) -> (Vec3, Vec3) { let clusterable_object_aabb_view = Aabb { - center: Vec3A::from(view_from_world * clusterable_object_sphere.center.extend(1.0)), + center: Vec3A::from_vec4(view_from_world * clusterable_object_sphere.center.extend(1.0)), half_extents: Vec3A::from(clusterable_object_sphere.radius * view_from_world_scale.abs()), }; let (mut clusterable_object_aabb_view_min, mut clusterable_object_aabb_view_max) = ( diff --git a/crates/bevy_reflect/Cargo.toml b/crates/bevy_reflect/Cargo.toml index 850c04272c..5cfbf83300 100644 --- a/crates/bevy_reflect/Cargo.toml +++ b/crates/bevy_reflect/Cargo.toml @@ -35,7 +35,7 @@ thiserror = "1.0" serde = "1" smallvec = { version = "1.11", optional = true } -glam = { version = "0.27", features = ["serde"], optional = true } +glam = { version = "0.28", features = ["serde"], optional = true } petgraph = { version = "0.6", features = ["serde-1"], optional = true } smol_str = { version = "0.2.0", optional = true } uuid = { version = "1.0", optional = true, features = ["v4", "serde"] } diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index 1ebe24ca9a..c48697ff69 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -85,7 +85,7 @@ bytemuck = { version = "1.5", features = ["derive", "must_cast"] } downcast-rs = "1.2.0" thiserror = "1.0" futures-lite = "2.0.1" -hexasphere = "12.0" +hexasphere = "14.0" ddsfile = { version = "0.5.2", optional = true } ktx2 = { version = "0.3.0", optional = true } # For ktx2 supercompression @@ -93,7 +93,7 @@ flate2 = { version = "1.0.22", optional = true } ruzstd = { version = "0.7.0", optional = true } # For transcoding of UASTC/ETC1S universal formats, and for .basis file support basis-universal = { version = "0.3.0", optional = true } -encase = { version = "0.8", features = ["glam"] } +encase = { version = "0.9", features = ["glam"] } # For wgpu profiling using tracing. Use `RUST_LOG=info` to also capture the wgpu spans. profiling = { version = "1", features = [ "profile-with-tracing", diff --git a/crates/bevy_render/src/primitives/mod.rs b/crates/bevy_render/src/primitives/mod.rs index 89478063dc..921a2cbc44 100644 --- a/crates/bevy_render/src/primitives/mod.rs +++ b/crates/bevy_render/src/primitives/mod.rs @@ -168,7 +168,7 @@ impl HalfSpace { /// Returns the unit normal vector of the bisecting plane that characterizes the `HalfSpace`. #[inline] pub fn normal(&self) -> Vec3A { - Vec3A::from(self.normal_d) + Vec3A::from_vec4(self.normal_d) } /// Returns the signed distance from the bisecting plane to the origin along