Some quite aggressive commit... 😢
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user