[][src]Trait raytracer::Material

pub trait Material: Sync + Send + 'static {
    fn scatter(&self, ray_in: &Ray, hit_data: &HitData) -> (Vec3, Ray);

    fn into_arc(self) -> Arc<dyn Material>
    where
        Self: Material + Sized + 'static
, { ... } }

Basic trait that every material must implement.

Required methods

fn scatter(&self, ray_in: &Ray, hit_data: &HitData) -> (Vec3, Ray)

Loading content...

Provided methods

fn into_arc(self) -> Arc<dyn Material> where
    Self: Material + Sized + 'static, 

Wraps the object implementing this trait with Atomic Rc pointer.

Used for multithreading.

Loading content...

Implementors

impl Material for Glass[src]

fn into_arc(self) -> Arc<dyn Material> where
    Self: Material + Sized + 'static, 
[src]

impl Material for Matte[src]

fn into_arc(self) -> Arc<dyn Material> where
    Self: Material + Sized + 'static, 
[src]

impl Material for Metal[src]

fn into_arc(self) -> Arc<dyn Material> where
    Self: Material + Sized + 'static, 
[src]

Loading content...