1 /**
2 * @author mrdoob / http://mrdoob.com/
3 * @author alteredq / http://alteredqualia.com/
4 */
5
6 /**@constructor*/
7 THREE.Material = function () {
8
9 THREE.MaterialLibrary.push( this );
10
11 this.id = THREE.MaterialIdCount ++;
12
13 this.name = '';
14
15 this.side = THREE.FrontSide;
16
17 this.opacity = 1;
18 this.transparent = false;
19
20 this.blending = THREE.NormalBlending;
21
22 this.blendSrc = THREE.SrcAlphaFactor;
23 this.blendDst = THREE.OneMinusSrcAlphaFactor;
24 this.blendEquation = THREE.AddEquation;
25
26 this.depthTest = true;
27 this.depthWrite = true;
28
29 this.polygonOffset = false;
30 this.polygonOffsetFactor = 0;
31 this.polygonOffsetUnits = 0;
32
33 this.alphaTest = 0;
34
35 this.overdraw = false; // Boolean for fixing antialiasing gaps in CanvasRenderer
36
37 this.visible = true;
38
39 this.needsUpdate = true;
40
41 };
42
43 THREE.Material.prototype.setValues = function ( values ) {
44
45 if ( values === undefined ) return;
46
47 for ( var key in values ) {
48
49 var newValue = values[ key ];
50
51 if ( newValue === undefined ) {
52
53 console.warn( 'THREE.Material: \'' + key + '\' parameter is undefined.' );
54 continue;
55
56 }
57
58 if ( key in this ) {
59
60 var currentValue = this[ key ];
61
62 if ( currentValue instanceof THREE.Color && newValue instanceof THREE.Color ) {
63
64 currentValue.copy( newValue );
65
66 } else if ( currentValue instanceof THREE.Color && typeof( newValue ) === "number" ) {
67
68 currentValue.setHex( newValue );
69
70 } else if ( currentValue instanceof THREE.Vector3 && newValue instanceof THREE.Vector3 ) {
71
72 currentValue.copy( newValue );
73
74 } else {
75
76 this[ key ] = newValue;
77
78 }
79
80 }
81
82 }
83
84 };
85
86 THREE.Material.prototype.clone = function ( material ) {
87
88 if ( material === undefined ) material = new THREE.Material();
89
90 material.name = this.name;
91
92 material.side = this.side;
93
94 material.opacity = this.opacity;
95 material.transparent = this.transparent;
96
97 material.blending = this.blending;
98
99 material.blendSrc = this.blendSrc;
100 material.blendDst = this.blendDst;
101 material.blendEquation = this.blendEquation;
102
103 material.depthTest = this.depthTest;
104 material.depthWrite = this.depthWrite;
105
106 material.polygonOffset = this.polygonOffset;
107 material.polygonOffsetFactor = this.polygonOffsetFactor;
108 material.polygonOffsetUnits = this.polygonOffsetUnits;
109
110 material.alphaTest = this.alphaTest;
111
112 material.overdraw = this.overdraw;
113
114 material.visible = this.visible;
115
116 return material;
117
118 };
119
120 THREE.Material.prototype.deallocate = function () {
121
122 var index = THREE.MaterialLibrary.indexOf( this );
123 if ( index !== -1 ) THREE.MaterialLibrary.splice( index, 1 );
124
125 };
126
127 /**@fieldOf THREE
128 @field
129 @name MaterialIdCount*/
130 THREE.MaterialIdCount = 0;
131 /**@fieldOf THREE
132 @field
133 @name MaterialLibrary*/
134 THREE.MaterialLibrary = [];
135
nike free rn
new balance hombre baratas
cinturones gucci
ugg rebajas
cinturon gucci
ray ban baratas
nike cortez
peuterey mujer
christian louboutin madrid
mbt zapatos
gafas ray ban baratas
mbt ofertas
air max blancas
mbt barcelona
nike air max 90
woolrich barcelona
nike mujer
botas ugg
gafas de sol carrera aratas
air max 2016 baratas
oakley baratas
nike air max 2016