New methods
This commit is contained in:
@@ -9,7 +9,7 @@ macro_rules! make_bounding_box {
|
||||
use math::vector::$vector;
|
||||
|
||||
/// Represents a bounding box.
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct $name<T> {
|
||||
min: $vector<T>,
|
||||
max: $vector<T>,
|
||||
@@ -137,13 +137,16 @@ mod tests {
|
||||
Vector3::new(3, 3, 3),
|
||||
);
|
||||
|
||||
let b = b1.intersection(&b2);
|
||||
assert_eq!(b.min().x(), 1);
|
||||
assert_eq!(b.min().y(), 1);
|
||||
assert_eq!(b.min().z(), 1);
|
||||
let bb1 = b1.intersection(&b2);
|
||||
assert_eq!(bb1.min().x(), 1);
|
||||
assert_eq!(bb1.min().y(), 1);
|
||||
assert_eq!(bb1.min().z(), 1);
|
||||
|
||||
assert_eq!(b.max().x(), 2);
|
||||
assert_eq!(b.max().y(), 2);
|
||||
assert_eq!(b.max().z(), 2);
|
||||
assert_eq!(bb1.max().x(), 2);
|
||||
assert_eq!(bb1.max().y(), 2);
|
||||
assert_eq!(bb1.max().z(), 2);
|
||||
|
||||
let bb2 = b2.intersection(&b1);
|
||||
assert_eq!(bb1, bb2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user