From f14300e5d30f6e73c649214675f2352aefcdcf0e Mon Sep 17 00:00:00 2001 From: PortalRising <82708297+PortalRising@users.noreply.github.com> Date: Mon, 31 Jul 2023 20:18:21 +0100 Subject: [PATCH] Implement reflect trait on new glam types (I64Vec and U64Vec) (#9281) # Objective Glam 0.24 added new glam types (```I64Vec``` and ```U64Vec```). However these are not reflectable unlike the other glam types ## Solution Implement reflect for these new types --- ## Changelog Implements reflect with the impl_reflect_struct macro on ```I64Vec2```, ```I64Vec3```, ```I64Vec4```, ```U64Vec2```, ```U64Vec3```, and ```U64Vec4``` types --- crates/bevy_reflect/src/impls/glam.rs | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/crates/bevy_reflect/src/impls/glam.rs b/crates/bevy_reflect/src/impls/glam.rs index e5f481e71c..9a20b098ce 100644 --- a/crates/bevy_reflect/src/impls/glam.rs +++ b/crates/bevy_reflect/src/impls/glam.rs @@ -32,6 +32,36 @@ impl_reflect_struct!( } ); +impl_reflect_struct!( + #[reflect(Debug, Hash, PartialEq, Default)] + #[type_path = "glam"] + struct I64Vec2 { + x: i64, + y: i64, + } +); + +impl_reflect_struct!( + #[reflect(Debug, Hash, PartialEq, Default)] + #[type_path = "glam"] + struct I64Vec3 { + x: i64, + y: i64, + z: i64, + } +); + +impl_reflect_struct!( + #[reflect(Debug, Hash, PartialEq, Default)] + #[type_path = "glam"] + struct I64Vec4 { + x: i64, + y: i64, + z: i64, + w: i64, + } +); + impl_reflect_struct!( #[reflect(Debug, Hash, PartialEq, Default)] #[type_path = "glam"] @@ -59,6 +89,35 @@ impl_reflect_struct!( w: u32, } ); + +impl_reflect_struct!( + #[reflect(Debug, Hash, PartialEq, Default)] + #[type_path = "glam"] + struct U64Vec2 { + x: u64, + y: u64, + } +); +impl_reflect_struct!( + #[reflect(Debug, Hash, PartialEq, Default)] + #[type_path = "glam"] + struct U64Vec3 { + x: u64, + y: u64, + z: u64, + } +); +impl_reflect_struct!( + #[reflect(Debug, Hash, PartialEq, Default)] + #[type_path = "glam"] + struct U64Vec4 { + x: u64, + y: u64, + z: u64, + w: u64, + } +); + impl_reflect_struct!( #[reflect(Debug, PartialEq, Default)] #[type_path = "glam"]