Skip to content

Commit f2086ff

Browse files
committed
Examples: Fixed eslint warnings.
1 parent 8e605ab commit f2086ff

File tree

6 files changed

+110
-110
lines changed

6 files changed

+110
-110
lines changed

examples/js/controls/DragControls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
105105

106106
_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( object.matrixWorld ) );
107107

108-
if ( _hovered !== object && _hovered !== null) {
108+
if ( _hovered !== object && _hovered !== null ) {
109109

110110
scope.dispatchEvent( { type: 'hoveroff', object: _hovered } );
111111

112112
_domElement.style.cursor = 'auto';
113113
_hovered = null;
114114

115115
}
116-
116+
117117
if ( _hovered !== object ) {
118118

119119
scope.dispatchEvent( { type: 'hoveron', object: object } );

examples/jsm/controls/DragControls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ var DragControls = function ( _objects, _camera, _domElement ) {
114114

115115
_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( object.matrixWorld ) );
116116

117-
if ( _hovered !== object && _hovered !== null) {
117+
if ( _hovered !== object && _hovered !== null ) {
118118

119119
scope.dispatchEvent( { type: 'hoveroff', object: _hovered } );
120120

121121
_domElement.style.cursor = 'auto';
122122
_hovered = null;
123123

124124
}
125-
125+
126126
if ( _hovered !== object ) {
127127

128128
scope.dispatchEvent( { type: 'hoveron', object: object } );

examples/jsm/shaders/SSRShader.js

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
import {
2-
Matrix4,
3-
Vector2
4-
} from "../../../build/three.module.js";
2+
Matrix4,
3+
Vector2
4+
} from '../../../build/three.module.js';
55
/**
66
* References:
77
* https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
88
*/
99

1010
var SSRShader = {
1111

12-
defines: {
13-
MAX_STEP: 0,
14-
PERSPECTIVE_CAMERA: true,
15-
DISTANCE_ATTENUATION: true,
16-
FRESNEL: true,
17-
INFINITE_THICK: false,
18-
SELECTIVE: false,
19-
},
12+
defines: {
13+
MAX_STEP: 0,
14+
PERSPECTIVE_CAMERA: true,
15+
DISTANCE_ATTENUATION: true,
16+
FRESNEL: true,
17+
INFINITE_THICK: false,
18+
SELECTIVE: false,
19+
},
20+
21+
uniforms: {
22+
23+
'tDiffuse': { value: null },
24+
'tNormal': { value: null },
25+
'tMetalness': { value: null },
26+
'tDepth': { value: null },
27+
'cameraNear': { value: null },
28+
'cameraFar': { value: null },
29+
'resolution': { value: new Vector2() },
30+
'cameraProjectionMatrix': { value: new Matrix4() },
31+
'cameraInverseProjectionMatrix': { value: new Matrix4() },
32+
'opacity': { value: .5 },
33+
'maxDistance': { value: 180 },
34+
'cameraRange': { value: 0 },
35+
'surfDist': { value: .007 },
36+
'thickTolerance': { value: .03 },
37+
38+
},
39+
40+
vertexShader: /* glsl */`
2041
21-
uniforms: {
22-
23-
"tDiffuse": { value: null },
24-
"tNormal": { value: null },
25-
"tMetalness": { value: null },
26-
"tDepth": { value: null },
27-
"cameraNear": { value: null },
28-
"cameraFar": { value: null },
29-
"resolution": { value: new Vector2() },
30-
"cameraProjectionMatrix": { value: new Matrix4() },
31-
"cameraInverseProjectionMatrix": { value: new Matrix4() },
32-
"opacity": { value: .5 },
33-
"maxDistance": { value: 180 },
34-
"cameraRange": { value: 0 },
35-
"surfDist": { value: .007 },
36-
"thickTolerance": { value: .03 },
37-
38-
},
39-
40-
vertexShader: /* glsl */`
41-
42-
varying vec2 vUv;
42+
varying vec2 vUv;
4343
44-
void main() {
44+
void main() {
4545
4646
vUv = uv;
4747
4848
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4949
50-
}
50+
}
5151
52-
`,
52+
`,
5353

54-
fragmentShader: /* glsl */`
54+
fragmentShader: /* glsl */`
5555
// precision highp float;
5656
precision highp sampler2D;
5757
varying vec2 vUv;
@@ -221,41 +221,41 @@ var SSRShader = {
221221

222222
var SSRDepthShader = {
223223

224-
defines: {
225-
"PERSPECTIVE_CAMERA": 1
226-
},
224+
defines: {
225+
'PERSPECTIVE_CAMERA': 1
226+
},
227227

228-
uniforms: {
228+
uniforms: {
229229

230-
"tDepth": { value: null },
231-
"cameraNear": { value: null },
232-
"cameraFar": { value: null },
230+
'tDepth': { value: null },
231+
'cameraNear': { value: null },
232+
'cameraFar': { value: null },
233233

234-
},
234+
},
235235

236-
vertexShader: /* glsl */`
236+
vertexShader: /* glsl */`
237237
238-
varying vec2 vUv;
238+
varying vec2 vUv;
239239
240-
void main() {
240+
void main() {
241241
242-
vUv = uv;
243-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
242+
vUv = uv;
243+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
244244
245-
}
245+
}
246246
247-
`,
247+
`,
248248

249-
fragmentShader: /* glsl */`
249+
fragmentShader: /* glsl */`
250250
251-
uniform sampler2D tDepth;
251+
uniform sampler2D tDepth;
252252
253-
uniform float cameraNear;
254-
uniform float cameraFar;
253+
uniform float cameraNear;
254+
uniform float cameraFar;
255255
256-
varying vec2 vUv;
256+
varying vec2 vUv;
257257
258-
#include <packing>
258+
#include <packing>
259259
260260
float getLinearDepth( const in vec2 uv ) {
261261
@@ -273,51 +273,51 @@ var SSRDepthShader = {
273273
274274
}
275275
276-
void main() {
276+
void main() {
277277
278-
float depth = getLinearDepth( vUv );
278+
float depth = getLinearDepth( vUv );
279279
float d = 1.0 - depth;
280280
// d=(d-.999)*1000.;
281-
gl_FragColor = vec4( vec3( d ), 1.0 );
281+
gl_FragColor = vec4( vec3( d ), 1.0 );
282282
283-
}
283+
}
284284
285-
`
285+
`
286286

287287
};
288288

289289
var SSRBlurShader = {
290290

291-
uniforms: {
291+
uniforms: {
292292

293-
"tDiffuse": { value: null },
294-
"resolution": { value: new Vector2() },
295-
"opacity": { value: .5 },
293+
'tDiffuse': { value: null },
294+
'resolution': { value: new Vector2() },
295+
'opacity': { value: .5 },
296296

297-
},
297+
},
298298

299-
vertexShader: /* glsl */`
299+
vertexShader: /* glsl */`
300300
301-
varying vec2 vUv;
301+
varying vec2 vUv;
302302
303-
void main() {
303+
void main() {
304304
305-
vUv = uv;
306-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
305+
vUv = uv;
306+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
307307
308-
}
308+
}
309309
310-
`,
310+
`,
311311

312-
fragmentShader: /* glsl */`
312+
fragmentShader: /* glsl */`
313313
314-
uniform sampler2D tDiffuse;
315-
uniform vec2 resolution;
316-
varying vec2 vUv;
317-
void main() {
314+
uniform sampler2D tDiffuse;
315+
uniform vec2 resolution;
316+
varying vec2 vUv;
317+
void main() {
318318
//reverse engineering from PhotoShop blur filter, then change coefficient
319319
320-
vec2 texelSize = ( 1.0 / resolution );
320+
vec2 texelSize = ( 1.0 / resolution );
321321
322322
vec4 c=texture2D(tDiffuse,vUv);
323323

examples/jsm/shaders/SSRrShader.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
Matrix4,
33
Vector2
4-
} from "../../../build/three.module.js";
4+
} from '../../../build/three.module.js';
55

66
var SSRrShader = {
77

@@ -15,21 +15,21 @@ var SSRrShader = {
1515

1616
uniforms: {
1717

18-
"tDiffuse": { value: null },
19-
"tSpecular": { value: null },
20-
"tNormalSelects": { value: null },
21-
"tRefractive": { value: null },
22-
"tDepth": { value: null },
23-
"tDepthSelects": { value: null },
24-
"cameraNear": { value: null },
25-
"cameraFar": { value: null },
26-
"resolution": { value: new Vector2() },
27-
"cameraProjectionMatrix": { value: new Matrix4() },
28-
"cameraInverseProjectionMatrix": { value: new Matrix4() },
29-
"ior": { value: 1.03 },
30-
"cameraRange": { value: 0 },
31-
"maxDistance": { value: 180 },
32-
"surfDist": { value: .007 },
18+
'tDiffuse': { value: null },
19+
'tSpecular': { value: null },
20+
'tNormalSelects': { value: null },
21+
'tRefractive': { value: null },
22+
'tDepth': { value: null },
23+
'tDepthSelects': { value: null },
24+
'cameraNear': { value: null },
25+
'cameraFar': { value: null },
26+
'resolution': { value: new Vector2() },
27+
'cameraProjectionMatrix': { value: new Matrix4() },
28+
'cameraInverseProjectionMatrix': { value: new Matrix4() },
29+
'ior': { value: 1.03 },
30+
'cameraRange': { value: 0 },
31+
'maxDistance': { value: 180 },
32+
'surfDist': { value: .007 },
3333

3434
},
3535

@@ -240,14 +240,14 @@ var SSRrShader = {
240240
var SSRrDepthShader = {
241241

242242
defines: {
243-
"PERSPECTIVE_CAMERA": 1
243+
'PERSPECTIVE_CAMERA': 1
244244
},
245245

246246
uniforms: {
247247

248-
"tDepth": { value: null },
249-
"cameraNear": { value: null },
250-
"cameraFar": { value: null },
248+
'tDepth': { value: null },
249+
'cameraNear': { value: null },
250+
'cameraFar': { value: null },
251251

252252
},
253253

examples/jsm/webxr/XREstimatedLight.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
Group,
44
LightProbe,
55
WebGLCubeRenderTarget
6-
} from "../../../build/three.module.js";
6+
} from '../../../build/three.module.js';
77

88
class SessionLightProbe {
99

@@ -43,11 +43,11 @@ class SessionLightProbe {
4343

4444
this.xrWebGLBinding = new XRWebGLBinding( session, gl );
4545

46-
this.lightProbe.addEventListener('reflectionchange', () => {
46+
this.lightProbe.addEventListener( 'reflectionchange', () => {
4747

4848
this.updateReflection();
4949

50-
});
50+
} );
5151

5252
}
5353

examples/jsm/webxr/XRHandOculusMeshModel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ class XRHandOculusMeshModel {
9292

9393
const bone = object.getObjectByName( boneName.replace( /%/g, handedness === 'right' ? 'r' : 'l' ) );
9494

95-
if ( bone !== undefined) {
95+
if ( bone !== undefined ) {
9696

97-
bone.jointName = joints [ i ];
97+
bone.jointName = joints[ i ];
9898

9999
}
100100

0 commit comments

Comments
 (0)