Struct tobj::Material [] [src]

pub struct Material {
    pub name: String,
    pub ambient: [f32; 3],
    pub diffuse: [f32; 3],
    pub specular: [f32; 3],
    pub shininess: f32,
    pub dissolve: f32,
    pub optical_density: f32,
    pub ambient_texture: String,
    pub diffuse_texture: String,
    pub specular_texture: String,
    pub normal_texture: String,
    pub dissolve_texture: String,
    pub unknown_param: HashMap<String, String>,
}

A material that may be referenced by one or more meshes. Standard MTL attributes are supported. Any unrecognized parameters will be stored as key-value pairs in the unknown_param HashMap, which maps the unknown parameter to the value set for it.

Fields

Material name as specified in the MTL file

Ambient color of the material

Diffuse color of the material

Specular color of the material

Material shininess attribute

Dissolve attribute is the alpha term for the material. Referred to as dissolve since that's what the MTL file format docs refer to it as

Optical density also known as index of refraction. Called optical_density in the MTL specc. Takes on a value between 0.001 and 10.0. 1.0 means light does not bend as it passed through the object.

Name of the ambient texture file for the material. No path is pre-pended to the texture file names specified in the MTL file

Name of the diffuse texture file for the material. No path is pre-pended to the texture file names specified in the MTL file

Name of the specular texture file for the material. No path is pre-pended to the texture file names specified in the MTL file

Name of the normal map texture file for the material. No path is pre-pended to the texture file names specified in the MTL file

Name of the alpha map texture file for the material. No path is pre-pended to the texture file names specified in the MTL file. Referred to as dissolve to match the MTL file format specification

Key value pairs of any unrecognized parameters encountered while parsing the material

Methods

impl Material
[src]

Trait Implementations

impl Clone for Material
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Material
[src]

Formats the value using the given formatter.