Skip to main content

VisionConfig

Struct VisionConfig 

Source
pub struct VisionConfig {
Show 16 fields pub cone_half_angle: f32, pub cone_taper: f32, pub range: f32, pub peripheral_range: f32, pub edge_taper: f32, pub decks: Vec<DeckBand>, pub light_gate: Option<LightGate>, pub fade_in: f32, pub fade_out: f32, pub memory_intensity: u8, pub memory_decay: f32, pub memory_floor: u8, pub heard_radius: f32, pub heard_duration: f32, pub memory_dim: f32, pub memory_desaturate: f32,
}
Expand description

All FW tuning in one place. Geometry fields are in cells (mip-0 voxels) and radians; rates are intensity units (0..=63) per second. The styling knobs at the bottom are read by the renderers from FW.2 on — unread in FW.0.

Fields§

§cone_half_angle: f32

Half-angle of the facing cone, radians.

§cone_taper: f32

Angular taper band inside the half-angle over which intensity falls to zero (smooth cone rim), radians.

§range: f32

Facing-cone reach, cells.

§peripheral_range: f32

360° close-range vision, cells (an observer is never blind in their own back at arm’s length).

§edge_taper: f32

Radial taper band inside range / peripheral_range / heard-blob radii, cells.

§decks: Vec<DeckBand>

The decks, index-aligned with FowObserver::deck and every per-deck query. Must stay the same length across FogOfWar::set_config calls (layers are keyed by index).

§light_gate: Option<LightGate>

Decision 5 — None = geometric visibility only.

§fade_in: f32

Intensity rise rate toward a live (Visible/Heard) target.

§fade_out: f32

Intensity fall rate when leaving sight, down to memory_intensity.

§memory_intensity: u8

Where a freshly-demoted Memory cell settles before slow decay.

§memory_decay: f32

Decision 7 — slow decay rate from memory_intensity toward memory_floor. 0 = memories never fade.

§memory_floor: u8

Decayed-memory minimum intensity — old memories stay barely readable rather than vanishing back to Unseen.

§heard_radius: f32

Heard-blob radius in cells per unit of loudness.

§heard_duration: f32

Seconds a heard blob stays live before fading out.

§memory_dim: f32

FW.2+ styling: Memory/Heard brightness multiplier.

§memory_desaturate: f32

FW.2+ styling: Memory/Heard desaturation amount 0..=1.

Implementations§

Source§

impl VisionConfig

Source

pub fn for_decks(decks: Vec<DeckBand>) -> Self

Defaults tuned for ship scale (~1 voxel ≈ 10 cm): a 120° cone reaching 96 cells, 12-cell peripheral, light gate off.

Source

pub fn deck_for_z(&self, z: i32) -> Option<usize>

Index of the deck whose [z_top, z_bottom] contains grid-local z (the head-follow deck pick, CA round-3 convention: feed the HEAD z, not the feet).

Trait Implementations§

Source§

impl Clone for VisionConfig

Source§

fn clone(&self) -> VisionConfig

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 Debug for VisionConfig

Source§

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

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

impl PartialEq for VisionConfig

Source§

fn eq(&self, other: &VisionConfig) -> 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 VisionConfig

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.