Skip to main content

screen_cells

Function screen_cells 

Source
fn screen_cells(
    clip_from_view: &Mat4,
    perspective: bool,
    center: Vec3,
    depth: f32,
    radius: f32,
    dims: [u32; 3],
    full: ((u32, u32), (u32, u32)),
) -> Option<((u32, u32), (u32, u32))>
Expand description

The x and y cells a light’s sphere covers, as inclusive ranges.

A perspective sphere is bounded by its two tangent lines on each screen axis. Those tangents are asymmetric around the projected center for an off-axis sphere, so a radius around that center can miss its outer edge. An orthographic projection has no such asymmetry, and is simply scaled.