Skip to content

Commit ccd51f8

Browse files
committed
Add AABB:from_two_points
1 parent 5bc8768 commit ccd51f8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

blobs/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ impl AABB {
8989
Self { min, max }
9090
}
9191

92+
pub fn from_two_points(a: Vec2, b: Vec2) -> Self {
93+
Self {
94+
min: a.min(b),
95+
max: a.max(b),
96+
}
97+
}
98+
9299
pub fn from_top_left(top_left: Vec2, size: Vec2) -> Self {
93100
Self::from_center_size(
94101
vec2(top_left.x + size.x / 2.0, top_left.y - size.y / 2.0),

0 commit comments

Comments
 (0)