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

Function pickScene

src/scene/index.ts:414–440  ·  view source on GitHub ↗
(screenX: number, screenY: number)

Source from the content-addressed store, hash-verified

412 * Must be called after beginMode3D() so the camera matrices are set.
413 */
414export function pickScene(screenX: number, screenY: number): PickHit {
415 const hit = bloom_scene_pick(screenX, screenY) !== 0;
416 if (!hit) {
417 return {
418 hit: false,
419 handle: 0,
420 distance: 0,
421 point: { x: 0, y: 0, z: 0 },
422 normal: { x: 0, y: 0, z: 0 },
423 };
424 }
425 return {
426 hit: true,
427 handle: bloom_pick_hit_handle(),
428 distance: bloom_pick_hit_distance(),
429 point: {
430 x: bloom_pick_hit_x(),
431 y: bloom_pick_hit_y(),
432 z: bloom_pick_hit_z(),
433 },
434 normal: {
435 x: bloom_pick_hit_normal_x(),
436 y: bloom_pick_hit_normal_y(),
437 z: bloom_pick_hit_normal_z(),
438 },
439 };
440}
441
442// ============================================================
443// Geometry Generation

Callers 2

interactive.tsFile · 0.90
r3f-bridge.tsFile · 0.90

Calls 9

bloom_scene_pickFunction · 0.50
bloom_pick_hit_handleFunction · 0.50
bloom_pick_hit_distanceFunction · 0.50
bloom_pick_hit_xFunction · 0.50
bloom_pick_hit_yFunction · 0.50
bloom_pick_hit_zFunction · 0.50
bloom_pick_hit_normal_xFunction · 0.50
bloom_pick_hit_normal_yFunction · 0.50
bloom_pick_hit_normal_zFunction · 0.50

Tested by

no test coverage detected