Struct nobject_rs::Material

source ·
pub struct Material {
Show 22 fields pub name: String, pub ambient: Option<ColorType>, pub diffuse: Option<ColorType>, pub specular: Option<ColorType>, pub emissive_coefficient: Option<ColorType>, pub specular_exponent: Option<f32>, pub disolve: Option<DisolveType>, pub transparancy: Option<f32>, pub transmission_factor: Option<ColorType>, pub sharpness: Option<f32>, pub index_of_refraction: Option<f32>, pub illumination_mode: Option<u32>, pub texture_map_ambient: Option<ColorCorrectedMap>, pub texture_map_diffuse: Option<ColorCorrectedMap>, pub texture_map_specular: Option<ColorCorrectedMap>, pub shininess_map: Option<NonColorCorrectedMap>, pub disolve_map: Option<NonColorCorrectedMap>, pub displacement_map: Option<NonColorCorrectedMap>, pub decal: Option<NonColorCorrectedMap>, pub bump_map: Option<BumpMap>, pub reflection_map: Option<ReflectionMap>, pub anti_alias_map: Option<bool>,
}
Expand description

Defines a single material.

Fields§

§name: String

The name of the material. Corresponds to newmtl in the specification.

§ambient: Option<ColorType>

The ambient reflectivity value. Corresponds to Ka in the specification.

§diffuse: Option<ColorType>

The diffuse reflectivity value Corresponds to Kd in the specification.

§specular: Option<ColorType>

The specular reflectivity value Corresponds to Ks in the specification.

§emissive_coefficient: Option<ColorType>

The Emission Coefficient Corresponds to Ke in the specification.

§specular_exponent: Option<f32>

The specular exponent. Corresponds to Ns in the specification.

§disolve: Option<DisolveType>

The disolve. Corresponds to d in the specification.

§transparancy: Option<f32>

Transparancy. Corresponds to Tr in the specification.

§transmission_factor: Option<ColorType>

Transmission factor. Corresponds to Tf in the specification.

§sharpness: Option<f32>

Corresponds to sharpness in the specification.

§index_of_refraction: Option<f32>

Corresponds to Ni in the specification.

§illumination_mode: Option<u32>

Corresponds to illum in the specification.

§texture_map_ambient: Option<ColorCorrectedMap>

Corresponds to map_Ka in the specification.

§texture_map_diffuse: Option<ColorCorrectedMap>

Corresponds to map_Kd in the specification.

§texture_map_specular: Option<ColorCorrectedMap>

Corresponds to map_Ks in the specification.

§shininess_map: Option<NonColorCorrectedMap>

Corresponds to map_Ns in the specification.

§disolve_map: Option<NonColorCorrectedMap>

Corresponds to map_d in the specification.

§displacement_map: Option<NonColorCorrectedMap>

Corresponds to disp in the specification.

§decal: Option<NonColorCorrectedMap>

Corresponds to decal in the specification.

§bump_map: Option<BumpMap>

Corresponds to bump in the specification.

§reflection_map: Option<ReflectionMap>

Corresponds to refl in the specification.

§anti_alias_map: Option<bool>

Enables/Disables anti-aliasing of textures in THIS material only. Corresponds to map_aat in the specification.

Trait Implementations§

source§

impl Clone for Material

source§

fn clone(&self) -> Material

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Material

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Material

source§

fn default() -> Material

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

impl PartialEq for Material

source§

fn eq(&self, other: &Material) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Material

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.