Struct mold2d::raycast::Segment
[−]
[src]
pub struct Segment { pub point: (f64, f64), pub vector: Vector2D, }
Fields
point: (f64, f64)
The point that the segment starts out at
vector: Vector2D
The magnitude and the direction of the segment
Methods
impl Segment
[src]
fn intersects(&self, other: &Segment) -> Option<(f64, f64)>
Checks intersection for two segments. If the two segments intersect it returns the intersection point, otherwise it returns None
fn normalize(&self) -> Segment
Returns the normalized segment
fn shorten(&self, amount: f64) -> Segment
Returns a segment with a magnitude shortened by a certain amount
fn len(&self) -> f64
Returns the length of the segment
fn render(&self, color: Color, viewport: &mut Viewport, renderer: &mut Renderer)
Trait Implementations
impl Clone for Segment
[src]
fn clone(&self) -> Segment
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more