Skip to content

Commit

Permalink
Core: Switch to this.is* = true. (mrdoob#24047)
Browse files Browse the repository at this point in the history
* Revert to this.is* = true

* Put back local variables

* Update tests

* Add missing this.is* property

* Update Color.js

Co-authored-by: Michael Herzog <[email protected]>
  • Loading branch information
2 people authored and abernier committed Sep 16, 2022
1 parent 8594a8d commit 0c1a84a
Show file tree
Hide file tree
Showing 100 changed files with 203 additions and 206 deletions.
4 changes: 2 additions & 2 deletions src/animation/AnimationObjectGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class AnimationObjectGroup {

constructor() {

this.isAnimationObjectGroup = true;

this.uuid = MathUtils.generateUUID();

// cached objects followed by the active ones
Expand Down Expand Up @@ -382,6 +384,4 @@ class AnimationObjectGroup {

}

AnimationObjectGroup.prototype.isAnimationObjectGroup = true;

export { AnimationObjectGroup };
5 changes: 2 additions & 3 deletions src/cameras/ArrayCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ class ArrayCamera extends PerspectiveCamera {

super();

this.isArrayCamera = true;

this.cameras = array;

}

}

ArrayCamera.prototype.isArrayCamera = true;


export { ArrayCamera };
4 changes: 2 additions & 2 deletions src/cameras/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Camera extends Object3D {

super();

this.isCamera = true;

this.type = 'Camera';

this.matrixWorldInverse = new Matrix4();
Expand Down Expand Up @@ -63,6 +65,4 @@ class Camera extends Object3D {

}

Camera.prototype.isCamera = true;

export { Camera };
4 changes: 2 additions & 2 deletions src/cameras/OrthographicCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class OrthographicCamera extends Camera {

super();

this.isOrthographicCamera = true;

this.type = 'OrthographicCamera';

this.zoom = 1;
Expand Down Expand Up @@ -131,6 +133,4 @@ class OrthographicCamera extends Camera {

}

OrthographicCamera.prototype.isOrthographicCamera = true;

export { OrthographicCamera };
4 changes: 2 additions & 2 deletions src/cameras/PerspectiveCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class PerspectiveCamera extends Camera {

super();

this.isPerspectiveCamera = true;

this.type = 'PerspectiveCamera';

this.fov = fov;
Expand Down Expand Up @@ -228,6 +230,4 @@ class PerspectiveCamera extends Camera {

}

PerspectiveCamera.prototype.isPerspectiveCamera = true;

export { PerspectiveCamera };
7 changes: 4 additions & 3 deletions src/core/BufferAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class BufferAttribute {

}

this.isBufferAttribute = true;

this.name = '';

this.array = array;
Expand Down Expand Up @@ -399,8 +401,6 @@ class BufferAttribute {

}

BufferAttribute.prototype.isBufferAttribute = true;

//

class Int8BufferAttribute extends BufferAttribute {
Expand Down Expand Up @@ -479,11 +479,12 @@ class Float16BufferAttribute extends BufferAttribute {

super( new Uint16Array( array ), itemSize, normalized );

this.isFloat16BufferAttribute = true;

}

}

Float16BufferAttribute.prototype.isFloat16BufferAttribute = true;

class Float32BufferAttribute extends BufferAttribute {

Expand Down
4 changes: 2 additions & 2 deletions src/core/BufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class BufferGeometry extends EventDispatcher {

super();

this.isBufferGeometry = true;

Object.defineProperty( this, 'id', { value: _id ++ } );

this.uuid = MathUtils.generateUUID();
Expand Down Expand Up @@ -1125,6 +1127,4 @@ class BufferGeometry extends EventDispatcher {

}

BufferGeometry.prototype.isBufferGeometry = true;

export { BufferGeometry };
4 changes: 2 additions & 2 deletions src/core/GLBufferAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ class GLBufferAttribute {

constructor( buffer, type, itemSize, elementSize, count ) {

this.isGLBufferAttribute = true;

this.buffer = buffer;
this.type = type;
this.itemSize = itemSize;
Expand Down Expand Up @@ -53,6 +55,4 @@ class GLBufferAttribute {

}

GLBufferAttribute.prototype.isGLBufferAttribute = true;

export { GLBufferAttribute };
4 changes: 2 additions & 2 deletions src/core/InstancedBufferAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class InstancedBufferAttribute extends BufferAttribute {

super( array, itemSize, normalized );

this.isInstancedBufferAttribute = true;

this.meshPerAttribute = meshPerAttribute;

}
Expand Down Expand Up @@ -44,6 +46,4 @@ class InstancedBufferAttribute extends BufferAttribute {

}

InstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;

export { InstancedBufferAttribute };
4 changes: 2 additions & 2 deletions src/core/InstancedBufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class InstancedBufferGeometry extends BufferGeometry {

super();

this.isInstancedBufferGeometry = true;

this.type = 'InstancedBufferGeometry';
this.instanceCount = Infinity;

Expand Down Expand Up @@ -41,6 +43,4 @@ class InstancedBufferGeometry extends BufferGeometry {

}

InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;

export { InstancedBufferGeometry };
4 changes: 2 additions & 2 deletions src/core/InstancedInterleavedBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class InstancedInterleavedBuffer extends InterleavedBuffer {

super( array, stride );

this.isInstancedInterleavedBuffer = true;

this.meshPerAttribute = meshPerAttribute;

}
Expand Down Expand Up @@ -43,6 +45,4 @@ class InstancedInterleavedBuffer extends InterleavedBuffer {

}

InstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;

export { InstancedInterleavedBuffer };
4 changes: 2 additions & 2 deletions src/core/InterleavedBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class InterleavedBuffer {

constructor( array, stride ) {

this.isInterleavedBuffer = true;

this.array = array;
this.stride = stride;
this.count = array !== undefined ? array.length / stride : 0;
Expand Down Expand Up @@ -140,6 +142,4 @@ class InterleavedBuffer {

}

InterleavedBuffer.prototype.isInterleavedBuffer = true;

export { InterleavedBuffer };
4 changes: 2 additions & 2 deletions src/core/InterleavedBufferAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class InterleavedBufferAttribute {

constructor( interleavedBuffer, itemSize, offset, normalized = false ) {

this.isInterleavedBufferAttribute = true;

this.name = '';

this.data = interleavedBuffer;
Expand Down Expand Up @@ -276,7 +278,5 @@ class InterleavedBufferAttribute {

}

InterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;


export { InterleavedBufferAttribute };
4 changes: 2 additions & 2 deletions src/core/Object3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Object3D extends EventDispatcher {

super();

this.isObject3D = true;

Object.defineProperty( this, 'id', { value: _object3DId ++ } );

this.uuid = MathUtils.generateUUID();
Expand Down Expand Up @@ -922,6 +924,4 @@ class Object3D extends EventDispatcher {
Object3D.DefaultUp = new Vector3( 0, 1, 0 );
Object3D.DefaultMatrixAutoUpdate = true;

Object3D.prototype.isObject3D = true;

export { Object3D };
4 changes: 2 additions & 2 deletions src/extras/curves/ArcCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class ArcCurve extends EllipseCurve {

super( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );

this.isArcCurve = true;

this.type = 'ArcCurve';

}

}

ArcCurve.prototype.isArcCurve = true;

export { ArcCurve };
4 changes: 2 additions & 2 deletions src/extras/curves/CatmullRomCurve3.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ class CatmullRomCurve3 extends Curve {

super();

this.isCatmullRomCurve3 = true;

this.type = 'CatmullRomCurve3';

this.points = points;
Expand Down Expand Up @@ -248,6 +250,4 @@ class CatmullRomCurve3 extends Curve {

}

CatmullRomCurve3.prototype.isCatmullRomCurve3 = true;

export { CatmullRomCurve3 };
4 changes: 2 additions & 2 deletions src/extras/curves/CubicBezierCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class CubicBezierCurve extends Curve {

super();

this.isCubicBezierCurve = true;

this.type = 'CubicBezierCurve';

this.v0 = v0;
Expand Down Expand Up @@ -73,6 +75,4 @@ class CubicBezierCurve extends Curve {

}

CubicBezierCurve.prototype.isCubicBezierCurve = true;

export { CubicBezierCurve };
4 changes: 2 additions & 2 deletions src/extras/curves/CubicBezierCurve3.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class CubicBezierCurve3 extends Curve {

super();

this.isCubicBezierCurve3 = true;

this.type = 'CubicBezierCurve3';

this.v0 = v0;
Expand Down Expand Up @@ -74,6 +76,4 @@ class CubicBezierCurve3 extends Curve {

}

CubicBezierCurve3.prototype.isCubicBezierCurve3 = true;

export { CubicBezierCurve3 };
4 changes: 2 additions & 2 deletions src/extras/curves/EllipseCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class EllipseCurve extends Curve {

super();

this.isEllipseCurve = true;

this.type = 'EllipseCurve';

this.aX = aX;
Expand Down Expand Up @@ -151,6 +153,4 @@ class EllipseCurve extends Curve {

}

EllipseCurve.prototype.isEllipseCurve = true;

export { EllipseCurve };
4 changes: 2 additions & 2 deletions src/extras/curves/LineCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class LineCurve extends Curve {

super();

this.isLineCurve = true;

this.type = 'LineCurve';

this.v1 = v1;
Expand Down Expand Up @@ -85,6 +87,4 @@ class LineCurve extends Curve {

}

LineCurve.prototype.isLineCurve = true;

export { LineCurve };
3 changes: 2 additions & 1 deletion src/extras/curves/LineCurve3.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ class LineCurve3 extends Curve {

super();

this.type = 'LineCurve3';
this.isLineCurve3 = true;

this.type = 'LineCurve3';

this.v1 = v1;
this.v2 = v2;

Expand Down
4 changes: 2 additions & 2 deletions src/extras/curves/QuadraticBezierCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class QuadraticBezierCurve extends Curve {

super();

this.isQuadraticBezierCurve = true;

this.type = 'QuadraticBezierCurve';

this.v0 = v0;
Expand Down Expand Up @@ -69,6 +71,4 @@ class QuadraticBezierCurve extends Curve {

}

QuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;

export { QuadraticBezierCurve };
4 changes: 2 additions & 2 deletions src/extras/curves/QuadraticBezierCurve3.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class QuadraticBezierCurve3 extends Curve {

super();

this.isQuadraticBezierCurve3 = true;

this.type = 'QuadraticBezierCurve3';

this.v0 = v0;
Expand Down Expand Up @@ -70,6 +72,4 @@ class QuadraticBezierCurve3 extends Curve {

}

QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;

export { QuadraticBezierCurve3 };
4 changes: 2 additions & 2 deletions src/extras/curves/SplineCurve.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class SplineCurve extends Curve {

super();

this.isSplineCurve = true;

this.type = 'SplineCurve';

this.points = points;
Expand Down Expand Up @@ -92,6 +94,4 @@ class SplineCurve extends Curve {

}

SplineCurve.prototype.isSplineCurve = true;

export { SplineCurve };
Loading

0 comments on commit 0c1a84a

Please sign in to comment.