use num::Float; use na::Transform; use na; use point::PointQuery; use entities::shape::Plane; use math::{Point, Vector}; impl
PointQuery
for Plane {
#[inline]
fn project_point(&self, m: &M, pt: &P, solid: bool) -> P {
let ls_pt = m.inverse_transform(pt);
let d = na::dot(self.normal(), ls_pt.as_vector());
if d < na::zero() && solid {
pt.clone()
}
else {
*pt + (-*self.normal() * d)
}
}
#[inline]
fn distance_to_point(&self, m: &M, pt: &P) ->