[][src]Struct vek::geom::repr_c::LineSegment3

pub struct LineSegment3<T> {
    pub start: Vec3<T>,
    pub end: Vec3<T>,
}

3D Line segment, represented by two points, start and end.

Fields

start: Vec3<T>end: Vec3<T>

Implementations

impl<T> LineSegment3<T>[src]

pub fn into_range(self) -> Range<Vec3<T>>[src]

Converts this line segment into a range of points.

pub fn projected_point(self, p: Vec3<T>) -> Vec3<T> where
    T: Real + Add<T, Output = T> + RelativeEq
[src]

Project the given point onto the line segment (equivalent to 'snapping' the point to the closest point on the line segment).

pub fn distance_to_point(self, p: Vec3<T>) -> T where
    T: Real + Add<T, Output = T> + RelativeEq
[src]

Get the smallest distance between the line segment and a point.

pub fn as_<D>(self) -> LineSegment3<D> where
    T: AsPrimitive<D>,
    D: 'static + Copy
[src]

Converts this line to a line of another type, using the as conversion.

Trait Implementations

impl<T: Clone> Clone for LineSegment3<T>[src]

impl<T: Copy> Copy for LineSegment3<T>[src]

impl<T: Debug> Debug for LineSegment3<T>[src]

impl<T: Default> Default for LineSegment3<T>[src]

impl<'de, T> Deserialize<'de> for LineSegment3<T> where
    T: Deserialize<'de>, 
[src]

impl<T: Eq> Eq for LineSegment3<T>[src]

impl<T: Real> From<LineSegment3<T>> for QuadraticBezier3<T>[src]

impl<T: Real + Lerp<T, Output = T>> From<LineSegment3<T>> for CubicBezier3<T>[src]

impl<T> From<Range<Vec3<T>>> for LineSegment3<T>[src]

impl<T: Hash> Hash for LineSegment3<T>[src]

impl<T: PartialEq> PartialEq<LineSegment3<T>> for LineSegment3<T>[src]

impl<T> Serialize for LineSegment3<T> where
    T: Serialize
[src]

impl<T> StructuralEq for LineSegment3<T>[src]

impl<T> StructuralPartialEq for LineSegment3<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for LineSegment3<T> where
    T: RefUnwindSafe

impl<T> Send for LineSegment3<T> where
    T: Send

impl<T> Sync for LineSegment3<T> where
    T: Sync

impl<T> Unpin for LineSegment3<T> where
    T: Unpin

impl<T> UnwindSafe for LineSegment3<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.