From dc46cb3d457ce94016fe0a98771fb2542f92be6b Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 3 Nov 2023 18:57:13 -0700 Subject: [PATCH] delete unused aabb face code --- src/aabb.rs | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/src/aabb.rs b/src/aabb.rs index 14e7844..4e4d0df 100644 --- a/src/aabb.rs +++ b/src/aabb.rs @@ -1,14 +1,5 @@ use crate::integer::Planar64Vec3; -#[derive(Debug,Clone,Copy,Hash,Eq,PartialEq)] -pub enum AabbFace{ - Right,//+X - Top, - Back, - Left, - Bottom, - Front, -} #[derive(Clone)] pub struct Aabb{ pub min:Planar64Vec3, @@ -22,17 +13,6 @@ impl Default for Aabb { } impl Aabb{ - const VERTEX_DATA:[Planar64Vec3;8]=[ - Planar64Vec3::int( 1,-1,-1), - Planar64Vec3::int( 1, 1,-1), - Planar64Vec3::int( 1, 1, 1), - Planar64Vec3::int( 1,-1, 1), - Planar64Vec3::int(-1,-1, 1), - Planar64Vec3::int(-1, 1, 1), - Planar64Vec3::int(-1, 1,-1), - Planar64Vec3::int(-1,-1,-1), - ]; - pub fn grow(&mut self,point:Planar64Vec3){ self.min=self.min.min(point); self.max=self.max.max(point); @@ -48,32 +28,6 @@ impl Aabb{ pub fn intersects(&self,aabb:&Aabb)->bool{ (self.min.cmplt(aabb.max)&aabb.min.cmplt(self.max)).all() } - pub fn normal(face:AabbFace)->Planar64Vec3{ - match face { - AabbFace::Right=>Planar64Vec3::int(1,0,0), - AabbFace::Top=>Planar64Vec3::int(0,1,0), - AabbFace::Back=>Planar64Vec3::int(0,0,1), - AabbFace::Left=>Planar64Vec3::int(-1,0,0), - AabbFace::Bottom=>Planar64Vec3::int(0,-1,0), - AabbFace::Front=>Planar64Vec3::int(0,0,-1), - } - } - pub fn unit_vertices()->[Planar64Vec3;8] { - return Self::VERTEX_DATA; - } - // pub fn face(&self,face:AabbFace)->Aabb { - // let mut aabb=self.clone(); - // //in this implementation face = worldspace aabb face - // match face { - // AabbFace::Right => aabb.min.x=aabb.max.x, - // AabbFace::Top => aabb.min.y=aabb.max.y, - // AabbFace::Back => aabb.min.z=aabb.max.z, - // AabbFace::Left => aabb.max.x=aabb.min.x, - // AabbFace::Bottom => aabb.max.y=aabb.min.y, - // AabbFace::Front => aabb.max.z=aabb.min.z, - // } - // return aabb; - // } pub fn center(&self)->Planar64Vec3{ return self.min.midpoint(self.max) }