pub struct Empty;Expand description
The empty SDF. Each point in space is infinitely far away from the surface.
This implements Sdf<Scalar, DIM, State = ()>.
Trait Implementations§
Source§impl<Scalar: Float, const DIM: usize> Sdf<Scalar, DIM> for Empty
impl<Scalar: Float, const DIM: usize> Sdf<Scalar, DIM> for Empty
Source§fn distance(&self, _: [Scalar; DIM]) -> Scalar
fn distance(&self, _: [Scalar; DIM]) -> Scalar
Evaluates the SDF at some point
Source§fn state(&self, _: [Scalar; DIM])
fn state(&self, _: [Scalar; DIM])
Evaluates the state of the SDF at some point. See
SdfState for more information.Source§fn state_sample(
&self,
position: [Scalar; DIM],
) -> <Self::State as SdfState<Scalar, DIM>>::Sample
fn state_sample( &self, position: [Scalar; DIM], ) -> <Self::State as SdfState<Scalar, DIM>>::Sample
Evaluates, then samples the state of the SDF at some point. See
SdfState
for more information.Source§fn distance_and_state(&self, position: [Scalar; DIM]) -> (Scalar, Self::State)
fn distance_and_state(&self, position: [Scalar; DIM]) -> (Scalar, Self::State)
Evaluates both the distance and the state of the SDF, hopefully a little bit
faster than if you called both
Sdf::distance and Sdf::state separately.Source§fn distance_and_state_sample(
&self,
position: [Scalar; DIM],
) -> (Scalar, <Self::State as SdfState<Scalar, DIM>>::Sample)
fn distance_and_state_sample( &self, position: [Scalar; DIM], ) -> (Scalar, <Self::State as SdfState<Scalar, DIM>>::Sample)
Evaluates both the distance and the sample of the state of the SDF, hopefully a little
bit faster than if you called both
Sdf::distance and Sdf::state_sample separately.Source§fn gradient(&self, position: [Scalar; DIM], epsilon: Scalar) -> [Scalar; DIM]
fn gradient(&self, position: [Scalar; DIM], epsilon: Scalar) -> [Scalar; DIM]
Calculates the gradient of the SDF at some point in space. Some SDF have analytical
expressions of the gradient, some don’t. If a SDF doesn’t have an implementation, it
will instead approximate it using epsilon. Read more
Source§fn normal(&self, position: [Scalar; DIM], epsilon: Scalar) -> [Scalar; DIM]
fn normal(&self, position: [Scalar; DIM], epsilon: Scalar) -> [Scalar; DIM]
Calculates the gradient, then normalizes it. The gradient typically is already normalized
if the SDF is well formed and if we aren’t on some edge case, but we never know.
impl Copy for Empty
impl Eq for Empty
impl StructuralPartialEq for Empty
Auto Trait Implementations§
impl Freeze for Empty
impl RefUnwindSafe for Empty
impl Send for Empty
impl Sync for Empty
impl Unpin for Empty
impl UnwindSafe for Empty
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