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 Geometry
s generically.
LONGTERM-TODO: DECIDE IF Box<dyn dyn GeometryInterface + Sync + Send>
shoudl be replaced with GeometryShapeContainer
Required Methods§
fn volume(&self) -> f32
fn surface_area(&self) -> f32
fn boxed_clone(&self) -> Box<dyn GeometryInterface + Sync + Send>
sourcefn bounding_box(&self) -> (f32, f32, f32)
fn bounding_box(&self) -> (f32, f32, f32)
Get’s the untransformed boundingbox size of the geometry from it’s center. (X, Y, Z)
sourcefn shape_container(&self) -> GeometryShapeContainer
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>
impl From<&(dyn GeometryInterface + Sync + Send)> for Box<dyn GeometryInterface + Sync + Send>
source§impl From<BoxGeometry> for Box<dyn GeometryInterface + Sync + Send>
impl From<BoxGeometry> for Box<dyn GeometryInterface + Sync + Send>
source§fn from(value: BoxGeometry) -> Self
fn from(value: BoxGeometry) -> Self
Converts to this type from the input type.
source§impl From<CylinderGeometry> for Box<dyn GeometryInterface + Sync + Send>
impl From<CylinderGeometry> for Box<dyn GeometryInterface + Sync + Send>
source§fn from(value: CylinderGeometry) -> Self
fn from(value: CylinderGeometry) -> Self
Converts to this type from the input type.
source§impl From<MeshGeometry> for Box<dyn GeometryInterface + Sync + Send>
impl From<MeshGeometry> for Box<dyn GeometryInterface + Sync + Send>
source§fn from(value: MeshGeometry) -> Self
fn from(value: MeshGeometry) -> Self
Converts to this type from the input type.
source§impl From<SphereGeometry> for Box<dyn GeometryInterface + Sync + Send>
impl From<SphereGeometry> for Box<dyn GeometryInterface + Sync + Send>
source§fn from(value: SphereGeometry) -> Self
fn from(value: SphereGeometry) -> Self
Converts to this type from the input type.