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: f32Center world coordinate X
center_world_z: f32Center world coordinate Z
cell_size_m: f32Physical cell size in meters (e.g. 2.0m per patch)
Implementations§
§impl ToroidalGroundCoverClipmap
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
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)
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,
)
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
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]
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
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
impl Clone for ToroidalGroundCoverClipmap
§fn clone(&self) -> ToroidalGroundCoverClipmap
fn clone(&self) -> ToroidalGroundCoverClipmap
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ToroidalGroundCoverClipmap
§impl Default for ToroidalGroundCoverClipmap
impl Default for ToroidalGroundCoverClipmap
§fn default() -> ToroidalGroundCoverClipmap
fn default() -> ToroidalGroundCoverClipmap
Auto Trait Implementations§
impl Freeze for ToroidalGroundCoverClipmap
impl RefUnwindSafe for ToroidalGroundCoverClipmap
impl Send for ToroidalGroundCoverClipmap
impl Sync for ToroidalGroundCoverClipmap
impl Unpin for ToroidalGroundCoverClipmap
impl UnsafeUnpin for ToroidalGroundCoverClipmap
impl UnwindSafe for ToroidalGroundCoverClipmap
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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