Function aabb2::expand_point[][src]

pub fn expand_point<'out, T>(
    out: &'out mut AABB2<T>,
    aabb2: &AABB2<T>,
    p: &[T; 2]
) -> &'out mut AABB2<T> where
    T: Clone + PartialOrd

expands the aabb to include the point

Examples

use aabb2::{self, AABB2};
let mut a = aabb2::new_identity();
let b = aabb2::new([-1.0, -1.0], [1.0, 1.0]);
assert_eq!(
    aabb2::expand_point(&mut a, &b, &[2.0, 2.0]),
    &AABB2{ min: [-1.0, -1.0], max: [2.0, 2.0] }
);