[][src]Struct rapier3d::geometry::Segment

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

A segment shape.

Fields

a: Point<f32, U3>

The segment first point.

b: Point<f32, U3>

The segment second point.

Implementations

impl Segment[src]

pub fn aabb(&self, pos: &Isometry<f32, U3, Unit<Quaternion<f32>>>) -> 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<f32, U3, Unit<Quaternion<f32>>>
) -> 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<f32, U3>, b: Point<f32, U3>) -> Segment[src]

Creates a new segment from two points.

pub fn from_array(arr: &[Point<f32, U3>; 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
) -> Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>
[src]

The direction of this segment scaled by its length.

Points from self.a toward self.b.

pub fn length(&self) -> f32[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<Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>>>
[src]

The unit direction of this segment.

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

pub fn normal(
    &self
) -> Option<Unit<Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>>>
[src]

Returns None. Exists only for API similarity with the 2D parry.

pub fn transformed(
    &self,
    m: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> Segment
[src]

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

pub fn point_at(&self, location: &SegmentPointLocation) -> Point<f32, U3>[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, U3>; 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

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> Downcast for T where
    T: Any
[src]

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

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[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<V, T> VZip<V> for T where
    V: MultiLane<T>,