[][src]Struct rapier3d::geometry::Polygon

pub struct Polygon { /* fields omitted */ }

A convex planar polygon.

Implementations

impl Polygon[src]

pub fn new(vertices: Vec<Point<f32>>, normals: Vec<Vector<f32>>) -> Self[src]

Builds a new polygon from a set of vertices and normals.

The vertices must be ordered in such a way that two consecutive vertices determines an edge of the polygon. For example vertices[0], vertices[1] is an edge, vertices[1], vertices[2] is the next edge, etc. The last edge will be vertices[vertices.len() - 1], vertices[0]. The vertices must be given in counter-clockwise order. The vertices must form a convex polygon.

One normal must be provided per edge and mut point towards the outside of the polygon.

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

Compute the axis-aligned bounding box of the polygon.

pub fn vertices(&self) -> &[Point<f32>][src]

The vertices of this polygon.

Trait Implementations

impl Clone for Polygon[src]

Auto Trait Implementations

impl RefUnwindSafe for Polygon

impl Send for Polygon

impl Sync for Polygon

impl Unpin for Polygon

impl UnwindSafe for Polygon

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<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>,