All files / src/WebGL/materials MeshLambertMaterial.ts

0% Statements 0/43
0% Branches 0/1
0% Functions 0/2
0% Lines 0/43

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80                                                                                                                                                               
import { Coloring } from "./../constants/Coloring";
import { Shading } from "./../constants/Shading";
import { Material } from "./Material";
//Mesh Lambert material
 
import { Color } from "../core/Color";
import { Vector3 } from "../math";
 
/** @constructor */
export class MeshLambertMaterial extends Material {
  combine: any;
  morphTargets: any;
  morphNormals: any;
 
  color = new Color(0xffffff);
  ambient = new Color(0xfffff);
  emissive = new Color(0x000000);
 
  //TODO: Which of these instance variables do I really need?
  wrapAround = false;
  wrapRGB = new Vector3(1, 1, 1);
  map = undefined;
  lightMap = null;
  specularMap = null;
  envMap = null;
  reflectivity = 1;
  refractionRatio = 0.98;
  fog = true;
  wireframe = false;
  wireframeLinewidth = 1;
  wireframeLinecap = "round";
  wireframeLinejoin = "round";
  shading = Shading.SmoothShading;
  shaderID = "lambert";
  vertexColors = Coloring.NoColors;
  skinning = false;
 
  voldata:any;
  volscheme:any;
 
  constructor(parameters?: any) {
    super();
    this.setValues(parameters);
  }
 
  clone<T extends this>(material: T = new MeshLambertMaterial() as T): T {
    super.clone.call(this, material);
 
    material.color.copy(this.color);
    material.ambient.copy(this.ambient);
    material.emissive.copy(this.emissive);
 
    material.wrapAround = this.wrapAround;
    material.wrapRGB.copy(this.wrapRGB);
 
    material.map = this.map;
 
    material.lightMap = this.lightMap;
 
    material.specularMap = this.specularMap;
 
    material.envMap = this.envMap;
    material.combine = this.combine;
    material.reflectivity = this.reflectivity;
    material.refractionRatio = this.refractionRatio;
 
    material.fog = this.fog;
 
    material.shading = this.shading;
    material.shaderID = this.shaderID;
    material.vertexColors = this.vertexColors;
 
    material.skinning = this.skinning;
    material.morphTargets = this.morphTargets;
    material.morphNormals = this.morphNormals;
 
    return material as T;
  }
}