Struct mgf::Triangle [−][src]
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]
impl Triangle
pub fn new(a: Point3<f32>, b: Point3<f32>, c: Point3<f32>) -> Self
[src]
pub fn new(a: Point3<f32>, b: Point3<f32>, c: Point3<f32>) -> Self
Create a new triangle.
pub fn normal(&self) -> Vector3<f32>
[src]
pub fn normal(&self) -> Vector3<f32>
Calculates the normal vector of a triangle. This is not cached.
pub fn barycentric(&self, p: Point3<f32>) -> (f32, f32, f32)
[src]
pub fn barycentric(&self, p: Point3<f32>) -> (f32, f32, f32)
Find the barycentric co-ordinates for a given point.
Trait Implementations
impl BoundedBy<AABB> for Triangle
[src]
impl BoundedBy<AABB> for Triangle
impl BoundedBy<Sphere> for Triangle
[src]
impl BoundedBy<Sphere> for Triangle
impl Contacts<Moving<Component>> for Triangle
[src]
impl Contacts<Moving<Component>> for Triangle
fn contacts<F: FnMut(Contact)>(
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
[src]
fn contacts<F: FnMut(Contact)>(
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
Returns the last contact found, if one exists.
impl Contains<Point3<f32>> for Triangle
[src]
impl Contains<Point3<f32>> for Triangle
fn contains(&self, p: &Point3<f32>) -> bool
[src]
fn contains(&self, p: &Point3<f32>) -> bool
Returns true if the current object contains the argument.
impl Contacts<Triangle> for Moving<Sphere>
[src]
impl Contacts<Triangle> for Moving<Sphere>
fn contacts<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool
[src]
fn contacts<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
Returns the last contact found, if one exists.
impl Contacts<Triangle> for Moving<Capsule>
[src]
impl Contacts<Triangle> for Moving<Capsule>
fn contacts<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool
[src]
fn contacts<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
Returns the last contact found, if one exists.
impl Copy for Triangle
[src]
impl Copy for Triangle
impl Clone for Triangle
[src]
impl Clone for Triangle
fn clone(&self) -> Triangle
[src]
fn clone(&self) -> Triangle
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 Debug for Triangle
[src]
impl Debug for Triangle
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 From<(Point3<f32>, Point3<f32>, Point3<f32>)> for Triangle
[src]
impl From<(Point3<f32>, Point3<f32>, Point3<f32>)> for Triangle
impl From<Triangle> for Plane
[src]
impl From<Triangle> for Plane
impl Add<Vector3<f32>> for Triangle
[src]
impl Add<Vector3<f32>> for Triangle
type Output = Self
The resulting type after applying the +
operator.
fn add(self, v: Vector3<f32>) -> Triangle
[src]
fn add(self, v: Vector3<f32>) -> Triangle
Performs the +
operation.
impl Sub<Vector3<f32>> for Triangle
[src]
impl Sub<Vector3<f32>> for Triangle
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, v: Vector3<f32>) -> Triangle
[src]
fn sub(self, v: Vector3<f32>) -> Triangle
Performs the -
operation.
impl AddAssign<Vector3<f32>> for Triangle
[src]
impl AddAssign<Vector3<f32>> for Triangle
fn add_assign(&mut self, v: Vector3<f32>)
[src]
fn add_assign(&mut self, v: Vector3<f32>)
Performs the +=
operation.
impl SubAssign<Vector3<f32>> for Triangle
[src]
impl SubAssign<Vector3<f32>> for Triangle
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
fn sub_assign(&mut self, v: Vector3<f32>)
Performs the -=
operation.
impl Shape for Triangle
[src]
impl Shape for Triangle
fn center(&self) -> Point3<f32>
[src]
fn center(&self) -> Point3<f32>
Returns the center of mass of the geometry, assuming a regular density.
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
Returns the closest point on the shape to the given point.
fn set_pos(&mut self, p: Point3<f32>)
[src]
fn set_pos(&mut self, p: Point3<f32>)
Sets the center of the shape to p.
impl Polygon for Triangle
[src]
impl Polygon for Triangle