Skip to content

Commit

Permalink
Examples: Switch to this.is* = true. (mrdoob#24092)
Browse files Browse the repository at this point in the history
* Exampels: Switch to this.is* = true.

* Examples: Clean up.
  • Loading branch information
Mugen87 authored and abernier committed Sep 16, 2022
1 parent 732f02d commit 2a45c46
Show file tree
Hide file tree
Showing 65 changed files with 173 additions and 160 deletions.
12 changes: 6 additions & 6 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class TransformControls extends Object3D {

}

this.isTransformControls = true;

this.visible = false;
this.domElement = domElement;
this.domElement.style.touchAction = 'none'; // disable touch scroll
Expand Down Expand Up @@ -641,8 +643,6 @@ class TransformControls extends Object3D {

}

TransformControls.prototype.isTransformControls = true;

// mouse / touch event handlers

function getPointer( event ) {
Expand Down Expand Up @@ -766,6 +766,8 @@ class TransformControlsGizmo extends Object3D {

super();

this.isTransformControlsGizmo = true;

this.type = 'TransformControlsGizmo';

// shared materials
Expand Down Expand Up @@ -1456,8 +1458,6 @@ class TransformControlsGizmo extends Object3D {

}

TransformControlsGizmo.prototype.isTransformControlsGizmo = true;

//

class TransformControlsPlane extends Mesh {
Expand All @@ -1469,6 +1469,8 @@ class TransformControlsPlane extends Mesh {
new MeshBasicMaterial( { visible: false, wireframe: true, side: DoubleSide, transparent: true, opacity: 0.1, toneMapped: false } )
);

this.isTransformControlsPlane = true;

this.type = 'TransformControlsPlane';

}
Expand Down Expand Up @@ -1551,6 +1553,4 @@ class TransformControlsPlane extends Mesh {

}

TransformControlsPlane.prototype.isTransformControlsPlane = true;

export { TransformControls, TransformControlsGizmo, TransformControlsPlane };
4 changes: 2 additions & 2 deletions examples/jsm/geometries/LightningStrike.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class LightningStrike extends BufferGeometry {

super();

this.isLightningStrike = true;

this.type = 'LightningStrike';

// Set parameters, and set undefined parameters to default values
Expand Down Expand Up @@ -1001,8 +1003,6 @@ class LightningStrike extends BufferGeometry {

}

LightningStrike.prototype.isLightningStrike = true;

// Ray states
LightningStrike.RAY_INITIALIZED = 0;
LightningStrike.RAY_UNBORN = 1;
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/helpers/ViewHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class ViewHelper extends THREE.Object3D {

super();

this.isViewHelper = true;

this.animating = false;
this.controls = null;

Expand Down Expand Up @@ -290,6 +292,4 @@ class ViewHelper extends THREE.Object3D {

}

ViewHelper.prototype.isViewHelper = true;

export { ViewHelper };
12 changes: 6 additions & 6 deletions examples/jsm/libs/flow.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ class Element extends Serializer {

super();

this.isElement = true;

const dom = document.createElement( 'f-element' );
dom.element = this;

Expand Down Expand Up @@ -1096,14 +1098,14 @@ class Element extends Serializer {

}

Element.prototype.isElement = true;

class Input extends Serializer {

constructor( dom ) {

super();

this.isInput = true;

this.dom = dom;

this.element = null;
Expand Down Expand Up @@ -1232,14 +1234,14 @@ class Input extends Serializer {

}

Input.prototype.isInput = true;

class Node extends Serializer {

constructor() {

super();

this.isNode = true;

const dom = document.createElement( 'f-node' );

const onDown = () => {
Expand Down Expand Up @@ -1512,8 +1514,6 @@ class Node extends Serializer {

}

Node.prototype.isNode = true;

class DraggableElement extends Element {

constructor( draggable = true ) {
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/lines/Line2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class Line2 extends LineSegments2 {

super( geometry, material );

this.isLine2 = true;

this.type = 'Line2';

}

}

Line2.prototype.isLine2 = true;

export { Line2 };
5 changes: 3 additions & 2 deletions examples/jsm/lines/LineGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ class LineGeometry extends LineSegmentsGeometry {
constructor() {

super();

this.isLineGeometry = true;

this.type = 'LineGeometry';

}
Expand Down Expand Up @@ -82,6 +85,4 @@ class LineGeometry extends LineSegmentsGeometry {

}

LineGeometry.prototype.isLineGeometry = true;

export { LineGeometry };
4 changes: 2 additions & 2 deletions examples/jsm/lines/LineMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ class LineMaterial extends ShaderMaterial {

} );

this.isLineMaterial = true;

Object.defineProperties( this, {

color: {
Expand Down Expand Up @@ -697,6 +699,4 @@ class LineMaterial extends ShaderMaterial {

}

LineMaterial.prototype.isLineMaterial = true;

export { LineMaterial };
4 changes: 2 additions & 2 deletions examples/jsm/lines/LineSegments2.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ class LineSegments2 extends Mesh {

super( geometry, material );

this.isLineSegments2 = true;

this.type = 'LineSegments2';

}
Expand Down Expand Up @@ -350,6 +352,4 @@ class LineSegments2 extends Mesh {

}

LineSegments2.prototype.isLineSegments2 = true;

export { LineSegments2 };
4 changes: 2 additions & 2 deletions examples/jsm/lines/LineSegmentsGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class LineSegmentsGeometry extends InstancedBufferGeometry {

super();

this.isLineSegmentsGeometry = true;

this.type = 'LineSegmentsGeometry';

const positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];
Expand Down Expand Up @@ -245,6 +247,4 @@ class LineSegmentsGeometry extends InstancedBufferGeometry {

}

LineSegmentsGeometry.prototype.isLineSegmentsGeometry = true;

export { LineSegmentsGeometry };
4 changes: 2 additions & 2 deletions examples/jsm/lines/Wireframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Wireframe extends Mesh {

super( geometry, material );

this.isWireframe = true;

this.type = 'Wireframe';

}
Expand Down Expand Up @@ -51,6 +53,4 @@ class Wireframe extends Mesh {

}

Wireframe.prototype.isWireframe = true;

export { Wireframe };
4 changes: 2 additions & 2 deletions examples/jsm/lines/WireframeGeometry2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class WireframeGeometry2 extends LineSegmentsGeometry {

super();

this.isWireframeGeometry2 = true;

this.type = 'WireframeGeometry2';

this.fromWireframeGeometry( new WireframeGeometry( geometry ) );
Expand All @@ -19,6 +21,4 @@ class WireframeGeometry2 extends LineSegmentsGeometry {

}

WireframeGeometry2.prototype.isWireframeGeometry2 = true;

export { WireframeGeometry2 };
4 changes: 2 additions & 2 deletions examples/jsm/loaders/FontLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class Font {

constructor( data ) {

this.isFont = true;

this.type = 'Font';

this.data = data;
Expand Down Expand Up @@ -191,6 +193,4 @@ function createPath( char, scale, offsetX, offsetY, data ) {

}

Font.prototype.isFont = true;

export { FontLoader, Font };
4 changes: 2 additions & 2 deletions examples/jsm/loaders/MMDLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,8 @@ class MMDToonMaterial extends ShaderMaterial {

super();

this.isMMDToonMaterial = true;

this._matcapCombine = AddOperation;
this.emissiveIntensity = 1.0;
this.normalMapType = TangentSpaceNormalMap;
Expand Down Expand Up @@ -2237,6 +2239,4 @@ class MMDToonMaterial extends ShaderMaterial {

}

MMDToonMaterial.prototype.isMMDToonMaterial = true;

export { MMDLoader };
4 changes: 2 additions & 2 deletions examples/jsm/math/Lut.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Lut {

constructor( colormap, count = 32 ) {

this.isLut = true;

this.lut = [];
this.map = [];
this.n = 0;
Expand Down Expand Up @@ -189,8 +191,6 @@ class Lut {

}

Lut.prototype.isLut = true;

const ColorMapKeywords = {

'rainbow': [[ 0.0, 0x0000FF ], [ 0.2, 0x00FFFF ], [ 0.5, 0x00FF00 ], [ 0.8, 0xFFFF00 ], [ 1.0, 0xFF0000 ]],
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/node-editor/core/DataFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export class DataFile {

constructor( value ) {

this.isDataFile = true;

this.value = value;
this.url = null;

Expand Down Expand Up @@ -55,5 +57,3 @@ export class DataFile {
}

}

DataFile.prototype.isDataFile = true;
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/BufferNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class BufferNode extends UniformNode {

super( value, bufferType );

this.isBufferNode = true;

this.bufferType = bufferType;
this.bufferCount = bufferCount;

Expand All @@ -19,6 +21,4 @@ class BufferNode extends UniformNode {

}

BufferNode.prototype.isBufferNode = true;

export default BufferNode;
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/CubeTextureNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class CubeTextureNode extends TextureNode {

super( value, uvNode, levelNode );

this.isCubeTextureNode = true;

}

getInputType( /*builder*/ ) {
Expand Down Expand Up @@ -74,6 +76,4 @@ class CubeTextureNode extends TextureNode {

}

CubeTextureNode.prototype.isCubeTextureNode = true;

export default CubeTextureNode;
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/PointUVNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class PointUVNode extends Node {

super( 'vec2' );

this.isPointUVNode = true;

}

generate( /*builder*/ ) {
Expand All @@ -16,6 +18,4 @@ class PointUVNode extends Node {

}

PointUVNode.prototype.isPointUVNode = true;

export default PointUVNode;
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/StorageBufferNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class StorageBufferNode extends BufferNode {

super( value, bufferType, bufferCount );

this.isStorageBufferNode = true;

}

getInputType( /*builder*/ ) {
Expand All @@ -16,6 +18,4 @@ class StorageBufferNode extends BufferNode {

}

StorageBufferNode.prototype.isStorageBufferNode = true;

export default StorageBufferNode;
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/TextureNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class TextureNode extends UniformNode {

super( value, 'vec4' );

this.isTextureNode = true;

this.uvNode = uvNode;
this.levelNode = levelNode;

Expand Down Expand Up @@ -95,6 +97,4 @@ class TextureNode extends UniformNode {

}

TextureNode.prototype.isTextureNode = true;

export default TextureNode;
Loading

0 comments on commit 2a45c46

Please sign in to comment.