pub struct RtTriangle { /* private fields */ }Expand description
Local-space triangle storing vertices, smooth normals, texture coordinates, and precomputed edges for Möller–Trumbore intersection.
Implementations§
Source§impl RtTriangle
Constructors and barycentric attribute interpolation helpers for RtTriangle.
impl RtTriangle
Constructors and barycentric attribute interpolation helpers for RtTriangle.
Sourcepub fn from_vertices(
positions: [Vec3; 3],
normals: [Vec3; 3],
uvs: [Vec2; 3],
material_slot: u16,
) -> Self
pub fn from_vertices( positions: [Vec3; 3], normals: [Vec3; 3], uvs: [Vec2; 3], material_slot: u16, ) -> Self
Constructs a local-space triangle with explicit positions, smooth vertex normals, UVs, and material slot.
§Arguments
[Vec3; 3]- Triangle vertex positions[v0, v1, v2].[Vec3; 3]- Smooth vertex normals[n0, n1, n2].[Vec2; 3]- Primary texture coordinates[uv0, uv1, uv2].u16- Sub-material slot index.
§Returns
Self- Precomputed ray-traceable triangle.
Sourcepub fn from_positions(v0: Vec3, v1: Vec3, v2: Vec3) -> Self
pub fn from_positions(v0: Vec3, v1: Vec3, v2: Vec3) -> Self
Sourcepub fn interpolate_normal(&self, bary_u: f32, bary_v: f32) -> Vec3
pub fn interpolate_normal(&self, bary_u: f32, bary_v: f32) -> Vec3
Sourcepub fn interpolate_uv(&self, bary_u: f32, bary_v: f32) -> Vec2
pub fn interpolate_uv(&self, bary_u: f32, bary_v: f32) -> Vec2
Source§impl RtTriangle
Implements impl #impl_generics #name #ty_generics #where_clause.
impl RtTriangle
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_v0(&self) -> Vec3
pub fn get_mut_v0(&mut self) -> &mut Vec3
pub fn set_v0(&mut self, val: Vec3) -> &mut Self
pub fn get_edge1(&self) -> Vec3
pub fn get_mut_edge1(&mut self) -> &mut Vec3
pub fn set_edge1(&mut self, val: Vec3) -> &mut Self
pub fn get_edge2(&self) -> Vec3
pub fn get_mut_edge2(&mut self) -> &mut Vec3
pub fn set_edge2(&mut self, val: Vec3) -> &mut Self
pub fn get_n0(&self) -> Vec3
pub fn get_mut_n0(&mut self) -> &mut Vec3
pub fn set_n0(&mut self, val: Vec3) -> &mut Self
pub fn get_n1(&self) -> Vec3
pub fn get_mut_n1(&mut self) -> &mut Vec3
pub fn set_n1(&mut self, val: Vec3) -> &mut Self
pub fn get_n2(&self) -> Vec3
pub fn get_mut_n2(&mut self) -> &mut Vec3
pub fn set_n2(&mut self, val: Vec3) -> &mut Self
pub fn get_uv0(&self) -> Vec2
pub fn get_mut_uv0(&mut self) -> &mut Vec2
pub fn set_uv0(&mut self, val: Vec2) -> &mut Self
pub fn get_uv1(&self) -> Vec2
pub fn get_mut_uv1(&mut self) -> &mut Vec2
pub fn set_uv1(&mut self, val: Vec2) -> &mut Self
pub fn get_uv2(&self) -> Vec2
pub fn get_mut_uv2(&mut self) -> &mut Vec2
pub fn set_uv2(&mut self, val: Vec2) -> &mut Self
pub fn get_geometric_normal(&self) -> Vec3
pub fn get_mut_geometric_normal(&mut self) -> &mut Vec3
pub fn set_geometric_normal(&mut self, val: Vec3) -> &mut Self
pub fn get_bounds(&self) -> AxisAlignedBox3D
pub fn get_mut_bounds(&mut self) -> &mut AxisAlignedBox3D
pub fn set_bounds(&mut self, val: AxisAlignedBox3D) -> &mut Self
pub fn get_centroid(&self) -> Vec3
pub fn get_mut_centroid(&mut self) -> &mut Vec3
pub fn set_centroid(&mut self, val: Vec3) -> &mut Self
pub fn get_material_slot(&self) -> u16
pub fn get_mut_material_slot(&mut self) -> &mut u16
pub fn set_material_slot(&mut self, val: u16) -> &mut Self
Trait Implementations§
Source§impl Clone for RtTriangle
impl Clone for RtTriangle
impl Copy for RtTriangle
Source§impl Debug for RtTriangle
impl Debug for RtTriangle
Source§impl PartialEq for RtTriangle
impl PartialEq for RtTriangle
impl StructuralPartialEq for RtTriangle
Auto Trait Implementations§
impl Forget for RtTriangle
impl Freeze for RtTriangle
impl Move for RtTriangle
impl RefUnwindSafe for RtTriangle
impl Send for RtTriangle
impl Sync for RtTriangle
impl Unpin for RtTriangle
impl UnsafeUnpin for RtTriangle
impl UnwindSafe for RtTriangle
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