Skip to content

Commit 4e2d3ab

Browse files
committed
prototype properties: Clean up.
1 parent b15a6fc commit 4e2d3ab

11 files changed

+28
-37
lines changed

examples/jsm/lines/LineGeometry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ class LineGeometry extends LineSegmentsGeometry {
99

1010
this.type = 'LineGeometry';
1111

12-
this.isLineGeometry = true;
13-
1412
}
1513

1614
setPositions( array ) {
@@ -93,4 +91,6 @@ class LineGeometry extends LineSegmentsGeometry {
9391

9492
}
9593

94+
LineGeometry.prototype.isLineGeometry = true;
95+
9696
export { LineGeometry };

examples/jsm/lines/LineSegmentsGeometry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class LineSegmentsGeometry extends InstancedBufferGeometry {
2828
this.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
2929
this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
3030

31-
this.isLineSegmentsGeometry = true;
32-
3331
}
3432

3533
applyMatrix4( matrix ) {
@@ -246,4 +244,6 @@ class LineSegmentsGeometry extends InstancedBufferGeometry {
246244

247245
}
248246

247+
LineSegmentsGeometry.prototype.isLineSegmentsGeometry = true;
248+
249249
export { LineSegmentsGeometry };

examples/jsm/lines/WireframeGeometry2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class WireframeGeometry2 extends LineSegmentsGeometry {
1515

1616
// set colors, maybe
1717

18-
this.isWireframeGeometry2 = true;
19-
2018
}
2119

2220
}
2321

22+
WireframeGeometry.prototype.isWireframeGeometry2 = true;
23+
2424
export { WireframeGeometry2 };

src/core/BufferAttribute.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ class BufferAttribute {
2929

3030
this.version = 0;
3131

32-
this.isBufferAttribute = true;
32+
}
33+
34+
set needsUpdate( value ) {
35+
36+
if ( value === true ) this.version ++;
3337

3438
}
3539

@@ -397,15 +401,7 @@ class BufferAttribute {
397401

398402
}
399403

400-
Object.defineProperty( BufferAttribute.prototype, 'needsUpdate', {
401-
402-
set( value ) {
403-
404-
if ( value === true ) this.version ++;
405-
406-
}
407-
408-
} );
404+
BufferAttribute.prototype.isBufferAttribute = true;
409405

410406
//
411407

src/core/EventDispatcher.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,4 @@ class EventDispatcher {
8181

8282
}
8383

84-
85-
8684
export { EventDispatcher };

src/core/Geometry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class Geometry extends EventDispatcher {
2121

2222
super();
2323

24-
this.isGeometry = true;
25-
2624
Object.defineProperty( this, 'id', { value: _geometryId += 2 } );
2725

2826
this.uuid = MathUtils.generateUUID();
@@ -1378,4 +1376,6 @@ class Geometry extends EventDispatcher {
13781376

13791377
}
13801378

1379+
Geometry.prototype.isGeometry = true;
1380+
13811381
export { Geometry };

src/core/InstancedBufferAttribute.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class InstancedBufferAttribute extends BufferAttribute {
1616

1717
}
1818

19-
this.isInstancedBufferAttribute = true,
20-
2119
this.meshPerAttribute = meshPerAttribute || 1;
2220

2321
}
@@ -46,4 +44,6 @@ class InstancedBufferAttribute extends BufferAttribute {
4644

4745
}
4846

47+
InstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;
48+
4949
export { InstancedBufferAttribute };

src/core/InstancedBufferGeometry.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ class InstancedBufferGeometry extends BufferGeometry {
55
constructor() {
66

77
super();
8-
this.isInstancedBufferGeometry = true,
98

109
this.type = 'InstancedBufferGeometry';
1110
this.instanceCount = Infinity;
@@ -42,4 +41,6 @@ class InstancedBufferGeometry extends BufferGeometry {
4241

4342
}
4443

44+
InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
45+
4546
export { InstancedBufferGeometry };

src/core/InstancedInterleavedBuffer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ class InstancedInterleavedBuffer extends InterleavedBuffer {
88

99
this.meshPerAttribute = meshPerAttribute || 1;
1010

11-
this.isInstancedInterleavedBuffer = true;
12-
1311
}
1412

1513
copy( source ) {
@@ -45,4 +43,6 @@ class InstancedInterleavedBuffer extends InterleavedBuffer {
4543

4644
}
4745

46+
InstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;
47+
4848
export { InstancedInterleavedBuffer };

src/core/InterleavedBuffer.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class InterleavedBuffer {
2020

2121
}
2222

23+
set needsUpdate( value ) {
24+
25+
if ( value === true ) this.version ++;
26+
27+
}
28+
2329
onUploadCallback() {}
2430

2531
setUsage( value ) {
@@ -138,14 +144,4 @@ class InterleavedBuffer {
138144

139145
}
140146

141-
Object.defineProperty( InterleavedBuffer.prototype, 'needsUpdate', {
142-
143-
set( value ) {
144-
145-
if ( value === true ) this.version ++;
146-
147-
}
148-
149-
} );
150-
151147
export { InterleavedBuffer };

0 commit comments

Comments
 (0)