From 24e2879b78b388d2e4984cb9e439242f40f9d61d Mon Sep 17 00:00:00 2001 From: Thomas Duindam <76484202+thomas-tribus@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:19:15 +0200 Subject: [PATCH 1/2] Update glam to latest version --- fake/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fake/Cargo.toml b/fake/Cargo.toml index fabb77e..ebe90ec 100644 --- a/fake/Cargo.toml +++ b/fake/Cargo.toml @@ -35,7 +35,7 @@ rust_decimal = { version = "1.32", default-features = false, optional = true } bigdecimal-rs = { version = "0.4", package = "bigdecimal", default-features = false, optional = true } zerocopy = { version = "0.7", optional = true } rand_core = { version = "0.6", optional = true } -glam = { version = "0.28.0", optional = true } +glam = { version = "0.29.0", optional = true } url-escape = { version = "0.1", optional = true } bson = { version = "2.10", optional = true } url = { version = "2.5.2", optional = true } From b25f87208c74d8083e8718c14380f4adfc91098d Mon Sep 17 00:00:00 2001 From: Thomas Duindam Date: Mon, 2 Sep 2024 09:39:23 +0200 Subject: [PATCH 2/2] Also add support for Mat3. Was omitted earlier for no clear reason, might as well have it too. --- fake/src/impls/glam/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fake/src/impls/glam/mod.rs b/fake/src/impls/glam/mod.rs index 54e2273..390670a 100644 --- a/fake/src/impls/glam/mod.rs +++ b/fake/src/impls/glam/mod.rs @@ -1,5 +1,15 @@ use crate::{Dummy, Fake, Faker}; -use glam::{Mat4, Vec2, Vec3, Vec4}; +use glam::{Mat3, Mat4, Vec2, Vec3, Vec4}; + +impl Dummy for Mat3 { + fn dummy_with_rng(_f: &Faker, rng: &mut R) -> Self { + let col_1: Vec3 = Faker.fake_with_rng(rng); + let col_2: Vec3 = Faker.fake_with_rng(rng); + let col_3: Vec3 = Faker.fake_with_rng(rng); + Mat3::from_cols(col_1, col_2, col_3) + } +} + impl Dummy for Mat4 { fn dummy_with_rng(_f: &Faker, rng: &mut R) -> Self {