pub struct Occluder { /* private fields */ }Expand description
A ray-traceable geometric surface with an attached material.
Implementations§
Source§impl Occluder
Implements factory constructors for Occluder.
impl Occluder
Implements factory constructors for Occluder.
Sourcepub fn triangle(
v0: Vector3D,
v1: Vector3D,
v2: Vector3D,
material: Material,
) -> Occluder
pub fn triangle( v0: Vector3D, v1: Vector3D, v2: Vector3D, material: Material, ) -> Occluder
Creates a triangular occluder from its three vertices.
The vertex order fixes the geometric winding; because the intersection test is two-sided the winding does not affect which faces produce hits, only the raw cross-product normal before it is oriented against the incoming ray.
§Arguments
Vector3D- The first triangle vertex.Vector3D- The second triangle vertex.Vector3D- The third triangle vertex.Material- The surface material.
§Returns
Occluder- The new triangle occluder.
Sourcepub fn occluder_points(&self) -> Vec<(Vector3D, f64)>
pub fn occluder_points(&self) -> Vec<(Vector3D, f64)>
Returns a list of (center, radius) sphere tuples approximating
this occluder, suitable for soft_shadow_factor.
For sphere occluders this returns (center, radius). For AABB
occluders the bounding sphere is computed conservatively from the
AABB extents.
§Returns
Vec<(Vector3D, f64)>- One bounding sphere per occluder.
Source§impl Occluder
impl Occluder
pub fn get_kind(&self) -> OccluderKind
pub fn get_mut_kind(&mut self) -> &mut OccluderKind
pub fn set_kind(&mut self, val: OccluderKind) -> &mut Self
pub fn get_center(&self) -> Vector3D
pub fn get_mut_center(&mut self) -> &mut Vector3D
pub fn set_center(&mut self, val: Vector3D) -> &mut Self
pub fn get_extent(&self) -> Vector3D
pub fn get_mut_extent(&mut self) -> &mut Vector3D
pub fn set_extent(&mut self, val: Vector3D) -> &mut Self
pub fn get_vertices(&self) -> [Vector3D; 3]
pub fn get_mut_vertices(&mut self) -> &mut [Vector3D; 3]
pub fn set_vertices(&mut self, val: [Vector3D; 3]) -> &mut Self
pub fn get_material(&self) -> &Material
pub fn get_mut_material(&mut self) -> &mut Material
pub fn set_material(&mut self, val: Material) -> &mut Self
Trait Implementations§
impl StructuralPartialEq for Occluder
Auto Trait Implementations§
impl Freeze for Occluder
impl RefUnwindSafe for Occluder
impl Send for Occluder
impl Sync for Occluder
impl Unpin for Occluder
impl UnsafeUnpin for Occluder
impl UnwindSafe for Occluder
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