pub trait Shape: Send + Sync {
    // Required methods
    fn intersects(&self, ray: Ray) -> Option<Hit>;
    fn bounds(&self) -> Bounds3;
}
Expand description

A general representation of shapes.

This allows performing ray intersections against them and accessing their bounding volumes.

Required Methods§

source

fn intersects(&self, ray: Ray) -> Option<Hit>

Return the corresponding hit, if self and ray intersect. Otherwise return None.

source

fn bounds(&self) -> Bounds3

Return the shape’s bounding volume.

Implementors§