iterami/Docs.htm/common HTM Projects/webgl.js/webgl_pick_entity(cursor)
- Requires the "webgl_properties.picking" to be at least 1 before picking can be done.
- Uses the framebuffer and picking shader created by webgl_framebuffer_init() to determine which entity was picked.
- Picking xy is equal to "globalThis.innerWidth / 2" and "globalThis.innerHeight / 2" if "webgl_properties.pointerlock" is true, or otherwise is equal to "core_pointer.x" and "core_pointer.y".
- If the picked entity has "picking_range" >0, then distance between the entity's position and the position of "webgl_characters[webgl_character_id]" is checked.
- If the "cursor" arg is true, then the cursor will be changed to "pointer" when hovering over a pickable entity instead of triggering picking events.
- If the "cursor" arg isn't true, then optional events are triggered on a successful pick.
- If the entity has "picking_xyz" true, then the xyz result is stored in the "webgl_picked_x", "webgl_picked_y", and "webgl_picked_z" globals.
- Returns the picked entity, or false if no entity was picked.