Skip to main content

Shape

Trait Shape 

Source
pub trait Shape<S>: Aabb<S> {
    // Required method
    fn to_primitive(
        &self,
        position: Point3<S>,
    ) -> Box<dyn Primitive<S, Point3<S>>>;
}
Expand description

A trait for bounded and unbounded shapes.

A ‘Shape’ implements the following traits:

  • ‘Aabb’ – a shape can compute the axis-aligned bounding volume that encloses it
  • ‘Bsphere’ – TODO: a shape can compute its bounding sphere

Required Methods§

Source

fn to_primitive(&self, position: Point3<S>) -> Box<dyn Primitive<S, Point3<S>>>

Implementors§

Source§

impl<S> Shape<S> for Bounded<S>
where S: Real + Real + RelativeEq + Debug + MaybeSerDes + 'static,

Source§

impl<S> Shape<S> for Unbounded<S>
where S: Real + FloatCore + RelativeEq + Debug + 'static,

Source§

impl<S> Shape<S> for Variant<S>
where S: Real + Real + FloatCore + RelativeEq + Debug + MaybeSerDes + 'static,

Source§

impl<S> Shape<S> for Capsule<S>
where S: Real + Real + Debug + MaybeSerDes + 'static,

Source§

impl<S> Shape<S> for Cone<S>
where S: Real + Real + RelativeEq + Debug + MaybeSerDes + 'static,

Source§

impl<S> Shape<S> for Cube<S>
where S: OrderedField + Debug + 'static,

Source§

impl<S> Shape<S> for Cuboid<S>
where S: OrderedField + Debug + 'static,

Source§

impl<S> Shape<S> for Cylinder<S>
where S: Real + Real + Debug + MaybeSerDes + 'static,

Source§

impl<S> Shape<S> for Halfspace<S>
where S: Real + FloatCore + RelativeEq + Debug + 'static,

Source§

impl<S> Shape<S> for Orthant
where S: Real + FloatCore + RelativeEq + Debug + 'static,

Source§

impl<S> Shape<S> for Sphere<S>
where S: Real + Real + Debug + MaybeSerDes + 'static,

Source§

impl<S> Shape<S> for Hull<S>
where S: Real + Real + Debug + MaybeSerDes + 'static,