Skip to main content

ToroidalGroundCoverClipmap

Struct ToroidalGroundCoverClipmap 

#[repr(C)]
pub struct ToroidalGroundCoverClipmap { pub cells: [EcotopePatch; 1024], pub center_world_x: f32, pub center_world_z: f32, pub cell_size_m: f32, }
Expand description

Zero-allocation toroidal clipmap buffer centered on the moving camera.

Fields§

§cells: [EcotopePatch; 1024]§center_world_x: f32

Center world coordinate X

§center_world_z: f32

Center world coordinate Z

§cell_size_m: f32

Physical cell size in meters (e.g. 2.0m per patch)

Implementations§

§

impl ToroidalGroundCoverClipmap

pub const fn new( center_x: f32, center_z: f32, cell_size_m: f32, ) -> ToroidalGroundCoverClipmap

pub fn cell_index_at(&self, grid_x: i32, grid_z: i32) -> usize

Evaluates toroidal index in 0..TOROIDAL_TOTAL_CELLS using modulo addressing.

pub fn update_camera_position(&mut self, cam_x: f32, cam_z: f32)

Translates the toroidal clipmap center without buffer re-allocation.

pub fn inject_trample( &mut self, world_x: f32, world_z: f32, dir_x: f32, dir_z: f32, matted_ratio: f32, )

Injects a vehicle wheel or character boot trample deformation into the nearest cell.

pub fn evaluate_lod(&self, distance_m: f32) -> GroundCoverLod

Maps distance from camera in meters to the optimal continuous LOD level.

pub fn evaluate_sggx_fiber_direction(&self, patch: &EcotopePatch) -> [f32; 3]

Evaluates SGGX 3D normal orientation vector for distant LOD 3 microflake BRDF.

When turgor is high, grass stands vertically ($[0, 1, 0]$), producing velvet grazing sheen. When trampled or wilted, the fiber tangent collapses horizontally.

pub fn clamp_blade_density( &self, distance_m: f32, viewport_width_px: u32, viewport_height_px: u32, ) -> u32

Megapixel Governor: Computes allowable blade count for a tile to avoid sub-pixel overdraw.

Limits spawned vertices across the viewport to $\le 1.5\times$ total viewport pixels.

Trait Implementations§

§

impl Clone for ToroidalGroundCoverClipmap

§

fn clone(&self) -> ToroidalGroundCoverClipmap

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
§

impl Copy for ToroidalGroundCoverClipmap

§

impl Default for ToroidalGroundCoverClipmap

§

fn default() -> ToroidalGroundCoverClipmap

Returns the “default value” for a type. Read more

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,