Struct parry2d::shape::Segment[][src]

#[repr(C)]pub struct Segment {
    pub a: Point<Real>,
    pub b: Point<Real>,
}

A segment shape.

Fields

a: Point<Real>

The segment first point.

b: Point<Real>

The segment second point.

Implementations

impl Segment[src]

pub fn aabb(&self, pos: &Isometry<Real>) -> AABB[src]

Computes the world-space AABB of this segment, transformed by pos.

pub fn local_aabb(&self) -> AABB[src]

Computes the local-space AABB of this segment.

impl Segment[src]

pub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere[src]

Computes the world-space bounding sphere of this segment, transformed by pos.

pub fn local_bounding_sphere(&self) -> BoundingSphere[src]

Computes the local-space bounding sphere of this segment.

impl Segment[src]

pub fn new(a: Point<Real>, b: Point<Real>) -> Segment[src]

Creates a new segment from two points.

pub fn from_array(arr: &[Point<Real>; 2]) -> &Segment[src]

Creates the reference to a segment from the reference to an array of two points.

impl Segment[src]

pub fn scaled_direction(&self) -> Vector<Real>[src]

The direction of this segment scaled by its length.

Points from self.a toward self.b.

pub fn length(&self) -> Real[src]

The length of this segment.

pub fn swap(&mut self)[src]

Swaps the two vertices of this segment.

pub fn direction(&self) -> Option<Unit<Vector<Real>>>[src]

The unit direction of this segment.

Points from self.a() toward self.b(). Returns None is both points are equal.

pub fn scaled_normal(&self) -> Vector<Real>[src]

In 2D, the not-normalized counterclockwise normal of this segment.

pub fn normal(&self) -> Option<Unit<Vector<Real>>>[src]

In 2D, the normalized counterclockwise normal of this segment.

pub fn transformed(&self, m: &Isometry<Real>) -> Self[src]

Applies the isometry m to the vertices of this segment and returns the resulting segment.

pub fn point_at(&self, location: &SegmentPointLocation) -> Point<Real>[src]

Computes the point at the given location.

Trait Implementations

impl Clone for Segment[src]

impl Copy for Segment[src]

impl Debug for Segment[src]

impl From<[Point<f32, U2>; 2]> for Segment[src]

impl From<Segment> for PolygonalFeature[src]

impl PartialEq<Segment> for Segment[src]

impl PointQuery for Segment[src]

impl PointQueryWithLocation for Segment[src]

type Location = SegmentPointLocation

Additional shape-specific projection information Read more

impl PolygonalFeatureMap for Segment[src]

impl RayCast for Segment[src]

impl Shape for Segment[src]

impl StructuralPartialEq for Segment[src]

impl SupportMap for Segment[src]

Auto Trait Implementations

impl RefUnwindSafe for Segment

impl Send for Segment

impl Sync for Segment

impl Unpin for Segment

impl UnwindSafe for Segment

Blanket Implementations

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

impl<T> Az for T[src]

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

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

impl<T> CheckedAs for T[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Any + Send + Sync
[src]

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

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

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> OverflowingAs for T[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatingAs for T[src]

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Debug + Any
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[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.

impl<T> UnwrappedAs for T[src]

impl<T> WrappingAs for T[src]