Trait Shape
Source pub trait Shape {
// Required methods
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)>;
// Provided methods
fn pdf(&self, _inter: &Interaction) -> Float { ... }
fn sample_from(
&self,
ref_: &Interaction,
u: &Point2f,
) -> Option<(Interaction, Float)> { ... }
fn pdf_from(&self, inter: &Interaction, wi: &Vector3f) -> Float { ... }
fn solid_angle(&self, p: &Point3f, n_samples: i32) -> Float { ... }
}