Skip to content

Commit f14300e

Browse files
authored
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
1 parent 8320dc3 commit f14300e

File tree

1 file changed

+59
-0
lines changed
  • crates/bevy_reflect/src/impls

1 file changed

+59
-0
lines changed

crates/bevy_reflect/src/impls/glam.rs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,36 @@ impl_reflect_struct!(
3232
}
3333
);
3434

35+
impl_reflect_struct!(
36+
#[reflect(Debug, Hash, PartialEq, Default)]
37+
#[type_path = "glam"]
38+
struct I64Vec2 {
39+
x: i64,
40+
y: i64,
41+
}
42+
);
43+
44+
impl_reflect_struct!(
45+
#[reflect(Debug, Hash, PartialEq, Default)]
46+
#[type_path = "glam"]
47+
struct I64Vec3 {
48+
x: i64,
49+
y: i64,
50+
z: i64,
51+
}
52+
);
53+
54+
impl_reflect_struct!(
55+
#[reflect(Debug, Hash, PartialEq, Default)]
56+
#[type_path = "glam"]
57+
struct I64Vec4 {
58+
x: i64,
59+
y: i64,
60+
z: i64,
61+
w: i64,
62+
}
63+
);
64+
3565
impl_reflect_struct!(
3666
#[reflect(Debug, Hash, PartialEq, Default)]
3767
#[type_path = "glam"]
@@ -59,6 +89,35 @@ impl_reflect_struct!(
5989
w: u32,
6090
}
6191
);
92+
93+
impl_reflect_struct!(
94+
#[reflect(Debug, Hash, PartialEq, Default)]
95+
#[type_path = "glam"]
96+
struct U64Vec2 {
97+
x: u64,
98+
y: u64,
99+
}
100+
);
101+
impl_reflect_struct!(
102+
#[reflect(Debug, Hash, PartialEq, Default)]
103+
#[type_path = "glam"]
104+
struct U64Vec3 {
105+
x: u64,
106+
y: u64,
107+
z: u64,
108+
}
109+
);
110+
impl_reflect_struct!(
111+
#[reflect(Debug, Hash, PartialEq, Default)]
112+
#[type_path = "glam"]
113+
struct U64Vec4 {
114+
x: u64,
115+
y: u64,
116+
z: u64,
117+
w: u64,
118+
}
119+
);
120+
62121
impl_reflect_struct!(
63122
#[reflect(Debug, PartialEq, Default)]
64123
#[type_path = "glam"]

0 commit comments

Comments
 (0)