diff --git a/examples/js/controls/EditorControls.js b/examples/js/controls/EditorControls.js index 89fce26afbe83c74613e846e85a340a3af69db5e..64b99496ef9d78011463f7c304e45233e0233a7a 100644 --- a/examples/js/controls/EditorControls.js +++ b/examples/js/controls/EditorControls.js @@ -199,7 +199,7 @@ THREE.EditorControls = function ( object, domElement ) { } - this.dispose = function() { + this.dispose = function () { domElement.removeEventListener( 'contextmenu', contextmenu, false ); domElement.removeEventListener( 'mousedown', onMouseDown, false ); diff --git a/examples/js/controls/FirstPersonControls.js b/examples/js/controls/FirstPersonControls.js index 51e0c3907e3ec0bb5942333807a91bc48a266f70..4994e003073250ce1eb9c658f181671545dcaad3 100644 --- a/examples/js/controls/FirstPersonControls.js +++ b/examples/js/controls/FirstPersonControls.js @@ -184,7 +184,7 @@ THREE.FirstPersonControls = function ( object, domElement ) { }; - this.update = function( delta ) { + this.update = function ( delta ) { if ( this.enabled === false ) return; @@ -259,7 +259,7 @@ THREE.FirstPersonControls = function ( object, domElement ) { } - this.dispose = function() { + this.dispose = function () { this.domElement.removeEventListener( 'contextmenu', contextmenu, false ); this.domElement.removeEventListener( 'mousedown', _onMouseDown, false ); diff --git a/examples/js/controls/FlyControls.js b/examples/js/controls/FlyControls.js index e55ff699ec4284f806221da8ee55fdc38ab97632..41ae68899f7a8ea28f05756ee1f683d94e87307b 100644 --- a/examples/js/controls/FlyControls.js +++ b/examples/js/controls/FlyControls.js @@ -39,7 +39,7 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.keydown = function( event ) { + this.keydown = function ( event ) { if ( event.altKey ) { @@ -78,7 +78,7 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.keyup = function( event ) { + this.keyup = function ( event ) { switch ( event.keyCode ) { @@ -109,7 +109,7 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.mousedown = function( event ) { + this.mousedown = function ( event ) { if ( this.domElement !== document ) { @@ -139,16 +139,16 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.mousemove = function( event ) { + this.mousemove = function ( event ) { if ( ! this.dragToLook || this.mouseStatus > 0 ) { var container = this.getContainerDimensions(); - var halfWidth = container.size[ 0 ] / 2; + var halfWidth = container.size[ 0 ] / 2; var halfHeight = container.size[ 1 ] / 2; - this.moveState.yawLeft = - ( ( event.pageX - container.offset[ 0 ] ) - halfWidth ) / halfWidth; - this.moveState.pitchDown = ( ( event.pageY - container.offset[ 1 ] ) - halfHeight ) / halfHeight; + this.moveState.yawLeft = - ( ( event.pageX - container.offset[ 0 ] ) - halfWidth ) / halfWidth; + this.moveState.pitchDown = ( ( event.pageY - container.offset[ 1 ] ) - halfHeight ) / halfHeight; this.updateRotationVector(); @@ -156,7 +156,7 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.mouseup = function( event ) { + this.mouseup = function ( event ) { event.preventDefault(); event.stopPropagation(); @@ -184,7 +184,7 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.update = function( delta ) { + this.update = function ( delta ) { var moveMult = delta * this.movementSpeed; var rotMult = delta * this.rollSpeed; @@ -202,42 +202,42 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.updateMovementVector = function() { + this.updateMovementVector = function () { var forward = ( this.moveState.forward || ( this.autoForward && ! this.moveState.back ) ) ? 1 : 0; - this.moveVector.x = ( - this.moveState.left + this.moveState.right ); - this.moveVector.y = ( - this.moveState.down + this.moveState.up ); + this.moveVector.x = ( - this.moveState.left + this.moveState.right ); + this.moveVector.y = ( - this.moveState.down + this.moveState.up ); this.moveVector.z = ( - forward + this.moveState.back ); //console.log( 'move:', [ this.moveVector.x, this.moveVector.y, this.moveVector.z ] ); }; - this.updateRotationVector = function() { + this.updateRotationVector = function () { this.rotationVector.x = ( - this.moveState.pitchDown + this.moveState.pitchUp ); - this.rotationVector.y = ( - this.moveState.yawRight + this.moveState.yawLeft ); + this.rotationVector.y = ( - this.moveState.yawRight + this.moveState.yawLeft ); this.rotationVector.z = ( - this.moveState.rollRight + this.moveState.rollLeft ); //console.log( 'rotate:', [ this.rotationVector.x, this.rotationVector.y, this.rotationVector.z ] ); }; - this.getContainerDimensions = function() { + this.getContainerDimensions = function () { if ( this.domElement != document ) { return { - size : [ this.domElement.offsetWidth, this.domElement.offsetHeight ], - offset : [ this.domElement.offsetLeft, this.domElement.offsetTop ] + size: [ this.domElement.offsetWidth, this.domElement.offsetHeight ], + offset: [ this.domElement.offsetLeft, this.domElement.offsetTop ] }; } else { return { - size : [ window.innerWidth, window.innerHeight ], - offset : [ 0, 0 ] + size: [ window.innerWidth, window.innerHeight ], + offset: [ 0, 0 ] }; } @@ -260,7 +260,7 @@ THREE.FlyControls = function ( object, domElement ) { } - this.dispose = function() { + this.dispose = function () { this.domElement.removeEventListener( 'contextmenu', contextmenu, false ); this.domElement.removeEventListener( 'mousedown', _mousedown, false ); @@ -282,10 +282,10 @@ THREE.FlyControls = function ( object, domElement ) { this.domElement.addEventListener( 'mousemove', _mousemove, false ); this.domElement.addEventListener( 'mousedown', _mousedown, false ); - this.domElement.addEventListener( 'mouseup', _mouseup, false ); + this.domElement.addEventListener( 'mouseup', _mouseup, false ); window.addEventListener( 'keydown', _keydown, false ); - window.addEventListener( 'keyup', _keyup, false ); + window.addEventListener( 'keyup', _keyup, false ); this.updateMovementVector(); this.updateRotationVector(); diff --git a/examples/js/controls/OrbitControls.js b/examples/js/controls/OrbitControls.js index 5988679055f419cfa484141e9e6b4cbd532681a5..2d55022bc7316f238d08dd2c5473c0a558194dd0 100644 --- a/examples/js/controls/OrbitControls.js +++ b/examples/js/controls/OrbitControls.js @@ -457,7 +457,7 @@ THREE.OrbitControls = function ( object, domElement ) { rotateEnd.set( event.clientX, event.clientY ); - rotateDelta.subVectors( rotateEnd, rotateStart ).multiplyScalar( scope.rotateSpeed );; + rotateDelta.subVectors( rotateEnd, rotateStart ).multiplyScalar( scope.rotateSpeed ); var element = scope.domElement === document ? scope.domElement.body : scope.domElement; diff --git a/examples/js/controls/PointerLockControls.js b/examples/js/controls/PointerLockControls.js index b0d7dc86c7daf0aad27744efbc5b9aa1ca4e3828..58e274db10fc0957103b7d34d634bafe7bb4aed4 100644 --- a/examples/js/controls/PointerLockControls.js +++ b/examples/js/controls/PointerLockControls.js @@ -31,7 +31,7 @@ THREE.PointerLockControls = function ( camera ) { }; - this.dispose = function() { + this.dispose = function () { document.removeEventListener( 'mousemove', onMouseMove, false ); @@ -47,14 +47,14 @@ THREE.PointerLockControls = function ( camera ) { }; - this.getDirection = function() { + this.getDirection = function () { // assumes the camera itself is not rotated var direction = new THREE.Vector3( 0, 0, - 1 ); - var rotation = new THREE.Euler( 0, 0, 0, "YXZ" ); + var rotation = new THREE.Euler( 0, 0, 0, 'YXZ' ); - return function( v ) { + return function ( v ) { rotation.set( pitchObject.rotation.x, yawObject.rotation.y, 0 ); diff --git a/examples/js/controls/TrackballControls.js b/examples/js/controls/TrackballControls.js index 79168f89da6ce1b4db2d174c9c3206a84a3b799f..a073146f1ca25b7a4aae968ccd9e0529040f9dd8 100644 --- a/examples/js/controls/TrackballControls.js +++ b/examples/js/controls/TrackballControls.js @@ -44,24 +44,24 @@ THREE.TrackballControls = function ( object, domElement ) { var lastPosition = new THREE.Vector3(); var _state = STATE.NONE, - _prevState = STATE.NONE, + _prevState = STATE.NONE, - _eye = new THREE.Vector3(), + _eye = new THREE.Vector3(), - _movePrev = new THREE.Vector2(), - _moveCurr = new THREE.Vector2(), + _movePrev = new THREE.Vector2(), + _moveCurr = new THREE.Vector2(), - _lastAxis = new THREE.Vector3(), - _lastAngle = 0, + _lastAxis = new THREE.Vector3(), + _lastAngle = 0, - _zoomStart = new THREE.Vector2(), - _zoomEnd = new THREE.Vector2(), + _zoomStart = new THREE.Vector2(), + _zoomEnd = new THREE.Vector2(), - _touchZoomDistanceStart = 0, - _touchZoomDistanceEnd = 0, + _touchZoomDistanceStart = 0, + _touchZoomDistanceEnd = 0, - _panStart = new THREE.Vector2(), - _panEnd = new THREE.Vector2(); + _panStart = new THREE.Vector2(), + _panEnd = new THREE.Vector2(); // for reset @@ -145,7 +145,7 @@ THREE.TrackballControls = function ( object, domElement ) { }() ); - this.rotateCamera = ( function() { + this.rotateCamera = ( function () { var axis = new THREE.Vector3(), quaternion = new THREE.Quaternion(), @@ -235,7 +235,7 @@ THREE.TrackballControls = function ( object, domElement ) { }; - this.panCamera = ( function() { + this.panCamera = ( function () { var mouseChange = new THREE.Vector2(), objectUp = new THREE.Vector3(), @@ -469,7 +469,7 @@ THREE.TrackballControls = function ( object, domElement ) { function mousewheel( event ) { if ( _this.enabled === false ) return; - + if ( _this.noZoom === true ) return; event.preventDefault(); @@ -587,7 +587,7 @@ THREE.TrackballControls = function ( object, domElement ) { } - this.dispose = function() { + this.dispose = function () { this.domElement.removeEventListener( 'contextmenu', contextmenu, false ); this.domElement.removeEventListener( 'mousedown', mousedown, false ); diff --git a/examples/js/controls/TransformControls.js b/examples/js/controls/TransformControls.js index 29ae203793cf6cee8159691aac44faa0322d6f58..cd47c22d917db21e2b2b5115f10b644b67a85bbf 100644 --- a/examples/js/controls/TransformControls.js +++ b/examples/js/controls/TransformControls.js @@ -21,7 +21,7 @@ this.oldColor = this.color.clone(); this.oldOpacity = this.opacity; - this.highlight = function( highlighted ) { + this.highlight = function ( highlighted ) { if ( highlighted ) { @@ -58,7 +58,7 @@ this.oldColor = this.color.clone(); this.oldOpacity = this.opacity; - this.highlight = function( highlighted ) { + this.highlight = function ( highlighted ) { if ( highlighted ) { @@ -103,9 +103,9 @@ var planeMaterial = new THREE.MeshBasicMaterial( { visible: false, side: THREE.DoubleSide } ); var planes = { - "XY": new THREE.Mesh( planeGeometry, planeMaterial ), - "YZ": new THREE.Mesh( planeGeometry, planeMaterial ), - "XZ": new THREE.Mesh( planeGeometry, planeMaterial ), + "XY": new THREE.Mesh( planeGeometry, planeMaterial ), + "YZ": new THREE.Mesh( planeGeometry, planeMaterial ), + "XZ": new THREE.Mesh( planeGeometry, planeMaterial ), "XYZE": new THREE.Mesh( planeGeometry, planeMaterial ) }; @@ -124,7 +124,7 @@ //// HANDLES AND PICKERS - var setupGizmos = function( gizmoMap, parent ) { + var setupGizmos = function ( gizmoMap, parent ) { for ( var name in gizmoMap ) { @@ -176,7 +176,7 @@ this.highlight = function ( axis ) { - this.traverse( function( child ) { + this.traverse( function ( child ) { if ( child.material && child.material.highlight ) { @@ -207,7 +207,7 @@ var vec2 = new THREE.Vector3( 0, 1, 0 ); var lookAtMatrix = new THREE.Matrix4(); - this.traverse( function( child ) { + this.traverse( function ( child ) { if ( child.name.search( "E" ) !== - 1 ) { @@ -235,13 +235,13 @@ arrowGeometry.merge( mesh.geometry, mesh.matrix ); var lineXGeometry = new THREE.BufferGeometry(); - lineXGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 1, 0, 0 ], 3 ) ); + lineXGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 1, 0, 0 ], 3 ) ); var lineYGeometry = new THREE.BufferGeometry(); - lineYGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); + lineYGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); var lineZGeometry = new THREE.BufferGeometry(); - lineZGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); + lineZGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); this.handleGizmos = { @@ -671,12 +671,12 @@ var oldScale = new THREE.Vector3(); var oldRotationMatrix = new THREE.Matrix4(); - var parentRotationMatrix = new THREE.Matrix4(); + var parentRotationMatrix = new THREE.Matrix4(); var parentScale = new THREE.Vector3(); var worldPosition = new THREE.Vector3(); var worldRotation = new THREE.Euler(); - var worldRotationMatrix = new THREE.Matrix4(); + var worldRotationMatrix = new THREE.Matrix4(); var camPosition = new THREE.Vector3(); var camRotation = new THREE.Euler();