Skip to content

Commit fe84931

Browse files
committed
codestyle fixes
1 parent 0f7e38e commit fe84931

103 files changed

Lines changed: 1355 additions & 1355 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

editor/js/Sidebar.Material.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ Sidebar.Material = function ( editor ) {
463463

464464
var mapEnabled = materialMapEnabled.getValue() === true;
465465

466-
if ( objectHasUvs ) {
466+
if ( objectHasUvs ) {
467467

468468
material.map = mapEnabled ? materialMap.getValue() : null;
469469
material.needsUpdate = true;
@@ -480,7 +480,7 @@ Sidebar.Material = function ( editor ) {
480480

481481
var mapEnabled = materialAlphaMapEnabled.getValue() === true;
482482

483-
if ( objectHasUvs ) {
483+
if ( objectHasUvs ) {
484484

485485
material.alphaMap = mapEnabled ? materialAlphaMap.getValue() : null;
486486
material.needsUpdate = true;
@@ -516,7 +516,7 @@ Sidebar.Material = function ( editor ) {
516516

517517
var bumpMapEnabled = materialBumpMapEnabled.getValue() === true;
518518

519-
if ( objectHasUvs ) {
519+
if ( objectHasUvs ) {
520520

521521
material.bumpMap = bumpMapEnabled ? materialBumpMap.getValue() : null;
522522
material.bumpScale = materialBumpScale.getValue();
@@ -534,7 +534,7 @@ Sidebar.Material = function ( editor ) {
534534

535535
var normalMapEnabled = materialNormalMapEnabled.getValue() === true;
536536

537-
if ( objectHasUvs ) {
537+
if ( objectHasUvs ) {
538538

539539
material.normalMap = normalMapEnabled ? materialNormalMap.getValue() : null;
540540
material.needsUpdate = true;
@@ -551,7 +551,7 @@ Sidebar.Material = function ( editor ) {
551551

552552
var specularMapEnabled = materialSpecularMapEnabled.getValue() === true;
553553

554-
if ( objectHasUvs ) {
554+
if ( objectHasUvs ) {
555555

556556
material.specularMap = specularMapEnabled ? materialSpecularMap.getValue() : null;
557557
material.needsUpdate = true;

editor/js/Storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var Storage = function () {
88

99
if ( indexedDB === undefined ) {
1010
console.warn( 'Storage: IndexedDB not available.' );
11-
return { init: function (){}, get: function (){}, set: function (){}, clear: function (){} };
11+
return { init: function () {}, get: function () {}, set: function () {}, clear: function () {} };
1212
}
1313

1414
var name = 'threejs-editor';

examples/js/AudioObject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ THREE.AudioObject = function ( url, volume, playbackRate, loop ) {
4040

4141
THREE.AudioObject.prototype.context = new webkitAudioContext();
4242

43-
} catch( error ) {
43+
} catch ( error ) {
4444

4545
console.warn( "THREE.AudioObject: webkitAudioContext not found" );
4646
return this;

examples/js/BlendCharacter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ THREE.BlendCharacter = function () {
2222

2323
// Create the animations
2424

25-
for ( var i = 0; i < geometry.animations.length; ++i ) {
25+
for ( var i = 0; i < geometry.animations.length; ++ i ) {
2626

2727
var animName = geometry.animations[ i ].name;
2828
scope.animations[ animName ] = new THREE.Animation( scope, geometry.animations[ i ] );
@@ -46,7 +46,7 @@ THREE.BlendCharacter = function () {
4646

4747
this.update = function( dt ) {
4848

49-
for ( var i = this.weightSchedule.length - 1; i >= 0; --i ) {
49+
for ( var i = this.weightSchedule.length - 1; i >= 0; -- i ) {
5050

5151
var data = this.weightSchedule[ i ];
5252
data.timeElapsed += dt;
@@ -87,7 +87,7 @@ THREE.BlendCharacter = function () {
8787
// lengths match. This is useful for smoothing out transitions that get out of
8888
// phase such as between a walk and run cycle
8989

90-
for ( var i = this.warpSchedule.length - 1; i >= 0; --i ) {
90+
for ( var i = this.warpSchedule.length - 1; i >= 0; -- i ) {
9191

9292
var data = this.warpSchedule[ i ];
9393
data.timeElapsed += dt;

examples/js/Car.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ THREE.Car = function () {
195195

196196
var forwardDelta = this.speed * delta;
197197

198-
this.carOrientation += ( forwardDelta * this.STEERING_RADIUS_RATIO )* this.wheelOrientation;
198+
this.carOrientation += ( forwardDelta * this.STEERING_RADIUS_RATIO ) * this.wheelOrientation;
199199

200200
// displacement
201201

@@ -363,8 +363,8 @@ THREE.Car = function () {
363363
};
364364

365365
function quadraticEaseOut( k ) { return - k * ( k - 2 ); }
366-
function cubicEaseOut( k ) { return --k * k * k + 1; }
367-
function circularEaseOut( k ) { return Math.sqrt( 1 - --k * k ); }
366+
function cubicEaseOut( k ) { return -- k * k * k + 1; }
367+
function circularEaseOut( k ) { return Math.sqrt( 1 - -- k * k ); }
368368
function sinusoidalEaseOut( k ) { return Math.sin( k * Math.PI / 2 ); }
369369
function exponentialEaseOut( k ) { return k === 1 ? 1 : - Math.pow( 2, - 10 * k ) + 1; }
370370

examples/js/Cloth.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ var lastTime;
4848
function plane(width, height) {
4949

5050
return function(u, v) {
51-
var x = (u-0.5) * width;
52-
var y = (v+0.5) * height;
51+
var x = (u - 0.5) * width;
52+
var y = (v + 0.5) * height;
5353
var z = 0;
5454

5555
return new THREE.Vector3(x, y, z);
@@ -94,8 +94,8 @@ var diff = new THREE.Vector3();
9494
function satisifyConstrains(p1, p2, distance) {
9595
diff.subVectors(p2.position, p1.position);
9696
var currentDist = diff.length();
97-
if (currentDist==0) return; // prevents division by 0
98-
var correction = diff.multiplyScalar(1 - distance/currentDist);
97+
if (currentDist == 0) return; // prevents division by 0
98+
var correction = diff.multiplyScalar(1 - distance / currentDist);
9999
var correctionHalf = correction.multiplyScalar(0.5);
100100
p1.position.add(correctionHalf);
101101
p2.position.sub(correctionHalf);
@@ -114,47 +114,47 @@ function Cloth(w, h) {
114114
var u, v;
115115

116116
// Create particles
117-
for (v=0;v<=h;v++) {
118-
for (u=0;u<=w;u++) {
117+
for (v = 0; v <= h; v ++) {
118+
for (u = 0; u <= w; u ++) {
119119
particles.push(
120-
new Particle(u/w, v/h, 0, MASS)
120+
new Particle(u / w, v / h, 0, MASS)
121121
);
122122
}
123123
}
124124

125125
// Structural
126126

127-
for (v=0;v<h;v++) {
128-
for (u=0;u<w;u++) {
127+
for (v = 0; v < h; v ++) {
128+
for (u = 0; u < w; u ++) {
129129

130130
constrains.push([
131131
particles[index(u, v)],
132-
particles[index(u, v+1)],
132+
particles[index(u, v + 1)],
133133
restDistance
134134
]);
135135

136136
constrains.push([
137137
particles[index(u, v)],
138-
particles[index(u+1, v)],
138+
particles[index(u + 1, v)],
139139
restDistance
140140
]);
141141

142142
}
143143
}
144144

145-
for (u=w, v=0;v<h;v++) {
145+
for (u = w, v = 0; v < h; v ++) {
146146
constrains.push([
147147
particles[index(u, v)],
148-
particles[index(u, v+1)],
148+
particles[index(u, v + 1)],
149149
restDistance
150150

151151
]);
152152
}
153153

154-
for (v=h, u=0;u<w;u++) {
154+
for (v = h, u = 0; u < w; u ++) {
155155
constrains.push([
156156
particles[index(u, v)],
157-
particles[index(u+1, v)],
157+
particles[index(u + 1, v)],
158158
restDistance
159159
]);
160160
}
@@ -211,7 +211,7 @@ function simulate(time) {
211211

212212
particles = cloth.particles;
213213

214-
for (i=0,il=faces.length;i<il;i++) {
214+
for (i = 0,il = faces.length; i < il; i ++) {
215215
face = faces[i];
216216
normal = face.normal;
217217

@@ -222,8 +222,8 @@ function simulate(time) {
222222
}
223223
}
224224

225-
for (particles = cloth.particles, i=0, il = particles.length
226-
;i<il;i++) {
225+
for (particles = cloth.particles, i = 0, il = particles.length
226+
; i < il; i ++) {
227227
particle = particles[i];
228228
particle.addForce(gravity);
229229

@@ -234,20 +234,20 @@ function simulate(time) {
234234

235235
constrains = cloth.constrains,
236236
il = constrains.length;
237-
for (i=0;i<il;i++) {
237+
for (i = 0; i < il; i ++) {
238238
constrain = constrains[i];
239239
satisifyConstrains(constrain[0], constrain[1], constrain[2]);
240240
}
241241

242242
// Ball Constrains
243243

244244

245-
ballPosition.z = -Math.sin(Date.now()/600) * 90 ; //+ 40;
246-
ballPosition.x = Math.cos(Date.now()/400) * 70
245+
ballPosition.z = -Math.sin(Date.now() / 600) * 90 ; //+ 40;
246+
ballPosition.x = Math.cos(Date.now() / 400) * 70
247247

248248
if (sphere.visible)
249-
for (particles = cloth.particles, i=0, il = particles.length
250-
;i<il;i++) {
249+
for (particles = cloth.particles, i = 0, il = particles.length
250+
; i < il; i ++) {
251251
particle = particles[i];
252252
pos = particle.position;
253253
diff.subVectors(pos, ballPosition);
@@ -259,8 +259,8 @@ function simulate(time) {
259259
}
260260

261261
// Floor Constains
262-
for (particles = cloth.particles, i=0, il = particles.length
263-
;i<il;i++) {
262+
for (particles = cloth.particles, i = 0, il = particles.length
263+
; i < il; i ++) {
264264
particle = particles[i];
265265
pos = particle.position;
266266
if (pos.y < -250) {
@@ -269,7 +269,7 @@ function simulate(time) {
269269
}
270270

271271
// Pin Constrains
272-
for (i=0, il=pins.length;i<il;i++) {
272+
for (i = 0, il = pins.length; i < il; i ++) {
273273
var xy = pins[i];
274274
var p = particles[xy];
275275
p.position.copy(p.original);

examples/js/CurveExtras.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
THREE.Curves = {};
1616

1717

18-
THREE.Curves.GrannyKnot = THREE.Curve.create( function(){},
18+
THREE.Curves.GrannyKnot = THREE.Curve.create( function() {},
1919

2020
function(t) {
2121
t = 2 * Math.PI * t;

examples/js/Detector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
var Detector = {
77

88
canvas: !! window.CanvasRenderingContext2D,
9-
webgl: ( function () { try { var canvas = document.createElement( 'canvas' ); return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) ); } catch( e ) { return false; } } )(),
9+
webgl: ( function () { try { var canvas = document.createElement( 'canvas' ); return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) ); } catch ( e ) { return false; } } )(),
1010
workers: !! window.Worker,
1111
fileapi: window.File && window.FileReader && window.FileList && window.Blob,
1212

examples/js/ImprovedNoise.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var ImprovedNoise = function () {
44

5-
var p = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,
5+
var p = [ 151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,
66
23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,
77
174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,
88
133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,
@@ -11,11 +11,11 @@ var ImprovedNoise = function () {
1111
248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,
1212
178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,
1313
14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,
14-
93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];
14+
93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180 ];
1515

16-
for (var i=0; i < 256 ; i++) {
16+
for (var i = 0; i < 256 ; i ++) {
1717

18-
p[256+i] = p[i];
18+
p[256 + i] = p[i];
1919

2020
}
2121

@@ -51,20 +51,20 @@ var ImprovedNoise = function () {
5151
y -= floorY;
5252
z -= floorZ;
5353

54-
var xMinus1 = x -1, yMinus1 = y - 1, zMinus1 = z - 1;
54+
var xMinus1 = x - 1, yMinus1 = y - 1, zMinus1 = z - 1;
5555

5656
var u = fade(x), v = fade(y), w = fade(z);
5757

58-
var A = p[X]+Y, AA = p[A]+Z, AB = p[A+1]+Z, B = p[X+1]+Y, BA = p[B]+Z, BB = p[B+1]+Z;
58+
var A = p[X] + Y, AA = p[A] + Z, AB = p[A + 1] + Z, B = p[X + 1] + Y, BA = p[B] + Z, BB = p[B + 1] + Z;
5959

6060
return lerp(w, lerp(v, lerp(u, grad(p[AA], x, y, z),
6161
grad(p[BA], xMinus1, y, z)),
6262
lerp(u, grad(p[AB], x, yMinus1, z),
6363
grad(p[BB], xMinus1, yMinus1, z))),
64-
lerp(v, lerp(u, grad(p[AA+1], x, y, zMinus1),
65-
grad(p[BA+1], xMinus1, y, z-1)),
66-
lerp(u, grad(p[AB+1], x, yMinus1, zMinus1),
67-
grad(p[BB+1], xMinus1, yMinus1, zMinus1))));
64+
lerp(v, lerp(u, grad(p[AA + 1], x, y, zMinus1),
65+
grad(p[BA + 1], xMinus1, y, z - 1)),
66+
lerp(u, grad(p[AB + 1], x, yMinus1, zMinus1),
67+
grad(p[BB + 1], xMinus1, yMinus1, zMinus1))));
6868

6969
}
7070
}

examples/js/MD2Character.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ THREE.MD2Character = function () {
210210
//
211211

212212
var mesh = new THREE.MorphAnimMesh( geometry, materialTexture );
213-
mesh.rotation.y = -Math.PI/2;
213+
mesh.rotation.y = -Math.PI / 2;
214214

215215
mesh.castShadow = true;
216216
mesh.receiveShadow = true;

0 commit comments

Comments
 (0)