diff --git a/Cargo.lock b/Cargo.lock index 020db95..3b45ba8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,7 +444,7 @@ version = "0.1.0" dependencies = [ "anyhow", "ash-window", - "glam 0.29.3", + "glam 0.33.2", "raw-window-handle", "renderer", "serde_json", @@ -816,24 +816,18 @@ dependencies = [ [[package]] name = "glam" -version = "0.27.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" +checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0" dependencies = [ - "serde", + "serde_core", ] [[package]] name = "glam" -version = "0.29.3" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8babf46d4c1c9d92deac9f7be466f76dfc4482b6452fc5024b5e8daf6ffeb3ee" - -[[package]] -name = "glam" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0" +checksum = "7f22fb22f065b308be0d8724e3706c7fa3fc2a6c7d6899df4cad7860e7a75436" dependencies = [ "serde_core", ] @@ -1649,7 +1643,7 @@ dependencies = [ "ash", "ash-window", "bytemuck", - "glam 0.29.3", + "glam 0.33.2", "gpu-allocator", "raw-window-handle", "thiserror 2.0.18", @@ -1784,7 +1778,7 @@ version = "0.1.0" dependencies = [ "bevy_ecs", "crossbeam-channel", - "glam 0.27.0", + "glam 0.33.2", "serde_json", "shared", "tracing", @@ -1806,7 +1800,7 @@ version = "0.1.0" dependencies = [ "bytemuck", "fastrand", - "glam 0.27.0", + "glam 0.33.2", "noise", "serde", ] diff --git a/Cargo.toml b/Cargo.toml index ce4ee22..024f630 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,16 @@ authors = ["Cryoforge Nexus"] edition = "2024" version = "0.1.0" +# Dependencies used by more than one crate are pinned once here so a version can never drift between crates. +[workspace.dependencies] +glam = { version = "0.33", features = ["serde"] } +bytemuck = { version = "1.21", features = ["derive"] } +tracing = "0.1.44" +tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } +serde_json = "1.0.149" +ash-window = "0.13.0" +raw-window-handle = "0.6.2" + [workspace.lints.rust] unsafe_code = "warn" missing_docs = "warn" diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index 9f85e4b..cbfaa00 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -10,12 +10,12 @@ workspace = true [dependencies] anyhow = "1.0.102" -tracing = "0.1.44" -tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } winit = "0.30.13" renderer = { path = "../renderer" } -glam = "0.29" -raw-window-handle = "0.6.2" -ash-window = "0.13.0" -serde_json = "1.0.149" +glam = { workspace = true } +raw-window-handle = { workspace = true } +ash-window = { workspace = true } +serde_json = { workspace = true } shared = { version = "0.1.0", path = "../shared" } diff --git a/crates/client/src/camera.rs b/crates/client/src/camera.rs index 1aee458..1d67ba2 100644 --- a/crates/client/src/camera.rs +++ b/crates/client/src/camera.rs @@ -55,7 +55,7 @@ impl Camera { /// Builds the right-handed view matrix for the current position and orientation. #[must_use] pub fn view_matrix(&self) -> Mat4 { - Mat4::look_at_rh(self.position, self.position + self.forward(), Vec3::Y) + glam::camera::rh::view::look_at_mat4(self.position, self.position + self.forward(), Vec3::Y) } /// Advances the camera by a single frame, applying `input` accumulated over `dt` seconds. diff --git a/crates/renderer/Cargo.toml b/crates/renderer/Cargo.toml index 26757b7..f2b7d6a 100644 --- a/crates/renderer/Cargo.toml +++ b/crates/renderer/Cargo.toml @@ -10,10 +10,10 @@ workspace = true [dependencies] ash = "0.38.0" -ash-window = "0.13.0" -raw-window-handle = "0.6.2" +ash-window = { workspace = true } +raw-window-handle = { workspace = true } thiserror = "2.0.18" -tracing = "0.1.44" +tracing = { workspace = true } gpu-allocator = "0.28.0" -bytemuck = { version = "1.21", features = ["derive"] } -glam = "0.29" +bytemuck = { workspace = true } +glam = { workspace = true } diff --git a/crates/renderer/src/renderer.rs b/crates/renderer/src/renderer.rs index d12d320..b357a92 100644 --- a/crates/renderer/src/renderer.rs +++ b/crates/renderer/src/renderer.rs @@ -286,11 +286,14 @@ impl Renderer { let aspect = f64::from(self.swapchain_extent.width) / f64::from(self.swapchain_extent.height); + #[expect(clippy::cast_possible_truncation)] - let mut projection = - glam::Mat4::perspective_rh(45.0_f32.to_radians(), aspect as f32, 0.1, 500.0); - // Vulkan clip space inverts the Y axis relative to the OpenGL convention glam targets. - projection.col_mut(1).y *= -1.0; + let projection = glam::camera::rh::proj::vulkan::perspective( + 45.0_f32.to_radians(), + aspect as f32, + 0.1, + 500.0, + ); // The view matrix is supplied by the caller (the client's camera); the renderer owns only the projection, which depends on the swapchain aspect ratio it manages. let mvp = projection * camera_view; diff --git a/crates/server/Cargo.toml b/crates/server/Cargo.toml index 87da38d..1002923 100644 --- a/crates/server/Cargo.toml +++ b/crates/server/Cargo.toml @@ -11,8 +11,8 @@ workspace = true [dependencies] bevy_ecs = "0.19" crossbeam-channel = "0.5.16" -glam = "0.27" -serde_json = "1.0.149" +glam = { workspace = true } +serde_json = { workspace = true } shared = { version = "0.1.0", path = "../shared" } -tracing = "0.1.44" -tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index ed3cd05..c0b416f 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -9,8 +9,8 @@ authors.workspace = true workspace = true [dependencies] -bytemuck = { version = "1.15", features = ["derive"] } +bytemuck = { workspace = true } fastrand = "2.4.1" -glam = { version = "0.27", features = ["serde"] } +glam = { workspace = true } noise = "0.9" serde = { version = "1.0", features = ["derive"] }