[][src]Struct mgf::Triangle

pub struct Triangle {
    pub a: Vector3<f32>,
    pub b: Vector3<f32>,
    pub c: Vector3<f32>,
}

Three points in space.

Fields

a: Vector3<f32>

The first point in the triangle.

b: Vector3<f32>

The second point in the triangle.

c: Vector3<f32>

The third point in the triangle.

Methods

impl Triangle[src]

pub fn new(a: Point3<f32>, b: Point3<f32>, c: Point3<f32>) -> Self[src]

Create a new triangle.

pub fn normal(&self) -> Vector3<f32>[src]

Calculates the normal vector of a triangle. This is not cached.

pub fn barycentric(&self, p: Point3<f32>) -> (f32, f32, f32)[src]

Find the barycentric co-ordinates for a given point.

Trait Implementations

impl BoundedBy<AABB> for Triangle[src]

impl BoundedBy<Sphere> for Triangle[src]

impl Contains<Point3<f32>> for Triangle[src]

impl Contacts<Moving<Component>> for Triangle[src]

fn last_contact(&self, rhs: &RHS) -> Option<Contact>[src]

Returns the last contact found, if one exists.

impl Contacts<Triangle> for Moving<Sphere>[src]

fn last_contact(&self, rhs: &RHS) -> Option<Contact>[src]

Returns the last contact found, if one exists.

impl Contacts<Triangle> for Moving<Capsule>[src]

fn last_contact(&self, rhs: &RHS) -> Option<Contact>[src]

Returns the last contact found, if one exists.

impl Shape for Triangle[src]

fn set_pos(&mut self, p: Point3<f32>)[src]

Sets the center of the shape to p.

impl Polygon for Triangle[src]

impl Clone for Triangle[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<(Point3<f32>, Point3<f32>, Point3<f32>)> for Triangle[src]

impl From<Triangle> for Plane[src]

impl Copy for Triangle[src]

impl Debug for Triangle[src]

impl Add<Vector3<f32>> for Triangle[src]

type Output = Self

The resulting type after applying the + operator.

impl Sub<Vector3<f32>> for Triangle[src]

type Output = Self

The resulting type after applying the - operator.

impl AddAssign<Vector3<f32>> for Triangle[src]

impl SubAssign<Vector3<f32>> for Triangle[src]

Auto Trait Implementations

impl Send for Triangle

impl Sync for Triangle

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.