trying to get new Bsp to work; update docs

This commit is contained in:
🪞👃🪞 2024-12-31 19:21:48 +01:00
parent c9b81edb45
commit 62ce1776c0
11 changed files with 301 additions and 157 deletions

View file

@ -78,7 +78,7 @@ impl<N: Coordinate> Size<N> for [N;2] {
#[inline] fn y (&self) -> N { self[1] }
}
pub trait Area<N: Coordinate>: Copy {
pub trait Area<N: Coordinate> {
fn x (&self) -> N;
fn y (&self) -> N;
fn w (&self) -> N;
@ -133,6 +133,10 @@ pub trait Area<N: Coordinate>: Copy {
[self.x(), self.y(), self.w(), self.h().minus(y)]
}
#[inline] fn center (&self) -> [N;2] {
[self.x() + self.w() / 2.into(), self.y() + self.h() / 2.into()]
}
fn zero () -> [N;4] {
[N::zero(), N::zero(), N::zero(), N::zero()]
}