source: other-projects/playing-in-the-street/summer-2013/trunk/Playing-in-the-Street-WPF/Content/Web/mrdoob-three.js-4862f5f/src/materials/MeshLambertMaterial.js@ 28897

Last change on this file since 28897 was 28897, checked in by davidb, 10 years ago

GUI front-end to server base plus web page content

File size: 2.8 KB
Line 
1/**
2 * @author mrdoob / http://mrdoob.com/
3 * @author alteredq / http://alteredqualia.com/
4 *
5 * parameters = {
6 * color: <hex>,
7 * ambient: <hex>,
8 * emissive: <hex>,
9 * opacity: <float>,
10 *
11 * map: new THREE.Texture( <Image> ),
12 *
13 * lightMap: new THREE.Texture( <Image> ),
14 *
15 * specularMap: new THREE.Texture( <Image> ),
16 *
17 * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),
18 * combine: THREE.Multiply,
19 * reflectivity: <float>,
20 * refractionRatio: <float>,
21 *
22 * shading: THREE.SmoothShading,
23 * blending: THREE.NormalBlending,
24 * depthTest: <bool>,
25 * depthWrite: <bool>,
26 *
27 * wireframe: <boolean>,
28 * wireframeLinewidth: <float>,
29 *
30 * vertexColors: THREE.NoColors / THREE.VertexColors / THREE.FaceColors,
31 *
32 * skinning: <bool>,
33 * morphTargets: <bool>,
34 * morphNormals: <bool>,
35 *
36 * fog: <bool>
37 * }
38 */
39
40THREE.MeshLambertMaterial = function ( parameters ) {
41
42 THREE.Material.call( this );
43
44 this.color = new THREE.Color( 0xffffff ); // diffuse
45 this.ambient = new THREE.Color( 0xffffff );
46 this.emissive = new THREE.Color( 0x000000 );
47
48 this.wrapAround = false;
49 this.wrapRGB = new THREE.Vector3( 1, 1, 1 );
50
51 this.map = null;
52
53 this.lightMap = null;
54
55 this.specularMap = null;
56
57 this.envMap = null;
58 this.combine = THREE.MultiplyOperation;
59 this.reflectivity = 1;
60 this.refractionRatio = 0.98;
61
62 this.fog = true;
63
64 this.shading = THREE.SmoothShading;
65
66 this.wireframe = false;
67 this.wireframeLinewidth = 1;
68 this.wireframeLinecap = 'round';
69 this.wireframeLinejoin = 'round';
70
71 this.vertexColors = THREE.NoColors;
72
73 this.skinning = false;
74 this.morphTargets = false;
75 this.morphNormals = false;
76
77 this.setValues( parameters );
78
79};
80
81THREE.MeshLambertMaterial.prototype = Object.create( THREE.Material.prototype );
82
83THREE.MeshLambertMaterial.prototype.clone = function () {
84
85 var material = new THREE.MeshLambertMaterial();
86
87 THREE.Material.prototype.clone.call( this, material );
88
89 material.color.copy( this.color );
90 material.ambient.copy( this.ambient );
91 material.emissive.copy( this.emissive );
92
93 material.wrapAround = this.wrapAround;
94 material.wrapRGB.copy( this.wrapRGB );
95
96 material.map = this.map;
97
98 material.lightMap = this.lightMap;
99
100 material.specularMap = this.specularMap;
101
102 material.envMap = this.envMap;
103 material.combine = this.combine;
104 material.reflectivity = this.reflectivity;
105 material.refractionRatio = this.refractionRatio;
106
107 material.fog = this.fog;
108
109 material.shading = this.shading;
110
111 material.wireframe = this.wireframe;
112 material.wireframeLinewidth = this.wireframeLinewidth;
113 material.wireframeLinecap = this.wireframeLinecap;
114 material.wireframeLinejoin = this.wireframeLinejoin;
115
116 material.vertexColors = this.vertexColors;
117
118 material.skinning = this.skinning;
119 material.morphTargets = this.morphTargets;
120 material.morphNormals = this.morphNormals;
121
122 return material;
123
124};
Note: See TracBrowser for help on using the repository browser.