pub struct Renderer {Show 15 fields
pub width: usize,
pub height: usize,
pub frame: Vec<u32>,
col_pix: Vec<u32>,
col_depth: Vec<f32>,
col_mask: Vec<u32>,
masked: Vec<Vec<MaskSeg>>,
visited: Vec<AtomicU8>,
pub sky_scale: f64,
pub y_stretch: f64,
pub phase_ms: [f64; 4],
pub keep_rows: bool,
col_portals: Vec<Vec<u32>>,
pub stats_sectors: usize,
pub stats_kinds: [usize; 5],
}Fields§
§width: usize§height: usize§frame: Vec<u32>Row-major output, 0x00RRGGBB.
col_pix: Vec<u32>§col_depth: Vec<f32>§col_mask: Vec<u32>Per pixel: id of the portal it was drawn through (0 = none).
masked: Vec<Vec<MaskSeg>>§visited: Vec<AtomicU8>§sky_scale: f64Horizontal sky texels per full turn multiplier (tuning knob).
y_stretch: f64Vertical stretch emulating the 320x200 pixel aspect (1.2 in the original).
phase_ms: [f64; 4]Milliseconds spent in the last frame: walls/planes, portal sprites + projection, masked walls + sprites, output copy.
keep_rows: boolAlso produce the row-major Renderer::frame. Callers that scale the column-major
image themselves (Renderer::columns) turn this off to skip a full-frame copy.
col_portals: Vec<Vec<u32>>Portal ids seen in each column during the wall pass.
stats_sectors: usize§stats_kinds: [usize; 5]Projected sprites by kind (face, wall, floor, voxel) and masked wall segments.
Implementations§
Source§impl Renderer
impl Renderer
pub fn new(width: usize, height: usize) -> Self
pub fn resize(&mut self, width: usize, height: usize)
Sourcepub fn columns(&self) -> (&[u32], usize, usize)
pub fn columns(&self) -> (&[u32], usize, usize)
The last frame in column-major order: (pixels, width, height), pixels[x * h + y].
fn view(&self, cam: &Camera) -> View
Sourcefn vis_shade(vis: f64, t: f64) -> i32
fn vis_shade(vis: f64, t: f64) -> i32
Distance in xy units for a depth value (used for fog/visibility shading).
pub fn render(&mut self, scene: &Scene<'_>, cam: &Camera)
Auto Trait Implementations§
impl Freeze for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
impl UnwindSafe for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more