Struct truster::material::Material[][src]

pub struct Material {
    pub texture: Rc<dyn Texture>,
    pub ambient: f64,
    pub diffuse: f64,
    pub specular: f64,
    pub shininess: f64,
}
Expand description

Material with lighting properties. Give it to a shape to change its appearance.

Fields

texture: Rc<dyn Texture>ambient: f64diffuse: f64specular: f64shininess: f64

Implementations

Shades the object. Returns the color they would emit at position. light is the light that is lighting the scene. eye is the direction of the ‘eye’ that is looking at the scene. normal is the normal vector of the shape that the material is on at position. in_shadow should be true if position is in a shadow of light.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.