[−][src]Trait libraymarcher::SceneObject
Represents something that has a distance field (through SceneObject::distance_to
)
Required methods
fn distance_to(&self, point: Vec3, t: f64) -> f64
The distance from point
to the nearest surface of the object.
Also allows input of t
, the varied animation parameter
fn get_color(&self, t: f64) -> C
The color of this object. May be useful if there are multiple objects in the scene with different colors.
Provided methods
fn normal(&self, p: Vec3, t: f64) -> Vec3
Calculates the normal by finding the gradient of the distance field. This may be overridden if a more efficient implementation is available for a specific SceneObject.