Skip to content

Commit

Permalink
Implement reflect trait on new glam types (I64Vec and U64Vec) (#9281)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
PortalRising authored Jul 31, 2023
1 parent 8320dc3 commit f14300e
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions crates/bevy_reflect/src/impls/glam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit f14300e

Please sign in to comment.