pub struct ClampBox { /* private fields */ }Implementations§
Source§impl ClampBox
impl ClampBox
Sourcepub fn new(min: &[f64], max: &[f64]) -> Result<Self, BoundaryError>
pub fn new(min: &[f64], max: &[f64]) -> Result<Self, BoundaryError>
Construct a clamping box from per-axis lower and upper bounds.
A coordinate below the box is set to the lower face; a coordinate above the box is set to the upper face. Velocity is unchanged. This is useful for hard positional constraints or diagnostic state cleanup, but it does not model an elastic collision.
pub fn dim(&self) -> usize
pub fn min(&self) -> &[f64]
pub fn max(&self) -> &[f64]
Trait Implementations§
Source§impl ContinuousBoundary for ClampBox
impl ContinuousBoundary for ClampBox
Source§fn may_fail_after_validation(&self) -> bool
fn may_fail_after_validation(&self) -> bool
Whether correctly dimensioned vectors can still produce an error. Read more
fn dim(&self) -> usize
fn apply_position_velocity( &self, r: &mut [f64], v: &mut [f64], ) -> Result<(), BoundaryError>
fn apply_position(&self, r: &mut [f64]) -> Result<(), BoundaryError>
fn apply_positions(&self, positions: &mut [f64]) -> Result<(), BoundaryError>
fn apply_positions_velocities( &self, positions: &mut [f64], velocities: &mut [f64], ) -> Result<(), BoundaryError>
fn apply_position_with_velocity_flip_mask( &self, r: &mut [f64], flip_mask: &mut [u8], ) -> Result<(), BoundaryError>
Auto Trait Implementations§
impl Freeze for ClampBox
impl RefUnwindSafe for ClampBox
impl Send for ClampBox
impl Sync for ClampBox
impl Unpin for ClampBox
impl UnsafeUnpin for ClampBox
impl UnwindSafe for ClampBox
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 moreSource§impl<T> ParticleBoundary for T
impl<T> ParticleBoundary for T
Source§fn apply_to_particles(
&self,
objects: &mut PhysObj,
) -> Result<(), ParticleBoundaryError>
fn apply_to_particles( &self, objects: &mut PhysObj, ) -> Result<(), ParticleBoundaryError>
Apply this continuous boundary to canonical particle positions and
velocities stored in
PhysObj. Built-in boundaries borrow dense buffers.
Fallible custom boundaries stage both columns and commit only on success;
callback side effects outside particle state cannot be rolled back.