Struct rapier2d::geometry::ConvexPolygon[][src]

pub struct ConvexPolygon { /* fields omitted */ }

A 2D convex polygon.

Implementations

impl ConvexPolygon[src]

pub fn aabb(&self, pos: &Isometry<f32, U2, Unit<Complex<f32>>>) -> AABB[src]

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

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

Computes the local-space AABB of this convex polygon.

impl ConvexPolygon[src]

pub fn bounding_sphere(
    &self,
    pos: &Isometry<f32, U2, Unit<Complex<f32>>>
) -> BoundingSphere
[src]

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

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

Computes the local-space bounding sphere of this convex polygon.

impl ConvexPolygon[src]

pub fn from_convex_hull(points: &[Point<f32, U2>]) -> Option<ConvexPolygon>[src]

Creates a new 2D convex polygon from an arbitrary set of points.

This explicitly computes the convex hull of the given set of points. Use Returns None if the convex hull computation failed.

pub fn from_convex_polyline(
    points: Vec<Point<f32, U2>, Global>
) -> Option<ConvexPolygon>
[src]

Creates a new 2D convex polygon from a set of points assumed to describe a counter-clockwise convex polyline.

Convexity of the input polyline is not checked. Returns None if all points form an almost flat line.

pub fn points(&self) -> &[Point<f32, U2>][src]

The vertices of this convex polygon.

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

The normals of the edges of this convex polygon.

pub fn support_feature_id_toward(
    &self,
    local_dir: &Unit<Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>>
) -> FeatureId
[src]

Get the ID of the feature with a normal that maximizes the dot product with local_dir.

Trait Implementations

impl Clone for ConvexPolygon[src]

impl Debug for ConvexPolygon[src]

impl PointQuery for ConvexPolygon[src]

impl PolygonalFeatureMap for ConvexPolygon[src]

impl RayCast for ConvexPolygon[src]

impl Shape for ConvexPolygon[src]

impl SupportMap for ConvexPolygon[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: Any + Send + Sync
[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<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.