Some quite aggressive commit... 😢

This commit is contained in:
Thomas Forgione
2018-04-17 10:45:44 +02:00
parent c5b04aef9d
commit 25ee1fefce
18 changed files with 563 additions and 507 deletions
+14
View File
@@ -80,6 +80,20 @@ macro_rules! make_bounding_box {
}
ret
}
/// Returns the bounding box of the union of two bounding boxes.
pub fn union(&self, other: &$name<T>) -> $name<T> {
let mut ret = self.clone();
for i in 0..$size {
if ret.min()[i] > other.min()[i] {
ret.min_mut()[i] = other.min()[i];
}
if ret.max()[i] < other.max()[i] {
ret.max_mut()[i] = other.max()[i];
}
}
ret
}
}
}