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.

LONGTERM-TODO: DECIDE IF Box<dyn dyn GeometryInterface + Sync + Send> shoudl be replaced with GeometryShapeContainer

Required Methods§

source

fn volume(&self) -> f32

source

fn surface_area(&self) -> f32

source

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

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 + Sync + Send)> 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<dyn GeometryInterface + Sync + Send> for dyn GeometryInterface + Sync + Send

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Implementors§