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

Method overlap_box

native/shared/src/physics_jolt.rs:689–705  ·  view source on GitHub ↗
(
        &mut self, world_h: f64,
        px: f32, py: f32, pz: f32, rx: f32, ry: f32, rz: f32, rw: f32,
        hx: f32, hy: f32, hz: f32,
        layer_mask: u32, max_results: u32,
    )

Source from the content-addressed store, hash-verified

687
688 #[allow(clippy::too_many_arguments)]
689 pub fn overlap_box(
690 &mut self, world_h: f64,
691 px: f32, py: f32, pz: f32, rx: f32, ry: f32, rz: f32, rw: f32,
692 hx: f32, hy: f32, hz: f32,
693 layer_mask: u32, max_results: u32,
694 ) -> u32 {
695 self.overlap_cache.bodies.clear();
696 let world = match self.worlds.get(world_h) { Some(&w) => w, None => return 0 };
697 self.overlap_cache.bodies.resize(max_results as usize, BJ_INVALID);
698 let xform = BjTransform { position: BjVec3 { x: px, y: py, z: pz }, rotation: BjQuat { x: rx, y: ry, z: rz, w: rw } };
699 let n = unsafe {
700 bj_query_overlap_box(world, &xform, BjVec3 { x: hx, y: hy, z: hz }, layer_mask,
701 self.overlap_cache.bodies.as_mut_ptr(), max_results)
702 };
703 self.overlap_cache.bodies.truncate(n as usize);
704 n
705 }
706
707 pub fn overlap_body(&self, i: usize) -> f64 {
708 self.overlap_cache.bodies.get(i)

Callers

nothing calls this directly

Calls 3

clearMethod · 0.45
getMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected