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