Empty

Struct Empty 

Source
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 Clone for Empty

Source§

fn clone(&self) -> Empty

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Empty

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Empty

Source§

fn default() -> Empty

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

impl Hash for Empty

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Empty

Source§

fn eq(&self, other: &Empty) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Scalar: Float, const DIM: usize> Sdf<Scalar, DIM> for Empty

Source§

type State = ()

The state that is bound to this SDF. See SdfState for more information.
Source§

fn distance(&self, _: [Scalar; DIM]) -> Scalar

Evaluates the SDF at some point
Source§

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

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)

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)

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]

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]

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

impl Copy for Empty

Source§

impl Eq for Empty

Source§

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

Source§

impl<T, Scalar, const DIM: usize> SdfBindTrait<Scalar, DIM> for T
where Scalar: Float, T: Sdf<Scalar, DIM>,

Source§

fn bind<State: SdfState<Scalar, DIM>>( self, state: State, ) -> Bound<Self, Scalar, State, DIM>

Source§

impl<T, Scalar, State, const DIM: usize> SdfCombinationOperations<Scalar, State, DIM> for T
where Scalar: Float + 'static, State: SdfState<Scalar, DIM>, T: Sdf<Scalar, DIM, State = State>,

Source§

fn add<Rhs>(self, rhs: Rhs) -> Union<Self, Rhs, Scalar, State, DIM>
where Rhs: Sdf<Scalar, DIM, State = State>,

Source§

fn mul<Rhs>(self, rhs: Rhs) -> Intersection<Self, Rhs, Scalar, State, DIM>
where Rhs: Sdf<Scalar, DIM, State = State>,

Source§

fn sub<Rhs>(self, rhs: Rhs) -> Difference<Self, Rhs, Scalar, State, DIM>
where Rhs: Sdf<Scalar, DIM, State = State>,

Source§

fn add_smooth_exp<Rhs>( self, rhs: Rhs, factor: Scalar, ) -> SUnionExponential<Self, Rhs, Scalar, State, DIM>
where Rhs: Sdf<Scalar, DIM, State = State>,

Source§

fn mul_smooth_exp<Rhs>( self, rhs: Rhs, factor: Scalar, ) -> SIntersectionExponential<Self, Rhs, Scalar, State, DIM>
where Rhs: Sdf<Scalar, DIM, State = State>,

Source§

fn sub_smooth_exp<Rhs>( self, rhs: Rhs, factor: Scalar, ) -> SDifferenceExponential<Self, Rhs, Scalar, State, DIM>
where Rhs: Sdf<Scalar, DIM, State = State>,

Source§

impl<State, S> SdfRotationOperations<State> for S
where State: SdfState<f32, 3>, S: Sdf<f32, 3, State = State>,

Source§

fn rotate(self, rotation: Quat) -> Rotated<State, Self>

Source§

impl<Scalar, State, const DIM: usize, S> SdfTransformOperations<Scalar, State, DIM> for S
where Scalar: Float + 'static, State: SdfState<Scalar, DIM>, S: Sdf<Scalar, DIM, State = State>,

Source§

fn translate( self, translation: impl Into<[Scalar; DIM]>, ) -> Translated<Scalar, State, Self, DIM>

Source§

fn scale(self, scale: Scalar) -> Scaled<Scalar, State, Self, DIM>

Source§

fn invert(self) -> Inverted<Scalar, State, Self, DIM>

Source§

fn iso(self, iso: Scalar) -> IsoSurface<Scalar, State, Self, DIM>

Source§

fn thicken(self, thickness: Scalar) -> Thicken<Scalar, State, Self, DIM>

Source§

fn approx(self, radius: Scalar) -> Approximated<Scalar, State, Self, DIM>

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

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.