pub struct Triangle3 {
pub a: Vec3,
pub b: Vec3,
pub c: Vec3,
}Expand description
3-D triangle with three vertices.
Fields§
§a: Vec3First vertex.
b: Vec3Second vertex.
c: Vec3Third vertex.
Implementations§
Source§impl Triangle3
impl Triangle3
Sourcepub fn raw_normal(&self) -> Vec3
pub fn raw_normal(&self) -> Vec3
(Non-unit) normal via the right-hand rule (b-a) × (c-a).
Sourcepub fn intersect_ray(&self, ray: &Ray3) -> Option<f64>
pub fn intersect_ray(&self, ray: &Ray3) -> Option<f64>
Möller–Trumbore ray-triangle intersection. Returns non-negative t.
Sourcepub fn closest_point(&self, p: Vec3) -> Vec3
pub fn closest_point(&self, p: Vec3) -> Vec3
Closest point on the triangle to p (Ericson, Real-Time Collision
Detection, §5.1.5).
Trait Implementations§
impl Copy for Triangle3
impl StructuralPartialEq for Triangle3
Auto Trait Implementations§
impl Freeze for Triangle3
impl RefUnwindSafe for Triangle3
impl Send for Triangle3
impl Sync for Triangle3
impl Unpin for Triangle3
impl UnsafeUnpin for Triangle3
impl UnwindSafe for Triangle3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more