| 673 | } |
| 674 | |
| 675 | pub fn overlap_point(&mut self, world_h: f64, px: f32, py: f32, pz: f32, layer_mask: u32, max_results: u32) -> u32 { |
| 676 | self.overlap_cache.bodies.clear(); |
| 677 | let world = match self.worlds.get(world_h) { Some(&w) => w, None => return 0 }; |
| 678 | self.overlap_cache.bodies.resize(max_results as usize, BJ_INVALID); |
| 679 | let n = unsafe { |
| 680 | bj_query_overlap_point(world, |
| 681 | BjVec3 { x: px, y: py, z: pz }, layer_mask, |
| 682 | self.overlap_cache.bodies.as_mut_ptr(), max_results) |
| 683 | }; |
| 684 | self.overlap_cache.bodies.truncate(n as usize); |
| 685 | n |
| 686 | } |
| 687 | |
| 688 | #[allow(clippy::too_many_arguments)] |
| 689 | pub fn overlap_box( |