pub struct Triangle {
pub mesh: Arc<TriangleMesh>,
pub v: [u32; 3],
pub face_index: usize,
}
Fields§
§mesh: Arc<TriangleMesh>
§v: [u32; 3]
§face_index: usize
Implementations§
Source§impl Triangle
impl Triangle
pub fn new(mesh: &Arc<TriangleMesh>, v: &[u32; 3], face_index: usize) -> Self
pub fn calc_normal(&self, dpdu: &Vector3f, dpdv: &Vector3f) -> Normal3f
pub fn get_uvs(&self) -> [Vector2f; 3]
pub fn get_dpdu_dpdv( &self, p0: &Vector3f, p1: &Vector3f, p2: &Vector3f, ) -> Option<([Vector2f; 3], Vector3f, Vector3f)>
Trait Implementations§
Source§impl Shape for Triangle
impl Shape for Triangle
fn object_bound(&self) -> Bounds3f
fn world_bound(&self) -> Bounds3f
fn intersect(&self, r: &Ray) -> Option<(Float, SurfaceInteraction)>
fn intersect_p(&self, r: &Ray) -> bool
fn area(&self) -> Float
fn sample(&self, u: &Point2f) -> Option<(Interaction, Float)>
fn sample_from( &self, ref_: &Interaction, u: &Point2f, ) -> Option<(Interaction, Float)>
fn pdf(&self, _inter: &Interaction) -> Float
fn pdf_from(&self, inter: &Interaction, wi: &Vector3f) -> Float
fn solid_angle(&self, p: &Point3f, n_samples: i32) -> Float
Auto Trait Implementations§
impl Freeze for Triangle
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnwindSafe for Triangle
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more