Struct spherical_cow::shapes::Sphere
[−]
[src]
pub struct Sphere { pub center: Point3<f32>, pub radius: f32, }
Constructs a sphere located at center
in Euclidean space with a given radius
.
Fields
center: Point3<f32>
Central point in space where this sphere is located.
radius: f32
Radius of current sphere.
Methods
impl Sphere
[src]
fn new(center: Point3<f32>, radius: f32) -> Sphere
[src]
Creates a new
sphere given the location of the spheres' center
and its' radius
.
fn overlaps(&self, other: &Sphere) -> bool
[src]
If the distance between the centers of two spheres is less than the sum of
their radii, we can consider them to be overlapping. Will return true
in this case.
Trait Implementations
impl PartialEq for Sphere
[src]
fn eq(&self, __arg_0: &Sphere) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Sphere) -> bool
[src]
This method tests for !=
.
impl Debug for Sphere
[src]
impl Clone for Sphere
[src]
fn clone(&self) -> Sphere
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Container for Sphere
[src]
fn contains(&self, sphere: &Sphere) -> bool
[src]
Checks if sphere exists inside the current bounding sphere.
fn volume(&self) -> f32
[src]
Calculates the volume of this sphere in normalised units.
impl Display for Sphere
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Serialize for Sphere
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Sphere
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more