Created abbreviations for common geometry types
This commit is contained in:
parent
ed6e84a240
commit
07445dd4be
8 changed files with 70 additions and 57 deletions
|
|
@ -3,13 +3,13 @@ extern crate nalgebra as na;
|
|||
// use na::distance;
|
||||
use na::geometry::Point3;
|
||||
|
||||
use crate::types::Ray;
|
||||
use crate::types::*;
|
||||
|
||||
// A bounding sphere, used for
|
||||
// intersection test optimization.
|
||||
#[derive(Debug)]
|
||||
pub struct Bound {
|
||||
pub center: Point3<f32>,
|
||||
pub center: Point3f,
|
||||
pub radius: f32,
|
||||
|
||||
// If true, then the bounding sphere is disabled.
|
||||
|
|
@ -24,7 +24,7 @@ impl Bound {
|
|||
l.norm_squared() >= self.radius * self.radius
|
||||
}
|
||||
|
||||
// pub fn contains(&self, point: &Point3<f32>) -> bool { distance(&self.center, point) < self.radius }
|
||||
// pub fn contains(&self, point: &Point3f) -> bool { distance(&self.center, point) < self.radius }
|
||||
|
||||
pub fn bypass() -> Self { Bound { center: Point3::origin(), radius: 0.0, bypass: true } }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue