File tree 3 files changed +15
-47
lines changed
3 files changed +15
-47
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ let materialId = 0;
6
6
7
7
class Material extends EventDispatcher {
8
8
9
- #alphaTest = 0 ;
10
-
11
9
constructor ( ) {
12
10
13
11
super ( ) ;
@@ -76,23 +74,25 @@ class Material extends EventDispatcher {
76
74
77
75
this . version = 0 ;
78
76
77
+ this . _alphaTest = 0 ;
78
+
79
79
}
80
80
81
81
get alphaTest ( ) {
82
82
83
- return this . #alphaTest ;
83
+ return this . _alphaTest ;
84
84
85
85
}
86
86
87
87
set alphaTest ( value ) {
88
88
89
- if ( this . #alphaTest > 0 !== value > 0 ) {
89
+ if ( this . _alphaTest > 0 !== value > 0 ) {
90
90
91
91
this . version ++ ;
92
92
93
93
}
94
94
95
- this . #alphaTest = value ;
95
+ this . _alphaTest = value ;
96
96
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -34,9 +34,6 @@ import * as MathUtils from '../math/MathUtils.js';
34
34
35
35
class MeshPhysicalMaterial extends MeshStandardMaterial {
36
36
37
- #clearcoat = 0 ;
38
- #transmission = 0 ;
39
-
40
37
constructor ( parameters ) {
41
38
42
39
super ( ) ;
@@ -86,43 +83,47 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
86
83
this . specularTint = new Color ( 1 , 1 , 1 ) ;
87
84
this . specularTintMap = null ;
88
85
86
+ this . _clearcoat = 0 ;
87
+ this . _transmission = 0 ;
88
+
89
+
89
90
this . setValues ( parameters ) ;
90
91
91
92
}
92
93
93
94
get clearcoat ( ) {
94
95
95
- return this . #clearcoat ;
96
+ return this . _clearcoat ;
96
97
97
98
}
98
99
99
100
set clearcoat ( value ) {
100
101
101
- if ( this . #clearcoat > 0 !== value > 0 ) {
102
+ if ( this . _clearcoat > 0 !== value > 0 ) {
102
103
103
104
this . version ++ ;
104
105
105
106
}
106
107
107
- this . #clearcoat = value ;
108
+ this . _clearcoat = value ;
108
109
109
110
}
110
111
111
112
get transmission ( ) {
112
113
113
- return this . #transmission ;
114
+ return this . _transmission ;
114
115
115
116
}
116
117
117
118
set transmission ( value ) {
118
119
119
- if ( this . #transmission > 0 !== value > 0 ) {
120
+ if ( this . _transmission > 0 !== value > 0 ) {
120
121
121
122
this . version ++ ;
122
123
123
124
}
124
125
125
- this . #transmission = value ;
126
+ this . _transmission = value ;
126
127
127
128
}
128
129
Original file line number Diff line number Diff line change @@ -277,44 +277,13 @@ ${ code }`;
277
277
278
278
}
279
279
280
- // Transform #properties to _properties until they're supported in bundlers
281
- // https://github.com/mrdoob/three.js/issues/22437
282
- function privateProperties ( ) {
283
-
284
- return {
285
-
286
- transform ( code , id ) {
287
-
288
- if ( / \. g l s l .j s $ / . test ( id ) === true ) return ;
289
-
290
- // replace `#property =` with `_property =`
291
- code = code . replace ( / # ( \w + ) = / g, ( match , p1 ) => `_${ p1 } =` ) ;
292
-
293
- // replace `#property;` with `_property;`
294
- code = code . replace ( / # ( \w + ) ; / g, ( match , p1 ) => `_${ p1 } ;` ) ;
295
-
296
- // replace `this.#property` with `this._property`
297
- code = code . replace ( / t h i s \. # ( \w + ) / g, ( match , p1 ) => `this._${ p1 } ` ) ;
298
-
299
- return {
300
- code : code ,
301
- map : null
302
- } ;
303
-
304
- }
305
-
306
- } ;
307
-
308
- }
309
-
310
280
let builds = [
311
281
{
312
282
input : 'src/Three.js' ,
313
283
plugins : [
314
284
addons ( ) ,
315
285
glconstants ( ) ,
316
286
glsl ( ) ,
317
- privateProperties ( ) ,
318
287
header ( )
319
288
] ,
320
289
output : [
@@ -329,7 +298,6 @@ let builds = [
329
298
plugins : [
330
299
addons ( ) ,
331
300
glsl ( ) ,
332
- privateProperties ( ) ,
333
301
babel ( {
334
302
babelHelpers : 'bundled' ,
335
303
compact : false ,
@@ -354,7 +322,6 @@ let builds = [
354
322
addons ( ) ,
355
323
glconstants ( ) ,
356
324
glsl ( ) ,
357
- privateProperties ( ) ,
358
325
babel ( {
359
326
babelHelpers : 'bundled' ,
360
327
babelrc : false ,
You can’t perform that action at this time.
0 commit comments