MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / overlap_sphere

Method overlap_sphere

native/shared/src/physics_jolt.rs:662–673  ·  view source on GitHub ↗
(&mut self, world_h: f64, cx: f32, cy: f32, cz: f32, r: f32, layer_mask: u32, max_results: u32)

Source from the content-addressed store, hash-verified

660 }
661
662 pub fn overlap_sphere(&mut self, world_h: f64, cx: f32, cy: f32, cz: f32, r: f32, layer_mask: u32, max_results: u32) -> u32 {
663 self.overlap_cache.bodies.clear();
664 let world = match self.worlds.get(world_h) { Some(&w) => w, None => return 0 };
665 self.overlap_cache.bodies.resize(max_results as usize, BJ_INVALID);
666 let n = unsafe {
667 bj_query_overlap_sphere(world,
668 BjVec3 { x: cx, y: cy, z: cz }, r, layer_mask,
669 self.overlap_cache.bodies.as_mut_ptr(), max_results)
670 };
671 self.overlap_cache.bodies.truncate(n as usize);
672 n
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();

Callers

nothing calls this directly

Calls 3

clearMethod · 0.45
getMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected