Trait Shape

Source
pub trait Shape: Pack + Instance<ShapeClass> {
    // Provided methods
    fn map<M: Map>(self, map: M) -> ShapeMapper<Self, M> { ... }
    fn cover<M: Material>(self, material: M) -> Covered<Self, M> { ... }
}
Expand description

Shape of an object.

It defines the search of the point where ray intersects this shape.

Provided Methods§

Source

fn map<M: Map>(self, map: M) -> ShapeMapper<Self, M>

Creates a new shape by applying some kind of mapping to previous one.

Most common use case is applying affine transform to some unit shape. (see map::Affine)

Source

fn cover<M: Material>(self, material: M) -> Covered<Self, M>

Transforms the shape in an object by covering it with material.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S: Shape, M: Map> Shape for ShapeMapper<S, M>