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.
Required Methods§
Sourcefn surface_area(&self) -> f32
fn surface_area(&self) -> f32
Provides the surface area of a Geometry
.
Sourcefn boxed_clone(&self) -> Box<dyn GeometryInterface + Sync + Send>
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 Box
ed.
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.