Skip to main content

GeometryInterface

Trait GeometryInterface 

Source
pub trait GeometryInterface: Debug + BoxedMirror {
    // Required methods
    fn volume(&self) -> f32;
    fn surface_area(&self) -> f32;
    fn boxed_clone(&self) -> Box<dyn GeometryInterface + Sync + Send>;
    fn bounding_box(&self) -> (f32, f32, f32);
    fn shape_container(&self) -> GeometryShapeContainer;
}
Expand description

An interface for working with Geometrys generically.

Required Methods§

Source

fn volume(&self) -> f32

Provides the volume of a Geometry.

Source

fn surface_area(&self) -> f32

Provides the surface area of a Geometry.

Source

fn boxed_clone(&self) -> Box<dyn GeometryInterface + Sync + Send>

Allows for Cloning of Boxed Geometries.

This has similiar functionality to Clone::clone except that it allows items to be Boxed.

Source

fn bounding_box(&self) -> (f32, f32, f32)

Get’s the untransformed boundingbox size of the geometry from it’s center. (X, Y, Z).

Source

fn shape_container(&self) -> GeometryShapeContainer

Gets a GeometryShapeContainer of the current Shape.

Trait Implementations§

Source§

impl From<&(dyn GeometryInterface + Send + Sync)> for Box<dyn GeometryInterface + Sync + Send>

Source§

fn from(value: &(dyn GeometryInterface + Sync + Send)) -> Self

Converts to this type from the input type.
Source§

impl From<BoxGeometry> for Box<dyn GeometryInterface + Sync + Send>

Source§

fn from(value: BoxGeometry) -> Self

Converts to this type from the input type.
Source§

impl From<CylinderGeometry> for Box<dyn GeometryInterface + Sync + Send>

Source§

fn from(value: CylinderGeometry) -> Self

Converts to this type from the input type.
Source§

impl From<MeshGeometry> for Box<dyn GeometryInterface + Sync + Send>

Source§

fn from(value: MeshGeometry) -> Self

Converts to this type from the input type.
Source§

impl From<SphereGeometry> for Box<dyn GeometryInterface + Sync + Send>

Source§

fn from(value: SphereGeometry) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for dyn GeometryInterface + Sync + Send

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§