pub trait Sdf {
// Required method
fn distance(&self, p: [f64; 3]) -> f64;
// Provided method
fn normal(&self, p: [f64; 3]) -> [f64; 3] { ... }
}Expand description
A Signed Distance Field: maps a 3-D point to the signed distance to the nearest surface (negative inside, positive outside).
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".