Struct mgf::Segment
[−]
[src]
pub struct Segment {
pub a: Point3<f32>,
pub b: Point3<f32>,
}Segments are Rays with finite distances.
Fields
a: Point3<f32>
b: Point3<f32>
Trait Implementations
impl Copy for Segment[src]
impl Clone for Segment[src]
fn clone(&self) -> Segment[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 Segment[src]
impl From<(Point3<f32>, Point3<f32>)> for Segment[src]
impl From<Capsule> for Segment[src]
impl MinDistance<Point3<f32>, f32> for Segment[src]
fn min_dist(&self, c: &Point3<f32>) -> f32[src]
Returns squared distance between the segment and the point.
impl MinDistance<Point3<f32>> for Segment[src]
impl MinDistance<Segment, Option<(Point3<f32>, Point3<f32>)>> for Segment[src]
fn min_dist(&self, to: &Segment) -> Option<(Point3<f32>, Point3<f32>)>[src]
Returns the a pair of points that are the minimum distance from each other. If the segments are parallel, return None.
impl Add<Vector3<f32>> for Segment[src]
type Output = Self
The resulting type after applying the + operator.
fn add(self, v: Vector3<f32>) -> Segment[src]
Performs the + operation.
impl Sub<Vector3<f32>> for Segment[src]
type Output = Self
The resulting type after applying the - operator.
fn sub(self, v: Vector3<f32>) -> Segment[src]
Performs the - operation.
impl AddAssign<Vector3<f32>> for Segment[src]
fn add_assign(&mut self, v: Vector3<f32>)[src]
Performs the += operation.
impl SubAssign<Vector3<f32>> for Segment[src]
fn sub_assign(&mut self, v: Vector3<f32>)[src]
Performs the -= operation.
impl Shape for Segment[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<T: Collider<Intersection, Ray>> Collider<Intersection, T> for Segment[src]
Anything that can collide with a ray can collide with a line segment.
fn collide<F: FnMut(Intersection)>(&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
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.