[][src]Struct rapier3d::geometry::Triangle

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

A triangle shape.

Fields

a: Point<f32, U3>

The triangle first point.

b: Point<f32, U3>

The triangle second point.

c: Point<f32, U3>

The triangle third point.

Implementations

impl Triangle[src]

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

Creates a triangle from three points.

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

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

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

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

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

Returns a new triangle with vertices transformed by m.

pub fn edges_scaled_directions(
    &self
) -> [Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>; 3]
[src]

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

pub fn support_face(
    &self,
    _dir: Matrix<f32, U3, U1, <DefaultAllocator as Allocator<f32, U3, U1>>::Buffer>
) -> PolygonalFeature
[src]

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

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

The area of this triangle.

pub fn center(&self) -> Point<f32, U3>[src]

The geometric center of this triangle.

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

The perimeter of this triangle.

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

The circumcircle of this triangle.

pub fn is_affinely_dependent(&self) -> bool[src]

Tests if this triangle is affinely dependent, i.e., its points are almost aligned.

pub fn contains_point(&self, p: &Point<f32, U3>) -> 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, U3>; 3]> for Triangle[src]

impl From<Triangle> for PolygonalFeature[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> 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>,