use na::{Scalar, Real, DimName, U3, DefaultAllocator}; use traits::{Number, Alloc}; use aliases::Vec; pub fn cross(x: &Vec, y: &Vec) -> Vec { x.cross(y) } pub fn distance(p0: &Vec, p1: &Vec) -> N where DefaultAllocator: Alloc { (p1 - p0).norm() } pub fn dot(x: &Vec, y: &Vec) -> N where DefaultAllocator: Alloc { x.dot(y) } pub fn faceforward(N: &Vec, I: &Vec, Nref: &Vec) -> Vec where DefaultAllocator: Alloc { unimplemented!() } pub fn length(x: &Vec) -> N where DefaultAllocator: Alloc { x.norm() } pub fn normalize(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.normalize() } pub fn reflect(I: &Vec, N: &Vec) -> Vec where DefaultAllocator: Alloc { unimplemented!() } pub fn refract(I: &Vec, N: &Vec, eta: N) -> Vec where DefaultAllocator: Alloc { unimplemented!() }