Added support for Kd

This commit is contained in:
2018-06-15 17:36:51 +02:00
parent f6dd2a34ad
commit a487822790
6 changed files with 84 additions and 42 deletions
+5
View File
@@ -1,6 +1,7 @@
//! This module contains everything related to materials.
use std::collections::HashMap;
use math::vector::Vector3;
/// A 3D material.
#[derive(Clone)]
@@ -9,6 +10,9 @@ pub struct Material {
/// The name of the material.
pub name: String,
/// The diffuse color of the material.
pub diffuse: Vector3<f32>,
/// Map linking each texture map to its file path.
pub textures: HashMap<String, String>,
@@ -24,6 +28,7 @@ impl Material {
pub fn new(name: &str) -> Material {
Material {
name: name.to_owned(),
diffuse: Vector3::new(1.0, 1.0, 1.0),
textures: HashMap::new(),
unknown_instructions: vec![],
}