pub enum SdfPrimitive {
Sphere {
center: [f64; 3],
radius: f64,
},
Box3d {
center: [f64; 3],
half_extents: [f64; 3],
},
Cylinder {
center: [f64; 3],
radius: f64,
height: f64,
},
Torus {
center: [f64; 3],
r_major: f64,
r_minor: f64,
},
}Expand description
A primitive signed distance field shape.
Variants§
Sphere
Sphere centred at center with radius radius.
Fields
Box3d
Axis-aligned box centred at center.
Fields
Cylinder
Infinite cylinder (along the Y-axis) with a finite height cap.
Fields
Torus
Torus whose axis is the Y-axis.
Implementations§
Trait Implementations§
Source§impl Clone for SdfPrimitive
impl Clone for SdfPrimitive
Source§fn clone(&self) -> SdfPrimitive
fn clone(&self) -> SdfPrimitive
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SdfPrimitive
impl Debug for SdfPrimitive
Source§impl PartialEq for SdfPrimitive
impl PartialEq for SdfPrimitive
Source§fn eq(&self, other: &SdfPrimitive) -> bool
fn eq(&self, other: &SdfPrimitive) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SdfPrimitive
Auto Trait Implementations§
impl Freeze for SdfPrimitive
impl RefUnwindSafe for SdfPrimitive
impl Send for SdfPrimitive
impl Sync for SdfPrimitive
impl Unpin for SdfPrimitive
impl UnsafeUnpin for SdfPrimitive
impl UnwindSafe for SdfPrimitive
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