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

Function bloom_scene_pick_all

native/web/src/lib.rs:2019–2032  ·  view source on GitHub ↗
(screen_x: f64, screen_y: f64, max_results: f64)

Source from the content-addressed store, hash-verified

2017
2018#[wasm_bindgen]
2019pub fn bloom_scene_pick_all(screen_x: f64, screen_y: f64, max_results: f64) -> f64 {
2020 let eng = engine();
2021 let inv_vp = eng.renderer.inverse_vp_matrix();
2022 let cam_pos = eng.renderer.camera_pos();
2023 let w = eng.renderer.width() as f32;
2024 let h = eng.renderer.height() as f32;
2025 let (origin, direction) = bloom_shared::picking::screen_to_ray(
2026 screen_x as f32, screen_y as f32, w, h, &inv_vp, &cam_pos,
2027 );
2028 let results = bloom_shared::picking::raycast_scene_all(&eng.scene, &origin, &direction, max_results as usize);
2029 let count = results.len();
2030 unsafe { LAST_PICK_ALL = results; }
2031 count as f64
2032}
2033#[wasm_bindgen]
2034pub fn bloom_pick_all_handle(index: f64) -> f64 {
2035 let i = index as usize;

Callers

nothing calls this directly

Calls 7

screen_to_rayFunction · 0.85
raycast_scene_allFunction · 0.85
inverse_vp_matrixMethod · 0.80
camera_posMethod · 0.80
engineFunction · 0.70
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected