New methods
This commit is contained in:
parent
c32a378caf
commit
191ca7fdd6
|
@ -2,3 +2,4 @@
|
|||
/target/
|
||||
**/*.rs.bk
|
||||
Cargo.lock
|
||||
assets
|
||||
|
|
|
@ -7,6 +7,7 @@ authors = ["Thomas Forgione <thomas@tforgione.fr>"]
|
|||
num = "*"
|
||||
glium = "*"
|
||||
verbose-log = { git = "https://gitea.tforgione.fr/dash-3d/verbose-log" }
|
||||
byteorder = "*"
|
||||
|
||||
[[bin]]
|
||||
name = "3d-viewer"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![warn(missing_docs)]
|
||||
|
||||
extern crate num;
|
||||
|
||||
#[macro_use] extern crate verbose_log;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue