pub struct IntersectionContainer<T, Scalar: Float, State: SdfState<Scalar, DIM>, const DIM: usize>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,{ /* private fields */ }Expand description
Hard intersection of N SDFs stored in some container, like a Vec for example.
See SdfContainerCombinationOperators
for more information on how to use this.
Trait Implementations§
Source§impl<T: Clone, Scalar: Clone + Float, State: Clone + SdfState<Scalar, DIM>, const DIM: usize> Clone for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T: Clone, Scalar: Clone + Float, State: Clone + SdfState<Scalar, DIM>, const DIM: usize> Clone for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Source§fn clone(&self) -> IntersectionContainer<T, Scalar, State, DIM>
fn clone(&self) -> IntersectionContainer<T, Scalar, State, DIM>
Returns a duplicate 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<T: Debug, Scalar: Debug + Float, State: Debug + SdfState<Scalar, DIM>, const DIM: usize> Debug for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T: Debug, Scalar: Debug + Float, State: Debug + SdfState<Scalar, DIM>, const DIM: usize> Debug for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Source§impl<T: Default, Scalar: Default + Float, State: Default + SdfState<Scalar, DIM>, const DIM: usize> Default for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T: Default, Scalar: Default + Float, State: Default + SdfState<Scalar, DIM>, const DIM: usize> Default for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Source§fn default() -> IntersectionContainer<T, Scalar, State, DIM>
fn default() -> IntersectionContainer<T, Scalar, State, DIM>
Returns the “default value” for a type. Read more
Source§impl<T, Scalar: Float, State: SdfState<Scalar, DIM>, const DIM: usize> From<T> for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T, Scalar: Float, State: SdfState<Scalar, DIM>, const DIM: usize> From<T> for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Source§impl<T: Hash, Scalar: Hash + Float, State: Hash + SdfState<Scalar, DIM>, const DIM: usize> Hash for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T: Hash, Scalar: Hash + Float, State: Hash + SdfState<Scalar, DIM>, const DIM: usize> Hash for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Source§impl<T: PartialEq, Scalar: PartialEq + Float, State: PartialEq + SdfState<Scalar, DIM>, const DIM: usize> PartialEq for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T: PartialEq, Scalar: PartialEq + Float, State: PartialEq + SdfState<Scalar, DIM>, const DIM: usize> PartialEq for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Source§fn eq(&self, other: &IntersectionContainer<T, Scalar, State, DIM>) -> bool
fn eq(&self, other: &IntersectionContainer<T, Scalar, State, DIM>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<T, Scalar: Float, State: SdfState<Scalar, DIM>, const DIM: usize> Sdf<Scalar, DIM> for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T, Scalar: Float, State: SdfState<Scalar, DIM>, const DIM: usize> Sdf<Scalar, DIM> for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Source§fn distance(&self, position: [Scalar; DIM]) -> Scalar
fn distance(&self, position: [Scalar; DIM]) -> Scalar
Evaluates the SDF at some point
Source§fn state(&self, position: [Scalar; DIM]) -> Self::State
fn state(&self, position: [Scalar; DIM]) -> Self::State
Evaluates 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 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 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_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 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. Smooth
combinations and the empty SDF are good counter examples.
Source§fn normal_or_zero(
&self,
position: [Scalar; DIM],
epsilon: Scalar,
) -> [Scalar; DIM]
fn normal_or_zero( &self, position: [Scalar; DIM], epsilon: Scalar, ) -> [Scalar; DIM]
Calculates the gradient, then normalizes it. If the norm is 0, then [0; DIM] is returned.
The gradient typically is already normalized, but sometimes this isn’t the case, for example
with the empty SDF.
Source§fn gradient_approx(
&self,
position: [Scalar; DIM],
epsilon: Scalar,
) -> [Scalar; DIM]
fn gradient_approx( &self, position: [Scalar; DIM], epsilon: Scalar, ) -> [Scalar; DIM]
Calculates the gradient of the SDF at some point in space. It will approximate it using
epsilon.
Source§fn normal_approx(
&self,
position: [Scalar; DIM],
epsilon: Scalar,
) -> [Scalar; DIM]
fn normal_approx( &self, position: [Scalar; DIM], epsilon: Scalar, ) -> [Scalar; DIM]
Calculates the normal of the SDF at some point in space. It will approximate the
gradient using epsilon.
Source§fn normal_or_zero_approx(
&self,
position: [Scalar; DIM],
epsilon: Scalar,
) -> [Scalar; DIM]
fn normal_or_zero_approx( &self, position: [Scalar; DIM], epsilon: Scalar, ) -> [Scalar; DIM]
Calculates the normal of the SDF at some point in space, and if the norm is 0, it will
simply return [0; DIM]. It will approximate the gradient using epsilon.
impl<T: Copy, Scalar: Copy + Float, State: Copy + SdfState<Scalar, DIM>, const DIM: usize> Copy for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T: Eq, Scalar: Eq + Float, State: Eq + SdfState<Scalar, DIM>, const DIM: usize> Eq for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
impl<T, Scalar: Float, State: SdfState<Scalar, DIM>, const DIM: usize> StructuralPartialEq for IntersectionContainer<T, Scalar, State, DIM>where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::Item: Sdf<Scalar, DIM, State = State>,
Auto Trait Implementations§
impl<T, Scalar, State, const DIM: usize> Freeze for IntersectionContainer<T, Scalar, State, DIM>where
T: Freeze,
impl<T, Scalar, State, const DIM: usize> RefUnwindSafe for IntersectionContainer<T, Scalar, State, DIM>
impl<T, Scalar, State, const DIM: usize> Send for IntersectionContainer<T, Scalar, State, DIM>
impl<T, Scalar, State, const DIM: usize> Sync for IntersectionContainer<T, Scalar, State, DIM>
impl<T, Scalar, State, const DIM: usize> Unpin for IntersectionContainer<T, Scalar, State, DIM>
impl<T, Scalar, State, const DIM: usize> UnwindSafe for IntersectionContainer<T, Scalar, State, DIM>
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