ncollide_utils 0.9.1

DEPRECATED: use ncollide2d or ncollide3d insead.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use na::FromHomogeneous;
use na;

/// Project n-d point to a (n-1)-d space, dividing each vector by its `w` component.
pub fn project_homogeneous<V: FromHomogeneous<VHomo>, VHomo>(pts: &mut [VHomo]) -> Vec<V> {
    let mut res = Vec::with_capacity(pts.len());

    project_homogeneous_to(pts, &mut res);

    res
}

/// Project n-d point to a (n-1)-d space, dividing each vector by its `w` component.
pub fn project_homogeneous_to<V: FromHomogeneous<VHomo>, VHomo>(pts: &[VHomo], out: &mut Vec<V>) {
    for pt in pts.iter() {
        out.push(na::from_homogeneous(pt));
    }
}