@@ -55,134 +55,134 @@ import { Color } from '../math/Color.js';
5555 * }
5656 */
5757
58- class MeshStandardMaterial extends Material {
58+ function MeshStandardMaterial ( parameters ) {
5959
60- constructor ( parameters ) {
60+ Material . call ( this ) ;
6161
62- super ( ) ;
62+ this . defines = { 'STANDARD' : '' } ;
6363
64- this . defines = { 'STANDARD' : '' } ;
64+ this . type = 'MeshStandardMaterial' ;
6565
66- this . type = 'MeshStandardMaterial' ;
66+ this . color = new Color ( 0xffffff ) ; // diffuse
67+ this . roughness = 1.0 ;
68+ this . metalness = 0.0 ;
6769
68- this . color = new Color ( 0xffffff ) ; // diffuse
69- this . roughness = 1.0 ;
70- this . metalness = 0.0 ;
70+ this . map = null ;
7171
72- this . map = null ;
72+ this . lightMap = null ;
73+ this . lightMapIntensity = 1.0 ;
7374
74- this . lightMap = null ;
75- this . lightMapIntensity = 1.0 ;
75+ this . aoMap = null ;
76+ this . aoMapIntensity = 1.0 ;
7677
77- this . aoMap = null ;
78- this . aoMapIntensity = 1.0 ;
78+ this . emissive = new Color ( 0x000000 ) ;
79+ this . emissiveIntensity = 1.0 ;
80+ this . emissiveMap = null ;
7981
80- this . emissive = new Color ( 0x000000 ) ;
81- this . emissiveIntensity = 1.0 ;
82- this . emissiveMap = null ;
82+ this . bumpMap = null ;
83+ this . bumpScale = 1 ;
8384
84- this . bumpMap = null ;
85- this . bumpScale = 1 ;
85+ this . normalMap = null ;
86+ this . normalMapType = TangentSpaceNormalMap ;
87+ this . normalScale = new Vector2 ( 1 , 1 ) ;
8688
87- this . normalMap = null ;
88- this . normalMapType = TangentSpaceNormalMap ;
89- this . normalScale = new Vector2 ( 1 , 1 ) ;
89+ this . displacementMap = null ;
90+ this . displacementScale = 1 ;
91+ this . displacementBias = 0 ;
9092
91- this . displacementMap = null ;
92- this . displacementScale = 1 ;
93- this . displacementBias = 0 ;
93+ this . roughnessMap = null ;
9494
95- this . roughnessMap = null ;
95+ this . metalnessMap = null ;
9696
97- this . metalnessMap = null ;
97+ this . alphaMap = null ;
9898
99- this . alphaMap = null ;
99+ this . envMap = null ;
100+ this . envMapIntensity = 1.0 ;
100101
101- this . envMap = null ;
102- this . envMapIntensity = 1.0 ;
102+ this . refractionRatio = 0.98 ;
103103
104- this . refractionRatio = 0.98 ;
104+ this . wireframe = false ;
105+ this . wireframeLinewidth = 1 ;
106+ this . wireframeLinecap = 'round' ;
107+ this . wireframeLinejoin = 'round' ;
105108
106- this . wireframe = false ;
107- this . wireframeLinewidth = 1 ;
108- this . wireframeLinecap = 'round' ;
109- this . wireframeLinejoin = 'round' ;
109+ this . skinning = false ;
110+ this . morphTargets = false ;
111+ this . morphNormals = false ;
110112
111- this . skinning = false ;
112- this . morphTargets = false ;
113- this . morphNormals = false ;
113+ this . flatShading = false ;
114114
115- this . flatShading = false ;
115+ this . vertexTangents = false ;
116116
117- this . vertexTangents = false ;
117+ this . setValues ( parameters ) ;
118118
119- this . setValues ( parameters ) ;
119+ }
120120
121- }
121+ MeshStandardMaterial . prototype = Object . create ( Material . prototype ) ;
122+ MeshStandardMaterial . prototype . constructor = MeshStandardMaterial ;
122123
123- copy ( source ) {
124+ MeshStandardMaterial . prototype . isMeshStandardMaterial = true ;
124125
125- super . copy ( source ) ;
126+ MeshStandardMaterial . prototype . copy = function ( source ) {
126127
127- this . defines = { 'STANDARD' : '' } ;
128+ Material . prototype . copy . call ( this , source ) ;
128129
129- this . color . copy ( source . color ) ;
130- this . roughness = source . roughness ;
131- this . metalness = source . metalness ;
130+ this . defines = { 'STANDARD' : '' } ;
132131
133- this . map = source . map ;
132+ this . color . copy ( source . color ) ;
133+ this . roughness = source . roughness ;
134+ this . metalness = source . metalness ;
134135
135- this . lightMap = source . lightMap ;
136- this . lightMapIntensity = source . lightMapIntensity ;
136+ this . map = source . map ;
137137
138- this . aoMap = source . aoMap ;
139- this . aoMapIntensity = source . aoMapIntensity ;
138+ this . lightMap = source . lightMap ;
139+ this . lightMapIntensity = source . lightMapIntensity ;
140140
141- this . emissive . copy ( source . emissive ) ;
142- this . emissiveMap = source . emissiveMap ;
143- this . emissiveIntensity = source . emissiveIntensity ;
141+ this . aoMap = source . aoMap ;
142+ this . aoMapIntensity = source . aoMapIntensity ;
144143
145- this . bumpMap = source . bumpMap ;
146- this . bumpScale = source . bumpScale ;
144+ this . emissive . copy ( source . emissive ) ;
145+ this . emissiveMap = source . emissiveMap ;
146+ this . emissiveIntensity = source . emissiveIntensity ;
147147
148- this . normalMap = source . normalMap ;
149- this . normalMapType = source . normalMapType ;
150- this . normalScale . copy ( source . normalScale ) ;
148+ this . bumpMap = source . bumpMap ;
149+ this . bumpScale = source . bumpScale ;
151150
152- this . displacementMap = source . displacementMap ;
153- this . displacementScale = source . displacementScale ;
154- this . displacementBias = source . displacementBias ;
151+ this . normalMap = source . normalMap ;
152+ this . normalMapType = source . normalMapType ;
153+ this . normalScale . copy ( source . normalScale ) ;
155154
156- this . roughnessMap = source . roughnessMap ;
155+ this . displacementMap = source . displacementMap ;
156+ this . displacementScale = source . displacementScale ;
157+ this . displacementBias = source . displacementBias ;
157158
158- this . metalnessMap = source . metalnessMap ;
159+ this . roughnessMap = source . roughnessMap ;
159160
160- this . alphaMap = source . alphaMap ;
161+ this . metalnessMap = source . metalnessMap ;
161162
162- this . envMap = source . envMap ;
163- this . envMapIntensity = source . envMapIntensity ;
163+ this . alphaMap = source . alphaMap ;
164164
165- this . refractionRatio = source . refractionRatio ;
165+ this . envMap = source . envMap ;
166+ this . envMapIntensity = source . envMapIntensity ;
166167
167- this . wireframe = source . wireframe ;
168- this . wireframeLinewidth = source . wireframeLinewidth ;
169- this . wireframeLinecap = source . wireframeLinecap ;
170- this . wireframeLinejoin = source . wireframeLinejoin ;
168+ this . refractionRatio = source . refractionRatio ;
171169
172- this . skinning = source . skinning ;
173- this . morphTargets = source . morphTargets ;
174- this . morphNormals = source . morphNormals ;
170+ this . wireframe = source . wireframe ;
171+ this . wireframeLinewidth = source . wireframeLinewidth ;
172+ this . wireframeLinecap = source . wireframeLinecap ;
173+ this . wireframeLinejoin = source . wireframeLinejoin ;
175174
176- this . flatShading = source . flatShading ;
175+ this . skinning = source . skinning ;
176+ this . morphTargets = source . morphTargets ;
177+ this . morphNormals = source . morphNormals ;
177178
178- this . vertexTangents = source . vertexTangents ;
179+ this . flatShading = source . flatShading ;
179180
180- return this ;
181+ this . vertexTangents = source . vertexTangents ;
181182
182- }
183+ return this ;
183184
184- }
185+ } ;
185186
186- MeshStandardMaterial . prototype . isMeshStandardMaterial = true ;
187187
188188export { MeshStandardMaterial } ;
0 commit comments