Skip to content

Commit 1b21e9e

Browse files
committed
Run prettier
1 parent fc9a105 commit 1b21e9e

File tree

85 files changed

+714
-224
lines changed

Some content is hidden

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

85 files changed

+714
-224
lines changed

Diff for: src/css/examples.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
* {
22
margin: 0;
33
padding: 0;
4-
font-family: BlinkMacSystemFont, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Helvetica, Arial,
5-
sans-serif;
4+
font-family: BlinkMacSystemFont, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans',
5+
'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
66
}
77

88
body {

Diff for: src/css/style.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ footer,
88
a {
99
margin: 0;
1010
padding: 0;
11-
font-family: BlinkMacSystemFont, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Helvetica, Arial,
12-
sans-serif;
11+
font-family: BlinkMacSystemFont, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans',
12+
'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
1313
color: #363636;
1414
}
1515

Diff for: src/docs.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
/>
69
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
710
<link rel="icon" sizes="16x16" type="image/png" href="/img/icon/logo-16x16.png" />
811
<link rel="icon" sizes="32x32" type="image/png" href="/img/icon/logo-32x32.png" />
912
<link rel="icon" sizes="96x96" type="image/png" href="/img/icon/logo-96x96.png" />
1013
<title>enable3d • documentation</title>
11-
<meta name="description" content="3D game framework on top of Three.js and Ammo.js (bullet3) which integrates perfectly with Phaser 3." />
14+
<meta
15+
name="description"
16+
content="3D game framework on top of Three.js and Ammo.js (bullet3) which integrates perfectly with Phaser 3."
17+
/>
1218
<link rel="stylesheet" href="/css/style.css?ver=1.2.1" />
1319
<link rel="stylesheet" href="/css/floating-action-button.css?ver=1.0.1" />
1420

@@ -22,19 +28,15 @@
2228
<div id="sponsor-section">
2329
<span>
2430
Enable3d is maintained and provided for free, please consider supporting it on
25-
<a href="https://github.com/sponsors/yandeu">
26-
GitHub Sponsors
27-
</a>
31+
<a href="https://github.com/sponsors/yandeu"> GitHub Sponsors </a>
2832
❤️
2933
</span>
3034
</div>
3135

3236
<div>
3337
<a href="#logo">
34-
<div id="floating-action-button" style="transform: rotate(90deg);">
35-
<div>
36-
&#10094;
37-
</div>
38+
<div id="floating-action-button" style="transform: rotate(90deg)">
39+
<div>&#10094;</div>
3840
</div>
3941
</a>
4042
</div>
@@ -141,10 +143,8 @@ <h1 id="documentation">Documentation</h1>
141143
}
142144
</script>
143145
<footer>
144-
<a href="https://github.com/enable3d/enable3d#readme">
145-
github.com/enable3d/enable3d
146-
</a>
147-
<div style="margin-top:16px;">
146+
<a href="https://github.com/enable3d/enable3d#readme"> github.com/enable3d/enable3d </a>
147+
<div style="margin-top: 16px">
148148
<a
149149
class="github-button"
150150
href="https://github.com/yandeu"

Diff for: src/examples.html

+39-17
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
/>
69
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
710
<link rel="icon" sizes="16x16" type="image/png" href="/img/icon/logo-16x16.png" />
811
<link rel="icon" sizes="32x32" type="image/png" href="/img/icon/logo-32x32.png" />
912
<link rel="icon" sizes="96x96" type="image/png" href="/img/icon/logo-96x96.png" />
1013
<title>enable3d • 3D extension for Phaser 3</title>
11-
<meta name="description" content="3D game framework on top of Three.js and Ammo.js (bullet3) which integrates perfectly with Phaser 3." />
14+
<meta
15+
name="description"
16+
content="3D game framework on top of Three.js and Ammo.js (bullet3) which integrates perfectly with Phaser 3."
17+
/>
1218
<link rel="stylesheet" href="/css/style.css?ver=1.2.1" />
1319
</head>
1420

1521
<body>
1622
<div id="sponsor-section">
1723
<span>
1824
Enable3d is maintained and provided for free, please consider supporting it on
19-
<a href="https://github.com/sponsors/yandeu">
20-
GitHub Sponsors
21-
</a>
25+
<a href="https://github.com/sponsors/yandeu"> GitHub Sponsors </a>
2226
❤️
2327
</span>
2428
</div>
@@ -92,7 +96,9 @@ <h3>Standalone Mode</h3>
9296
<li><a href="./examples/raycast-vehicle.html">Car (Raycast Vehicle) SOON</a></li>
9397
<li><a href="./examples/car-using-physics-constraints.html">Car (Physics Constraints) NEW</a></li>
9498

95-
<h3 id="2d-elements" style="font-style: italic; line-height: 0; padding-top: 24px;">2D Elements (Experimental)</h3>
99+
<h3 id="2d-elements" style="font-style: italic; line-height: 0; padding-top: 24px">
100+
2D Elements (Experimental)
101+
</h3>
96102
<p>
97103
These 2D elements are new and still in development.<br />
98104
They are rendered by three.js and<br />
@@ -102,7 +108,9 @@ <h3 id="2d-elements" style="font-style: italic; line-height: 0; padding-top: 24p
102108
<ul>
103109
<li><a href="./examples/flat/button-spritesheet.html">Button EXP</a></li>
104110
<li><a href="./examples/flat/matter-physics.html">2D Physics (matter.js) EXP</a></li>
105-
<li><a href="./examples/flat/matter-physics-advanced-shapes.html">Matter Physics (Advanced Shapes) EXP</a></li>
111+
<li>
112+
<a href="./examples/flat/matter-physics-advanced-shapes.html">Matter Physics (Advanced Shapes) EXP</a>
113+
</li>
106114
<li><a href="./examples/flat/text-sprite.html">Text Sprite EXP</a></li>
107115
<li><a href="./examples/flat/texture-atlas.html">Texture Atlas EXP</a></li>
108116
<li><a href="./examples/flat/pixel-perfect.html">Pixel Perfect EXP</a></li>
@@ -117,7 +125,9 @@ <h3>As 3D Extension for Phaser</h3>
117125
<li><a href="./examples/custom-setup.html">Custom Setup</a></li>
118126
<li><a href="./examples/sync-2d-to-3d.html">Sync 2D to 3D NEW</a></li>
119127
<li><a href="./examples/sync-3d-to-2d.html">Sync 3D to 2D NEW</a></li>
120-
<li><a href="./examples/isometric-game-orthographic-camera.html">Isometric Game / Orthographic Camera NEW</a></li>
128+
<li>
129+
<a href="./examples/isometric-game-orthographic-camera.html">Isometric Game / Orthographic Camera NEW</a>
130+
</li>
121131
<li><a href="./examples/jenga-game.html">Jenga Game</a></li>
122132
<li><a href="./examples/collision-detection.html">Collision Detection</a></li>
123133
<li><a href="./examples/load-and-use-textures.html">Load and Use Textures</a></li>
@@ -126,14 +136,24 @@ <h3>As 3D Extension for Phaser</h3>
126136
<li><a href="./examples/material-showcase.html">Material Showcase</a></li>
127137
<li><a href="./examples/enemy-patrols-on-platform.html">Enemy Patrols on Platform</a></li>
128138
<li><a href="./examples/constructive-solid-geometry.html">Constructive Solid Geometry (CSG)</a></li>
129-
<li><a href="./examples/constructive-solid-geometry-physics.html">Constructive Solid Geometry (CSG) with Physics</a></li>
130-
<li><a href="./examples/constructive-solid-geometry-physics-and-breakable.html">Constructive Solid Geometry (CSG) with Physics & Breakable</a></li>
139+
<li>
140+
<a href="./examples/constructive-solid-geometry-physics.html"
141+
>Constructive Solid Geometry (CSG) with Physics</a
142+
>
143+
</li>
144+
<li>
145+
<a href="./examples/constructive-solid-geometry-physics-and-breakable.html"
146+
>Constructive Solid Geometry (CSG) with Physics & Breakable</a
147+
>
148+
</li>
131149
<li><a href="./examples/debug-bodies.html">Debug Bodies</a></li>
132150
<li><a href="./examples/dash-and-blast-prototype.html">Dash and Blast Prototype</a></li>
133151
<li><a href="./examples/kinematic-body-orbiting-around-sun.html">Kinematic Body Orbiting around Sun</a></li>
134152
<li><a href="./examples/create-3d-geometry-from-2d-path.html">Create 3D Geometry from 2D Path</a></li>
135153
<li><a href="./examples/create-3d-geometry-from-svg-file.html">Create 3D Geometry from SVG file</a></li>
136-
<li><a href="./examples/create-3d-geometry-from-png-file.html">Create 3D Geometry from PNG file (heightmap)</a></li>
154+
<li>
155+
<a href="./examples/create-3d-geometry-from-png-file.html">Create 3D Geometry from PNG file (heightmap)</a>
156+
</li>
137157
<li><a href="./examples/camera-lerping-and-player-controls.html">Camera Lerping and Player Controls</a></li>
138158
<li><a href="./examples/3rd-person-camera.html">3rd Person Camera</a></li>
139159
<li><a href="./examples/virtual-reality-phaser.html">Virtual Reality (with Phaser)</a></li>
@@ -146,13 +166,17 @@ <h3>As 3D Extension for Phaser</h3>
146166
<li><a href="./examples/first-person-shooter.html">First Person Shooter</a></li>
147167
<li><a href="./examples/first-phaser-game-3d-version.html">First Phaser Game (3d version)</a></li>
148168
<li><a href="./examples/wrecking-ball-with-metal-chain.html">Wrecking Ball with Metal Chain</a></li>
149-
<li><a href="./examples/adjust-gamma-factor-and-shadows.html">Adjust GammaFactor and Shadows at Runtime</a></li>
169+
<li>
170+
<a href="./examples/adjust-gamma-factor-and-shadows.html">Adjust GammaFactor and Shadows at Runtime</a>
171+
</li>
150172
<li><a href="./examples/texture-cube.html">Texture Cube</a></li>
151173
<li><a href="./examples/change-material-of-3d-model.html">Change Material of 3d Model</a></li>
152174
<li><a href="./examples/compare-physics-body-shapes.html">Compare Physics Body Shapes</a></li>
153175
<li><a href="./examples/tween-manager.html">Tween Manager</a></li>
154176
<li><a href="./examples/switch-camera-between-2d-and-3d.html">Switch Camera between 2d and 3d</a></li>
155-
<li><a href="./examples/create-and-destroy-objects-and-physics.html">Create and Destroy Objects and Physics</a></li>
177+
<li>
178+
<a href="./examples/create-and-destroy-objects-and-physics.html">Create and Destroy Objects and Physics</a>
179+
</li>
156180
</ul>
157181
</div>
158182
<script>
@@ -170,10 +194,8 @@ <h3>As 3D Extension for Phaser</h3>
170194
</script>
171195
</section>
172196
<footer>
173-
<a href="https://github.com/enable3d/enable3d#readme">
174-
github.com/enable3d/enable3d
175-
</a>
176-
<div style="margin-top:16px;">
197+
<a href="https://github.com/enable3d/enable3d#readme"> github.com/enable3d/enable3d </a>
198+
<div style="margin-top: 16px">
177199
<a
178200
class="github-button"
179201
href="https://github.com/yandeu"

Diff for: src/examples/3rd-person-camera.html

+16-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
/>
69
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
710
<title>3rd Person Camera</title>
811
<link rel="stylesheet" href="/css/examples.css?ver=1.0.0" />
@@ -14,7 +17,18 @@
1417
<body>
1518
<div id="info-text">Use WASD, SPACE and your Mouse.<br />Works on mobile and desktop.</div>
1619
<script>
17-
const { enable3d, Scene3D, Canvas, ThirdDimension, THREE, JoyStick, PointerLock, PointerDrag, ExtendedObject3D, ThirdPersonControls } = ENABLE3D
20+
const {
21+
enable3d,
22+
Scene3D,
23+
Canvas,
24+
ThirdDimension,
25+
THREE,
26+
JoyStick,
27+
PointerLock,
28+
PointerDrag,
29+
ExtendedObject3D,
30+
ThirdPersonControls
31+
} = ENABLE3D
1832

1933
/**
2034
* Is touch device?

Diff for: src/examples/adjust-gamma-factor-and-shadows.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
/>
69
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
710
<title>Adjust GammaFactor and Shadows at Runtime</title>
811
<link rel="stylesheet" href="/css/examples.css?ver=1.0.0" />

Diff for: src/examples/camera-lerping-and-player-controls.html

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
/>
69
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
710
<title>Camera Lerping and Player Controls</title>
811
<link rel="stylesheet" href="/css/examples.css?ver=1.0.0" />
@@ -12,9 +15,7 @@
1215
</head>
1316

1417
<body>
15-
<div id="info-text">
16-
Use WASD to move the player, change the camera with SPACE.
17-
</div>
18+
<div id="info-text">Use WASD to move the player, change the camera with SPACE.</div>
1819
<script>
1920
const { enable3d, Scene3D, Canvas, THREE } = ENABLE3D
2021

@@ -42,7 +43,10 @@
4243
this.player = new THREE.Group()
4344
this.player.name = 'player' // <-- set a name if you haven't already
4445
this.player.position.setY(2)
45-
const body = this.third.add.box({ height: 0.8, y: 1, width: 0.4, depth: 0.4 }, { lambert: { color: 0xffff00 } })
46+
const body = this.third.add.box(
47+
{ height: 0.8, y: 1, width: 0.4, depth: 0.4 },
48+
{ lambert: { color: 0xffff00 } }
49+
)
4650
const head = this.third.add.sphere({ radius: 0.25, y: 1.7, z: 0.05 }, { lambert: { color: 0xffff00 } })
4751
this.player.add(body, head)
4852
this.player.position.setY(5)
@@ -92,7 +96,10 @@
9296
update(time, delta) {
9397
if (typeof this.player?.body === 'undefined') return
9498

95-
this.third.camera.position.lerp(this.camerasArr[this.cameraIndex % 3].getWorldPosition(new THREE.Vector3()), 0.05)
99+
this.third.camera.position.lerp(
100+
this.camerasArr[this.cameraIndex % 3].getWorldPosition(new THREE.Vector3()),
101+
0.05
102+
)
96103
const pos = this.player.position.clone()
97104
this.third.camera.lookAt(pos.x, pos.y + 3, pos.z)
98105

Diff for: src/examples/car-using-physics-constraints.html

+36-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
/>
69
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
710
<title>Car using Physics Constraints</title>
811
<link rel="stylesheet" href="/css/examples.css?ver=1.0.0" />
@@ -32,7 +35,10 @@
3235
}
3336

3437
addPlate() {
35-
const plate = this.add.box({ y: 1, width: 1.8, depth: 4.7, mass: 5000, height: 0.25 }, { lambert: { wireframe: true } })
38+
const plate = this.add.box(
39+
{ y: 1, width: 1.8, depth: 4.7, mass: 5000, height: 0.25 },
40+
{ lambert: { wireframe: true } }
41+
)
3642
this.physics.add.existing(plate)
3743
return plate
3844
}
@@ -71,7 +77,10 @@
7177
}
7278

7379
addAxisRotor(x, y, z) {
74-
const axisRotor = this.add.box({ x, y, z, mass: 5, width: 0.25, height: 0.2, depth: 1 }, { lambert: { transparent, opacity: 0.5 } })
80+
const axisRotor = this.add.box(
81+
{ x, y, z, mass: 5, width: 0.25, height: 0.2, depth: 1 },
82+
{ lambert: { transparent, opacity: 0.5 } }
83+
)
7584
this.physics.add.existing(axisRotor)
7685
return axisRotor
7786
}
@@ -119,10 +128,26 @@
119128

120129
// constraint wheel to rotor
121130
const wheelToRotorConstraint = { axisA: { y: 1 }, axisB: { y: 1 } }
122-
this.motorBackLeft = this.physics.add.constraints.hinge(wheelBackLeft.body, rotorBackLeft.body, wheelToRotorConstraint)
123-
this.motorBackRight = this.physics.add.constraints.hinge(wheelBackRight.body, rotorBackRight.body, wheelToRotorConstraint)
124-
this.motorFrontLeft = this.physics.add.constraints.hinge(wheelFrontLeft.body, rotorFrontLeft.body, wheelToRotorConstraint)
125-
this.motorFrontRight = this.physics.add.constraints.hinge(wheelFrontRight.body, rotorFrontRight.body, wheelToRotorConstraint)
131+
this.motorBackLeft = this.physics.add.constraints.hinge(
132+
wheelBackLeft.body,
133+
rotorBackLeft.body,
134+
wheelToRotorConstraint
135+
)
136+
this.motorBackRight = this.physics.add.constraints.hinge(
137+
wheelBackRight.body,
138+
rotorBackRight.body,
139+
wheelToRotorConstraint
140+
)
141+
this.motorFrontLeft = this.physics.add.constraints.hinge(
142+
wheelFrontLeft.body,
143+
rotorFrontLeft.body,
144+
wheelToRotorConstraint
145+
)
146+
this.motorFrontRight = this.physics.add.constraints.hinge(
147+
wheelFrontRight.body,
148+
rotorFrontRight.body,
149+
wheelToRotorConstraint
150+
)
126151

127152
// constraint axis to rotor
128153
const axisToRotor = (rotorRight, rotorLeft, axis, z) => {
@@ -230,7 +255,10 @@
230255
}
231256
}
232257

233-
PhysicsLoader('/lib/ammo/kripken', () => new Project({ scenes: [MainScene], maxSubSteps: 4, fixedTimeStep: 1 / 120 }))
258+
PhysicsLoader(
259+
'/lib/ammo/kripken',
260+
() => new Project({ scenes: [MainScene], maxSubSteps: 4, fixedTimeStep: 1 / 120 })
261+
)
234262
</script>
235263
</body>
236264
</html>

Diff for: src/examples/change-material-of-3d-model.html

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
/>
69
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
710
<title>Change Material of 3d Model</title>
811
<link rel="stylesheet" href="/css/examples.css?ver=1.0.0" />
@@ -74,7 +77,9 @@
7477
// lighten color by 10%
7578
const newColor = new THREE.Color(LightenDarkenColor(`#${color}`, 10))
7679
// add new standard material with metallic look
77-
child.material = this.third.add.material({ standard: { color: newColor, emissive: newColor, roughness: 0.4, metalness: 1, skinning: true } })
80+
child.material = this.third.add.material({
81+
standard: { color: newColor, emissive: newColor, roughness: 0.4, metalness: 1, skinning: true }
82+
})
7883
child.material.needsUpdate = true
7984
}
8085
}

0 commit comments

Comments
 (0)