diff --git a/src/bin/flat/main.rs b/src/bin/flat/main.rs index c5f4f56..42ff2dc 100644 --- a/src/bin/flat/main.rs +++ b/src/bin/flat/main.rs @@ -4,7 +4,7 @@ use flo_canvas::*; use flo_draw::*; use glam::*; -use crate::ifaces::DebugTraceable; +use crate::ifaces::{DebugTraceable, Traceable}; use crate::types::FlatTraceResult; use refraction::mathx::MatExt; use riemann::{trace_iter, Metric}; @@ -200,6 +200,12 @@ fn draw_cross(gc: &mut Vec, pos: Vec2, r: f32) { fn draw_ray_2(gc: &mut Vec, space: &Space, camera: Location, dir: Vec2) { let pos = vec2(0., 0.); let (hits, path) = space.trace_dbg(camera, Ray { pos, dir }); + let hits2 = space.trace(camera, Ray { pos, dir }); + for (a, b) in hits.into_iter().zip(hits2.into_iter()) { + assert_eq!(a.id, b.id); + assert_eq!(a.pos, b.pos); + assert_eq!(a.rel, b.rel); + } gc.new_path(); gc.move_to(pos.x, pos.y);