未验证 提交 ca023aa9 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #13794 from Mugen87/dev4

Examples: Clean up
......@@ -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 );
......
......@@ -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 );
......
......@@ -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,7 +139,7 @@ THREE.FlyControls = function ( object, domElement ) {
};
this.mousemove = function( event ) {
this.mousemove = function ( event ) {
if ( ! this.dragToLook || this.mouseStatus > 0 ) {
......@@ -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,7 +202,7 @@ THREE.FlyControls = function ( object, domElement ) {
};
this.updateMovementVector = function() {
this.updateMovementVector = function () {
var forward = ( this.moveState.forward || ( this.autoForward && ! this.moveState.back ) ) ? 1 : 0;
......@@ -214,7 +214,7 @@ THREE.FlyControls = function ( object, domElement ) {
};
this.updateRotationVector = function() {
this.updateRotationVector = function () {
this.rotationVector.x = ( - this.moveState.pitchDown + this.moveState.pitchUp );
this.rotationVector.y = ( - this.moveState.yawRight + this.moveState.yawLeft );
......@@ -224,20 +224,20 @@ THREE.FlyControls = function ( object, domElement ) {
};
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 );
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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(),
......@@ -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 );
......
......@@ -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 ) {
......@@ -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 ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册