pub struct TriangleFace {
pub a: Vector3,
pub b: Vector3,
pub c: Vector3,
pub normal: Vector3,
pub vertex_normals: Option<[Vector3; 3]>,
}Fields§
§a: Vector3§b: Vector3§c: Vector3§normal: Vector3The triangle’s own (flat) normal, from its winding.
vertex_normals: Option<[Vector3; 3]>The normal of the surface this triangle approximates, at each of
its three corners — what a renderer needs to shade a curved face
smoothly instead of as a field of facets. None where no surface
normal was available (a debug triangle, or a degenerate point like a
sphere’s pole), leaving a renderer with the flat Self::normal.
Implementations§
Source§impl TriangleFace
impl TriangleFace
Sourcepub fn try_new(a: Vector3, b: Vector3, c: Vector3) -> GeopResult<Self>
pub fn try_new(a: Vector3, b: Vector3, c: Vector3) -> GeopResult<Self>
Computes the normal from the cross product of (b-a) × (c-a). Fails if the cross product is zero (collinear or coincident points).
Sourcepub fn with_vertex_normals(self, normals: [Vector3; 3]) -> Self
pub fn with_vertex_normals(self, normals: [Vector3; 3]) -> Self
This triangle carrying the surface normals at its corners, each oriented to agree with the triangle’s own winding — a renderer picks front or back from the winding, so a vertex normal pointing the other way would light the face inside out.
Trait Implementations§
Source§impl Clone for TriangleFace
impl Clone for TriangleFace
Source§fn clone(&self) -> TriangleFace
fn clone(&self) -> TriangleFace
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TriangleFace
impl RefUnwindSafe for TriangleFace
impl Send for TriangleFace
impl Sync for TriangleFace
impl Unpin for TriangleFace
impl UnsafeUnpin for TriangleFace
impl UnwindSafe for TriangleFace
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