From 8fc6a7fb8f01341bf076b02db850c05e4273be62 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 30 Oct 2023 19:16:24 -0700 Subject: [PATCH] comment on intersection test location --- src/bvh.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bvh.rs b/src/bvh.rs index 6166c359..24803fc4 100644 --- a/src/bvh.rs +++ b/src/bvh.rs @@ -29,6 +29,10 @@ impl BvhNode{ match &self.content{ &BvhNodeContent::Leaf(model)=>f(model), BvhNodeContent::Branch(children)=>for child in children{ + //this test could be moved outside the match statement + //but that would test the root node aabb + //you're probably not going to spend a lot of time outside the map, + //so the test is extra work for nothing if aabb.intersects(&child.aabb){ child.the_tester(aabb,f); }