Struct ncollide2d::shape::Triangle [−][src]
pub struct Triangle<N: Real> { /* fields omitted */ }
A triangle shape.
Methods
impl<N: Real> Triangle<N>
[src]
impl<N: Real> Triangle<N>
pub fn new(a: Point<N>, b: Point<N>, c: Point<N>) -> Triangle<N>
[src]
pub fn new(a: Point<N>, b: Point<N>, c: Point<N>) -> Triangle<N>
Creates a triangle from three points.
pub fn from_array(arr: &[Point<N>; 3]) -> &Triangle<N>
[src]
pub fn from_array(arr: &[Point<N>; 3]) -> &Triangle<N>
Creates the reference to a triangle from the reference to an array of three points.
pub fn a(&self) -> &Point<N>
[src]
pub fn a(&self) -> &Point<N>
The fist point of this triangle.
pub fn b(&self) -> &Point<N>
[src]
pub fn b(&self) -> &Point<N>
The second point of this triangle.
pub fn c(&self) -> &Point<N>
[src]
pub fn c(&self) -> &Point<N>
The third point of this triangle.
pub fn as_array(&self) -> &[Point<N>; 3]
[src]
pub fn as_array(&self) -> &[Point<N>; 3]
Reference to an array containing the three vertices of this triangle.
pub fn normal(&self) -> Option<Unit<Vector<N>>>
[src]
pub fn normal(&self) -> Option<Unit<Vector<N>>>
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 scaled_normal(&self) -> Vector<N>
[src]
pub fn scaled_normal(&self) -> Vector<N>
A vector normal of this triangle.
The vector points such that it is collinear to AB × AC
(where ×
denotes the cross
product).
Trait Implementations
impl<N: Real> PointQuery<N> for Triangle<N>
[src]
impl<N: Real> PointQuery<N> for Triangle<N>
fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
[src]
fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
Projects a point on self
transformed by m
.
fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>
) -> (PointProjection<N>, FeatureId)
[src]
fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>
) -> (PointProjection<N>, FeatureId)
Projects a point on the boundary of self
transformed by m
and retuns the id of the feature the point was projected on. Read more
fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N
[src]
fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N
Computes the minimal distance between a point and self
transformed by m
.
fn contains_point(&self, m: &Isometry<N>, pt: &Point<N>) -> bool
[src]
fn contains_point(&self, m: &Isometry<N>, pt: &Point<N>) -> bool
Tests if the given point is inside of self
transformed by m
.
impl<N: Real> PointQueryWithLocation<N> for Triangle<N>
[src]
impl<N: Real> PointQueryWithLocation<N> for Triangle<N>
type Location = TrianglePointLocation<N>
Additional shape-specific projection information Read more
fn project_point_with_location(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> (PointProjection<N>, Self::Location)
[src]
fn project_point_with_location(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> (PointProjection<N>, Self::Location)
Projects a point on self
transformed by m
.
impl<N: PartialEq + Real> PartialEq for Triangle<N>
[src]
impl<N: PartialEq + Real> PartialEq for Triangle<N>
fn eq(&self, other: &Triangle<N>) -> bool
[src]
fn eq(&self, other: &Triangle<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Triangle<N>) -> bool
[src]
fn ne(&self, other: &Triangle<N>) -> bool
This method tests for !=
.
impl<N: Debug + Real> Debug for Triangle<N>
[src]
impl<N: Debug + Real> Debug for Triangle<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N: Clone + Real> Clone for Triangle<N>
[src]
impl<N: Clone + Real> Clone for Triangle<N>
fn clone(&self) -> Triangle<N>
[src]
fn clone(&self) -> Triangle<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N: Real> SupportMap<N> for Triangle<N>
[src]
impl<N: Real> SupportMap<N> for Triangle<N>
fn support_point(&self, m: &Isometry<N>, dir: &Vector<N>) -> Point<N>
[src]
fn support_point(&self, m: &Isometry<N>, dir: &Vector<N>) -> Point<N>
Evaluates the support function of the object. Read more
fn support_point_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>
) -> Point<N>
[src]
fn support_point_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>
) -> Point<N>
Same as self.support_point
except that dir
is normalized.
impl<N: Real> ToPolyline<N> for Triangle<N>
[src]
impl<N: Real> ToPolyline<N> for Triangle<N>
type DiscretizationParameter = ()
fn to_polyline(&self, _: ()) -> Polyline<N>
[src]
fn to_polyline(&self, _: ()) -> Polyline<N>
Builds a triangle mesh from this shape. Read more