mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
trying to get new Bsp to work; update docs
This commit is contained in:
parent
c9b81edb45
commit
62ce1776c0
11 changed files with 301 additions and 157 deletions
|
|
@ -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()]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue