diff --git a/engine/physics/src/physics.rs b/engine/physics/src/physics.rs index b27ccd9..e14d5d4 100644 --- a/engine/physics/src/physics.rs +++ b/engine/physics/src/physics.rs @@ -1136,7 +1136,7 @@ impl PhysicsData{ //relative to moving platforms //let relative_body=state.body.relative_to(&Body::ZERO); let relative_body=&state.body; - data.bvh.the_tester(&aabb,&mut |&convex_mesh_id|{ + data.bvh.sample_aabb(&aabb,&mut |&convex_mesh_id|{ //no checks are needed because of the time limits. let model_mesh=data.models.mesh(convex_mesh_id); let minkowski=model_physics::MinkowskiMesh::minkowski_sum(model_mesh,data.hitbox_mesh.transformed_mesh()); @@ -1198,7 +1198,7 @@ fn recalculate_touching( aabb.inflate(hitbox_mesh.halfsize); //relative to moving platforms //let relative_body=state.body.relative_to(&Body::ZERO); - bvh.the_tester(&aabb,&mut |&convex_mesh_id|{ + bvh.sample_aabb(&aabb,&mut |&convex_mesh_id|{ //no checks are needed because of the time limits. let model_mesh=models.mesh(convex_mesh_id); let minkowski=model_physics::MinkowskiMesh::minkowski_sum(model_mesh,hitbox_mesh.transformed_mesh()); diff --git a/lib/common/src/bvh.rs b/lib/common/src/bvh.rs index 4328bf3..daed838 100644 --- a/lib/common/src/bvh.rs +++ b/lib/common/src/bvh.rs @@ -30,7 +30,7 @@ impl<T> BvhNode<T>{ aabb:Aabb::default(), } } - pub fn the_tester<F:FnMut(&T)>(&self,aabb:&Aabb,f:&mut F){ + pub fn sample_aabb<F:FnMut(&T)>(&self,aabb:&Aabb,f:&mut F){ match &self.content{ RecursiveContent::Leaf(model)=>f(model), RecursiveContent::Branch(children)=>for child in children{ @@ -39,7 +39,7 @@ impl<T> BvhNode<T>{ //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); + child.sample_aabb(aabb,f); } }, } diff --git a/lib/snf/src/map.rs b/lib/snf/src/map.rs index 0d91209..5661364 100644 --- a/lib/snf/src/map.rs +++ b/lib/snf/src/map.rs @@ -233,7 +233,7 @@ impl<R:BinReaderExt> StreamableMap<R>{ } pub fn get_intersecting_region_block_ids(&self,aabb:&Aabb)->Vec<BlockId>{ let mut block_ids=Vec::new(); - self.bvh.the_tester(aabb,&mut |&block_id|block_ids.push(block_id)); + self.bvh.sample_aabb(aabb,&mut |&block_id|block_ids.push(block_id)); block_ids } pub fn load_region(&mut self,block_id:BlockId)->Result<Vec<(model::ModelId,model::Model)>,Error>{