From 5b8e5c8899f6b4e4543a3beaaa106cb28f8909c3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Dec 2023 15:47:31 -0800 Subject: [PATCH] we're not using floats anymore --- src/bvh.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bvh.rs b/src/bvh.rs index 24803fc4..f4c9bc6c 100644 --- a/src/bvh.rs +++ b/src/bvh.rs @@ -72,9 +72,9 @@ fn generate_bvh_node(boxen:Vec<(usize,Aabb)>)->BvhNode{ sort_y.push((*i,center.y())); sort_z.push((*i,center.z())); } - sort_x.sort_by(|tup0,tup1|tup0.1.partial_cmp(&tup1.1).unwrap()); - sort_y.sort_by(|tup0,tup1|tup0.1.partial_cmp(&tup1.1).unwrap()); - sort_z.sort_by(|tup0,tup1|tup0.1.partial_cmp(&tup1.1).unwrap()); + sort_x.sort_by(|tup0,tup1|tup0.1.cmp(&tup1.1)); + sort_y.sort_by(|tup0,tup1|tup0.1.cmp(&tup1.1)); + sort_z.sort_by(|tup0,tup1|tup0.1.cmp(&tup1.1)); let h=n/2; let median_x=sort_x[h].1; let median_y=sort_y[h].1;