Struct mgf::Sphere
[−]
[src]
pub struct Sphere {
pub c: Point3<f32>,
pub r: f32,
}Spheres are a point and a distance. Like AABBs, spheres as bounds are closed.
Fields
c: Point3<f32>
r: f32
Methods
impl Sphere[src]
fn rotate(self, r: Quaternion<f32>) -> Self[src]
Rotates the sphere about the origin
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<T: BoundedBy<Sphere>> Collider<Contains, T> for Sphere[src]
fn check_collision(&self, b: &T) -> Option<Contains>[src]
Returns the first collision found if any exists.
fn collide<F: FnMut(CollisionType)>(&self, other: &T, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
impl Bound for Sphere[src]
fn combine(a: &Sphere, b: &Sphere) -> Sphere[src]
Produce a bound that encloses the two arguments.
fn rotate(&self, _: Quaternion<f32>) -> Sphere[src]
Rotation to a bounding sphere does nothing.
fn surface_area(&self) -> f32[src]
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 Collider<Contains, Point3<f32>> for Sphere[src]
fn check_collision(&self, p: &Point3<f32>) -> Option<Contains>[src]
Returns the first collision found if any exists.
fn collide<F: FnMut(CollisionType)>(&self, other: &T, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
impl Collider<Intersection, Ray> for Sphere[src]
fn collide<F: FnMut(Intersection)>(&self, rhs: &Ray, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Moving<Sphere>> for Sphere[src]
fn collide<F: FnMut(Contact)>(
&self,
sphere: &Moving<Sphere>,
callback: F
) -> bool[src]
&self,
sphere: &Moving<Sphere>,
callback: F
) -> bool
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Moving<Capsule>> for Sphere[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Moving<Capsule>, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.