cleanup
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
use crate::{node::Node, ray::*, EPSILON};
|
use crate::{node::Node, ray::*, EPSILON};
|
||||||
use nalgebra::{point, Point3, Vector3};
|
use nalgebra::{Point3, Vector3};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ops::Index;
|
use std::ops::Index;
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ impl BVH {
|
|||||||
|
|
||||||
// Get the root node and assign it to index 0
|
// Get the root node and assign it to index 0
|
||||||
let mut root = &bvh_nodes[root_node_index];
|
let mut root = &bvh_nodes[root_node_index];
|
||||||
(root.l_idx, root.r_idx) = (0, 0); //Root node has no children to begin with
|
root.l_idx = 0; //Root node has no children to begin with
|
||||||
(root.first_prim, root.prim_count) = (0, n); //Make root include all n nodes
|
(root.first_prim, root.prim_count) = (0, n); //Make root include all n nodes
|
||||||
tree.update_bvh_node_aabb(root_node_index); //Fit the root nodes AABB
|
tree.update_bvh_node_aabb(root_node_index); //Fit the root nodes AABB
|
||||||
tree.subdivide(root_node_index);
|
tree.subdivide(root_node_index);
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ impl Mesh {
|
|||||||
trf = trf.sup(&triangle.v);
|
trf = trf.sup(&triangle.v);
|
||||||
trf = trf.sup(&triangle.w);
|
trf = trf.sup(&triangle.w);
|
||||||
}
|
}
|
||||||
AABB { bln, trf }
|
AABB::new(bln, trf)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_file(filename: &str) -> Rc<dyn Primitive> {
|
pub fn from_file(filename: &str) -> Rc<dyn Primitive> {
|
||||||
@@ -881,18 +881,18 @@ impl Primitive for Gnonom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_aabb(&self) -> AABB {
|
fn get_aabb(&self) -> AABB {
|
||||||
AABB {
|
AABB::new(
|
||||||
bln: Point3::new(
|
Point3::new(
|
||||||
-Self::GNONOM_WIDTH,
|
-Self::GNONOM_WIDTH,
|
||||||
-Self::GNONOM_WIDTH,
|
-Self::GNONOM_WIDTH,
|
||||||
-Self::GNONOM_WIDTH,
|
-Self::GNONOM_WIDTH,
|
||||||
),
|
),
|
||||||
trf: Point3::new(
|
Point3::new(
|
||||||
Self::GNONOM_LENGTH,
|
Self::GNONOM_LENGTH,
|
||||||
Self::GNONOM_LENGTH,
|
Self::GNONOM_LENGTH,
|
||||||
Self::GNONOM_LENGTH,
|
Self::GNONOM_LENGTH,
|
||||||
),
|
),
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user