pub struct SlicePlane { /* private fields */ }Expand description
A slice plane that can cut through geometry.
The plane is defined by a point (origin) and a normal direction. Geometry on the negative side of the plane (opposite to normal) is discarded.
Implementations§
Source§impl SlicePlane
impl SlicePlane
Sourcepub fn new(name: impl Into<String>) -> SlicePlane
pub fn new(name: impl Into<String>) -> SlicePlane
Creates a new slice plane with default settings.
By default, the plane is at the origin with +Y normal.
Sourcepub fn with_pose(
name: impl Into<String>,
origin: Vec3,
normal: Vec3,
) -> SlicePlane
pub fn with_pose( name: impl Into<String>, origin: Vec3, normal: Vec3, ) -> SlicePlane
Creates a slice plane with specific pose.
Sourcepub fn set_origin(&mut self, origin: Vec3)
pub fn set_origin(&mut self, origin: Vec3)
Sets the origin point of the plane.
Sourcepub fn set_normal(&mut self, normal: Vec3)
pub fn set_normal(&mut self, normal: Vec3)
Sets the normal direction of the plane.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether the slice plane is enabled.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Sets whether the slice plane is enabled.
Sourcepub fn draw_plane(&self) -> bool
pub fn draw_plane(&self) -> bool
Returns whether to draw the plane visualization.
Sourcepub fn set_draw_plane(&mut self, draw: bool)
pub fn set_draw_plane(&mut self, draw: bool)
Sets whether to draw the plane visualization.
Sourcepub fn draw_widget(&self) -> bool
pub fn draw_widget(&self) -> bool
Returns whether to draw the widget.
Sourcepub fn set_draw_widget(&mut self, draw: bool)
pub fn set_draw_widget(&mut self, draw: bool)
Sets whether to draw the widget.
Sourcepub fn transparency(&self) -> f32
pub fn transparency(&self) -> f32
Returns the transparency of the plane visualization.
Sourcepub fn set_transparency(&mut self, transparency: f32)
pub fn set_transparency(&mut self, transparency: f32)
Sets the transparency of the plane visualization.
Sourcepub fn plane_size(&self) -> f32
pub fn plane_size(&self) -> f32
Returns the size of the plane visualization (half-extent in each direction).
Sourcepub fn set_plane_size(&mut self, size: f32)
pub fn set_plane_size(&mut self, size: f32)
Sets the size of the plane visualization (half-extent in each direction).
Sourcepub fn signed_distance(&self, point: Vec3) -> f32
pub fn signed_distance(&self, point: Vec3) -> f32
Returns the signed distance from a point to the plane.
Positive values are on the normal side (kept), negative on the opposite (discarded).
Sourcepub fn is_kept(&self, point: Vec3) -> bool
pub fn is_kept(&self, point: Vec3) -> bool
Returns whether a point is on the kept side of the plane.
Sourcepub fn to_transform(&self) -> Mat4
pub fn to_transform(&self) -> Mat4
Computes a transform matrix for gizmo manipulation.
The plane normal becomes the local X axis, with Y and Z axes forming an orthonormal basis in the plane.
Sourcepub fn set_from_transform(&mut self, transform: Mat4)
pub fn set_from_transform(&mut self, transform: Mat4)
Updates origin and normal from a transform matrix.
Extracts position from column 3 (translation), and normal from column 0 (x-axis in local space).
Trait Implementations§
Source§impl Clone for SlicePlane
impl Clone for SlicePlane
Source§fn clone(&self) -> SlicePlane
fn clone(&self) -> SlicePlane
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SlicePlane
impl Debug for SlicePlane
Source§impl Default for SlicePlane
impl Default for SlicePlane
Source§fn default() -> SlicePlane
fn default() -> SlicePlane
Source§impl From<&SlicePlane> for SlicePlaneUniforms
impl From<&SlicePlane> for SlicePlaneUniforms
Source§fn from(plane: &SlicePlane) -> SlicePlaneUniforms
fn from(plane: &SlicePlane) -> SlicePlaneUniforms
Auto Trait Implementations§
impl Freeze for SlicePlane
impl RefUnwindSafe for SlicePlane
impl Send for SlicePlane
impl Sync for SlicePlane
impl Unpin for SlicePlane
impl UnsafeUnpin for SlicePlane
impl UnwindSafe for SlicePlane
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().