Skip to main content

Geometry

Trait Geometry 

Source
pub trait Geometry: Send + Sync {
    // Required methods
    fn bounds(&self) -> Aabb;
    fn intersect(&self, ray: Ray, t_min: f32, t_max: f32) -> Option<GeometryHit>;
}
Expand description

A bounded, thread-safe ray-intersectable shape.

Required Methods§

Source

fn bounds(&self) -> Aabb

Returns a finite world-space bound for the shape.

Source

fn intersect(&self, ray: Ray, t_min: f32, t_max: f32) -> Option<GeometryHit>

Returns the closest intersection within the inclusive ray interval.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§