pub struct FieldConfig { /* private fields */ }Expand description
Validated configuration for one layered field.
Implementations§
Source§impl FieldConfig
impl FieldConfig
Sourcepub fn new(
frame: Frame3,
bounds: FieldBounds,
cell_size: f64,
tolerance: Tolerance,
budget: FieldResourceBudget,
) -> Result<FieldConfig, LayeredFieldError>
pub fn new( frame: Frame3, bounds: FieldBounds, cell_size: f64, tolerance: Tolerance, budget: FieldResourceBudget, ) -> Result<FieldConfig, LayeredFieldError>
Validate a frame, bounds, cell size, tolerance, and budget together.
The frame must be finite, unit-length on each axis, mutually orthogonal within the angular tolerance, and right-handed. Grid dimensions are derived deterministically by ceiling division so a partial trailing cell is retained rather than silently dropped.
Sourcepub const fn bounds(&self) -> FieldBounds
pub const fn bounds(&self) -> FieldBounds
Local sampling box.
Sourcepub const fn budget(&self) -> FieldResourceBudget
pub const fn budget(&self) -> FieldResourceBudget
Caller-owned budget.
Sourcepub const fn dimensions(&self) -> (usize, usize)
pub const fn dimensions(&self) -> (usize, usize)
Deterministic (width, height) cell dimensions.
Sourcepub fn cell_center(&self, x: usize, y: usize) -> DVec3
pub fn cell_center(&self, x: usize, y: usize) -> DVec3
World-space centre of cell (x, y) on the w = 0 local plane.
Trait Implementations§
Source§impl Clone for FieldConfig
impl Clone for FieldConfig
Source§fn clone(&self) -> FieldConfig
fn clone(&self) -> FieldConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldConfig
impl Debug for FieldConfig
Source§impl PartialEq for FieldConfig
impl PartialEq for FieldConfig
impl Copy for FieldConfig
impl StructuralPartialEq for FieldConfig
Auto Trait Implementations§
impl Freeze for FieldConfig
impl RefUnwindSafe for FieldConfig
impl Send for FieldConfig
impl Sync for FieldConfig
impl Unpin for FieldConfig
impl UnwindSafe for FieldConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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