[−][src]Struct mgf::Triangle
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 Add<Vector3<f32>> for Triangle
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, v: Vector3<f32>) -> Triangle
[src]
impl AddAssign<Vector3<f32>> for Triangle
[src]
fn add_assign(&mut self, v: Vector3<f32>)
[src]
impl BoundedBy<AABB> for Triangle
[src]
impl BoundedBy<Sphere> for Triangle
[src]
impl Clone for Triangle
[src]
impl Contacts<Moving<Component>> for Triangle
[src]
fn contacts<F: FnMut(Contact)>(
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
[src]
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
impl Contacts<Triangle> for Moving<Sphere>
[src]
fn contacts<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool
[src]
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
impl Contacts<Triangle> for Moving<Capsule>
[src]
fn contacts<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool
[src]
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
impl Contains<Point3<f32>> for Triangle
[src]
impl Copy for Triangle
[src]
impl Debug for Triangle
[src]
impl<'de> Deserialize<'de> for Triangle
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<(Point3<f32>, Point3<f32>, Point3<f32>)> for Triangle
[src]
impl From<Triangle> for Plane
[src]
impl Polygon for Triangle
[src]
const NUM_VERTICES: usize
[src]
fn vertex(&self, i: usize) -> Point3<f32>
[src]
fn edge(&self, i: usize) -> (usize, usize)
[src]
impl Serialize for Triangle
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Shape for Triangle
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Sub<Vector3<f32>> for Triangle
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, v: Vector3<f32>) -> Triangle
[src]
impl SubAssign<Vector3<f32>> for Triangle
[src]
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnwindSafe for Triangle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,