diff --git a/src/math/aabb.rs b/src/math/aabb.rs index 80798a758..db1ba105f 100644 --- a/src/math/aabb.rs +++ b/src/math/aabb.rs @@ -3,6 +3,7 @@ use parry3d_f64::bounding_volume::BoundingVolume as _; use super::{Point, Vector}; /// An axis-aligned bounding box (AABB) +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Aabb { /// The minimum coordinates of the AABB pub min: Point, diff --git a/src/math/point.rs b/src/math/point.rs index 839159753..1b0571241 100644 --- a/src/math/point.rs +++ b/src/math/point.rs @@ -12,7 +12,7 @@ use super::{Scalar, Vector}; /// /// The goal of this type is to eventually implement `Eq` and `Hash`, making it /// easier to work with vectors. This is a work in progress. -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Point([Scalar; D]); impl Point { diff --git a/src/math/segment.rs b/src/math/segment.rs index 11d3ae273..6b0937841 100644 --- a/src/math/segment.rs +++ b/src/math/segment.rs @@ -1,7 +1,7 @@ use super::Point; /// A line segment, defined by its two end points -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Segment { pub a: Point, pub b: Point, diff --git a/src/math/triangle.rs b/src/math/triangle.rs index cff5e9739..d1f230da4 100644 --- a/src/math/triangle.rs +++ b/src/math/triangle.rs @@ -1,7 +1,7 @@ use super::Point; /// A triangle -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Triangle { pub a: Point<3>, pub b: Point<3>, diff --git a/src/math/vector.rs b/src/math/vector.rs index d122da117..26d78cc4a 100644 --- a/src/math/vector.rs +++ b/src/math/vector.rs @@ -12,7 +12,7 @@ use super::Scalar; /// /// The goal of this type is to eventually implement `Eq` and `Hash`, making it /// easier to work with vectors. This is a work in progress. -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct Vector([Scalar; D]); impl Vector {