comment on intersection test location

This commit is contained in:
Quaternions 2023-10-30 19:16:24 -07:00
parent a3340143db
commit 8fc6a7fb8f

View File

@ -29,6 +29,10 @@ impl BvhNode{
match &self.content{ match &self.content{
&BvhNodeContent::Leaf(model)=>f(model), &BvhNodeContent::Leaf(model)=>f(model),
BvhNodeContent::Branch(children)=>for child in children{ 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){ if aabb.intersects(&child.aabb){
child.the_tester(aabb,f); child.the_tester(aabb,f);
} }