Struct mgf::Sphere
[−]
[src]
pub struct Sphere { pub c: Point3<f32>, pub r: f32, }
A point and a distance.
Like AABBs, spheres are closed volumes.
Fields
c: Point3<f32>
The center point of the sphere.
r: f32
The radius of the sphere.
Trait Implementations
impl BoundedBy<AABB> for Sphere
[src]
impl Mul<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, s: f32) -> Self
[src]
Performs the *
operation.
impl Div<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, s: f32) -> Self
[src]
Performs the /
operation.
impl Add<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, s: f32) -> Self
[src]
Performs the +
operation.
impl Sub<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, s: f32) -> Self
[src]
Performs the -
operation.
impl Bound for Sphere
[src]
fn combine(a: &Sphere, b: &Sphere) -> Sphere
[src]
Produce a bound that encloses the two arguments.
fn surface_area(&self) -> f32
[src]
Return a measure of the area of the object.
impl Contacts<Moving<Component>> for Sphere
[src]
fn contacts<F: FnMut(Contact)>(
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
[src]
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
Returns the last contact found, if one exists.
impl Overlaps<AABB> for Sphere
[src]
fn overlaps(&self, rhs: &AABB) -> bool
[src]
Returns true if the two objects overlap and false otherwise.
impl Overlaps<Sphere> for Sphere
[src]
fn overlaps(&self, rhs: &Sphere) -> bool
[src]
Returns true if the two objects overlap and false otherwise.
impl Contains<Point3<f32>> for Sphere
[src]
fn contains(&self, p: &Point3<f32>) -> bool
[src]
Returns true if the current object contains the argument.
impl Contains<Sphere> for Sphere
[src]
An important consequence of Spheres being closed: two spheres with the same center and radius contain each other.
fn contains(&self, rhs: &Sphere) -> bool
[src]
Returns true if the current object contains the argument.
impl Contacts<Moving<Sphere>> for Sphere
[src]
fn contacts<F: FnMut(Contact)>(
&self,
sphere: &Moving<Sphere>,
callback: F
) -> bool
[src]
&self,
sphere: &Moving<Sphere>,
callback: F
) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
Returns the last contact found, if one exists.
impl Contacts<Moving<Capsule>> for Sphere
[src]
fn contacts<F: FnMut(Contact)>(
&self,
rhs: &Moving<Capsule>,
callback: F
) -> bool
[src]
&self,
rhs: &Moving<Capsule>,
callback: F
) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
Returns the last contact found, if one exists.
impl Copy 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 Debug for Sphere
[src]
impl MinDistance<Point3<f32>> for Sphere
[src]
impl Add<Vector3<f32>> for Sphere
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, v: Vector3<f32>) -> Self
[src]
Performs the +
operation.
impl Sub<Vector3<f32>> for Sphere
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, v: Vector3<f32>) -> Self
[src]
Performs the -
operation.
impl AddAssign<Vector3<f32>> for Sphere
[src]
fn add_assign(&mut self, v: Vector3<f32>)
[src]
Performs the +=
operation.
impl SubAssign<Vector3<f32>> for Sphere
[src]
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
Performs the -=
operation.
impl Shape for Sphere
[src]
fn center(&self) -> Point3<f32>
[src]
Returns the center of mass of the geometry, assuming a regular density.
fn set_pos(&mut self, p: Point3<f32>)
[src]
Sets the center of the shape to p.
impl Volumetric for Sphere
[src]
fn rotate<R: Rotation3<f32>>(&self, _: R) -> Sphere
[src]
Rotation to a bounding sphere does nothing.
fn rotate_about<R: Rotation3<f32>>(&self, r: R, p: Point3<f32>) -> Self
[src]
Rotates the object around a point.