Skip to main content

CpuCutout

Struct CpuCutout 

Source
pub struct CpuCutout {
    pub focus_local: [f32; 3],
    pub tan_outer: f32,
    pub tan_inner: f32,
    pub margin: f32,
    pub focus_z: i32,
}
Expand description

OC.0 — the view cutout as one grid’s render pass consumes it, fully derived by the facade each frame (stage OC; see FrameParams::view_cutout in roxlap-render). A cell is hidden iff ALL of: its CENTRE lies inside the view cone around the eye→focus axis (the cone tapers across the feather band), its eye distance is under the nearest character-column point’s minus margin, and its grid-local z is above the focus plane (z < focus_z, z-down) — walls between the camera and the focus cut, the floor in front of the focus stays.

Per-CELL, not per-pixel (the OC.3 visual-pass round-2 redesign): the original rule gated each RAY by a screen-space window, so a cell straddling the window edge rendered for the outside pixels only — sub-cell fragments that read as ragged teeth wherever the boundary crossed a floor or wall at a shallow angle. Classifying whole cells by their centres makes the cut edge cube-granular and spatially coherent, exactly like the CA clip’s edges.

Fields§

§focus_local: [f32; 3]

The focus point in this grid’s local frame, voxel units (the same space the ray origin lives in).

§tan_outer: f32

Tangent of the cone’s OUTER half-angle (nothing is cut outside it). The facade derives it from the keyhole’s pixel radius and the frame’s focal length (radius_px / hz), so it still means “a screen circle of ~radius_px around the projected focus”.

§tan_inner: f32

Tangent of the full-reveal INNER half-angle ((radius − feather)/hz): between the two the reveal distance tapers linearly to zero, closing the keyhole into a smooth funnel. == tan_outer gives a hard edge.

§margin: f32

How far short of the character COLUMN the reveal stops, in this grid’s voxel units (world units /vws). The reveal surface hugs the column — the vertical segment at the focus xy between the focus plane (Self::focus_z, the feet) and its mirror above the focus (the head): a cell is hidden while its eye distance is under the eye distance of the NEAREST column point at the cell’s own height, minus this margin. A fixed eye-distance sphere through the focus (the previous rule) kept waist-down stumps of any obstacle the character stood right behind — below-chest cells in front sit FARTHER from an elevated eye than the chest itself.

§focus_z: i32

Grid-local absolute voxel z of the focus plane (mip-0, z-down, spanning stacked chz chunks — the same space as Self::z_clip); cells with z < focus_z qualify for hiding. At mip N the compare uses focus_z >> mip (arithmetic shift = floor), the CA.1 formula. This is the FIRST, cheap gate in the hit branch: i32::MIN-like sentinels keep the disabled cost at one never-true compare.

Trait Implementations§

Source§

impl Clone for CpuCutout

Source§

fn clone(&self) -> CpuCutout

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CpuCutout

Source§

impl Debug for CpuCutout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CpuCutout

Source§

fn eq(&self, other: &CpuCutout) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CpuCutout

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.