Struct parry2d::shape::Triangle[][src]

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

A triangle shape.

Fields

a: Point<Real>

The triangle first point.

b: Point<Real>

The triangle second point.

c: Point<Real>

The triangle third point.

Implementations

impl Triangle[src]

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

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

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

Computes the local-space AABB of this triangle.

impl Triangle[src]

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

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

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

Computes the local-space bounding sphere of this triangle.

impl Triangle[src]

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

Creates a triangle from three points.

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

Creates the reference to a triangle from the reference to an array of three points.

pub fn vertices(&self) -> &[Point<Real>; 3][src]

Reference to an array containing the three vertices of this triangle.

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

The normal of this triangle assuming it is oriented ccw.

The normal points such that it is collinear to AB × AC (where × denotes the cross product).

pub fn edges(&self) -> [Segment; 3][src]

The three edges of this triangle: [AB, BC, CA].

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

Returns a new triangle with vertices transformed by m.

pub fn edges_scaled_directions(&self) -> [Vector<Real>; 3][src]

The three edges scaled directions of this triangle: [B - A, C - B, A - C].

pub fn local_support_edge_segment(&self, dir: Vector<Real>) -> Segment[src]

Return the edge segment of this cuboid with a normal cone containing a direction that that maximizes the dot product with local_dir.

pub fn support_face(&self, dir: Vector<Real>) -> PolygonalFeature[src]

Return the face of this triangle with a normal that maximizes the dot product with dir.

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

A vector normal of this triangle.

The vector points such that it is collinear to AB × AC (where × denotes the cross product).

pub fn extents_on_dir(&self, dir: &Unit<Vector<Real>>) -> (Real, Real)[src]

Computes the extents of this triangle on the given direction.

This computes the min and max values of the dot products between each vertex of this triangle and dir.

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

The area of this triangle.

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

Computes the unit angular inertia of this triangle.

pub fn center(&self) -> Point<Real>[src]

The geometric center of this triangle.

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

The perimeter of this triangle.

pub fn circumcircle(&self) -> (Point<Real>, Real)[src]

The circumcircle of this triangle.

pub fn contains_point(&self, p: &Point<Real>) -> bool[src]

Tests if a point is inside of this triangle.

Trait Implementations

impl Clone for Triangle[src]

impl Copy for Triangle[src]

impl Debug for Triangle[src]

impl From<[Point<f32, U2>; 3]> for Triangle[src]

impl PartialEq<Triangle> for Triangle[src]

impl PointQuery for Triangle[src]

impl PointQueryWithLocation for Triangle[src]

type Location = TrianglePointLocation

Additional shape-specific projection information Read more

impl PolygonalFeatureMap for Triangle[src]

impl RayCast for Triangle[src]

impl Shape for Triangle[src]

impl StructuralPartialEq for Triangle[src]

impl SupportMap for Triangle[src]

Auto Trait Implementations

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]