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

Function bloom_scene_pick

native/linux/src/lib.rs:2295–2311  ·  view source on GitHub ↗
(screen_x: f64, screen_y: f64)

Source from the content-addressed store, hash-verified

2293
2294#[no_mangle]
2295pub extern "C" fn bloom_scene_pick(screen_x: f64, screen_y: f64) -> f64 {
2296 let eng = engine();
2297 let inv_vp = eng.renderer.inverse_vp_matrix();
2298 let cam_pos = eng.renderer.camera_pos();
2299 let w = eng.renderer.width() as f32;
2300 let h = eng.renderer.height() as f32;
2301
2302 let (origin, direction) = bloom_shared::picking::screen_to_ray(
2303 screen_x as f32, screen_y as f32,
2304 w, h, &inv_vp, &cam_pos,
2305 );
2306
2307 let result = bloom_shared::picking::raycast_scene(&eng.scene, &origin, &direction);
2308 let hit = result.hit;
2309 unsafe { LAST_PICK = Some(result); }
2310 if hit { 1.0 } else { 0.0 }
2311}
2312
2313#[no_mangle]
2314pub extern "C" fn bloom_pick_hit_handle() -> f64 {

Callers

nothing calls this directly

Calls 7

screen_to_rayFunction · 0.85
raycast_sceneFunction · 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