@operato/scene-visualizer 7.3.15 → 7.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html-overlay-element.js +0 -6
- package/dist/html-overlay-element.js.map +1 -1
- package/dist/three-container.js +1 -0
- package/dist/three-container.js.map +1 -1
- package/dist/threed/real-object-text.d.ts +1 -1
- package/dist/threed/real-object-text.js +1 -1
- package/dist/threed/real-object-text.js.map +1 -1
- package/dist/threed/real-object.d.ts +2 -2
- package/dist/threed/real-object.js +6 -2
- package/dist/threed/real-object.js.map +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -622
- package/attachments/0d91a37d-c2d7-4c6d-88dc-a29e5bbea361.png +0 -0
- package/attachments/1b07c8d3-07d5-4007-b02e-031ee1755539.glb +0 -0
- package/attachments/226c6c23-c4fd-46c8-93e3-3d3d9c4bb8a9.glb +0 -0
- package/attachments/4425ca46-cf1d-476d-9185-dcb881ecad1f.glb +0 -0
- package/attachments/51e7c45d-6eae-4baf-a4e2-ba979b7e77cd.glb +0 -0
- package/attachments/54427925-c109-4499-875c-fb14207b95c5.glb +0 -0
- package/attachments/8cc70a65-e20f-4187-83c8-64deb3faf3d9.glb +0 -0
- package/attachments/964d004d-1fe7-4224-89a6-2b6e86db233c.glb +0 -0
- package/attachments/ff47fd63-6f1c-4a69-b965-9bb03797a415.png +0 -0
- package/db.sqlite +0 -0
- package/demo/index-modeller.html +0 -112
- package/demo/index.html +0 -109
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +0 -20
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +0 -20
- package/logs/application-2024-10-01-00.log +0 -105
- package/logs/application-2024-10-01-01.log +0 -105
- package/logs/connections-2024-10-01-00.log +0 -50
- package/logs/connections-2024-10-01-01.log +0 -50
- package/schema.graphql +0 -4455
- package/src/banner.ts +0 -88
- package/src/camera.ts +0 -132
- package/src/component.d.ts +0 -10
- package/src/cube.ts +0 -39
- package/src/cylinder.ts +0 -39
- package/src/desk.ts +0 -135
- package/src/editors/index.ts +0 -13
- package/src/editors/property-editor-gltf-info.ts +0 -135
- package/src/editors/property-editor-location-increase-pattern.ts +0 -260
- package/src/effects/outline.ts +0 -54
- package/src/ellipse.ts +0 -37
- package/src/gltf-object.ts +0 -117
- package/src/html-overlay-element.ts +0 -21
- package/src/index.ts +0 -29
- package/src/light.ts +0 -155
- package/src/polygon.ts +0 -88
- package/src/rack-table-cell.ts +0 -386
- package/src/rack-table.ts +0 -1296
- package/src/rack.ts +0 -232
- package/src/rect.ts +0 -39
- package/src/scene/component.ts +0 -38
- package/src/sphere.ts +0 -39
- package/src/sprite.ts +0 -30
- package/src/stock.ts +0 -262
- package/src/templates/3d-container.ts +0 -21
- package/src/templates/banner.ts +0 -21
- package/src/templates/camera.ts +0 -25
- package/src/templates/cube.ts +0 -20
- package/src/templates/cylinder.ts +0 -20
- package/src/templates/desk.ts +0 -20
- package/src/templates/gltf-object.ts +0 -20
- package/src/templates/index.ts +0 -29
- package/src/templates/light.ts +0 -23
- package/src/templates/pallet.ts +0 -20
- package/src/templates/rack-table.ts +0 -21
- package/src/templates/sphere.ts +0 -20
- package/src/templates/sprite.ts +0 -21
- package/src/templates/visualizer.ts +0 -21
- package/src/templates/wall.ts +0 -20
- package/src/text.ts +0 -10
- package/src/three-container-editor.ts +0 -187
- package/src/three-container.ts +0 -723
- package/src/three-controls.ts +0 -778
- package/src/three-layout.ts +0 -25
- package/src/three-space.ts +0 -732
- package/src/threed/common.ts +0 -21
- package/src/threed/floor/floor.ts +0 -62
- package/src/threed/html/elements.ts +0 -27
- package/src/threed/index.ts +0 -15
- package/src/threed/real-object-camera-meshed.ts +0 -67
- package/src/threed/real-object-camera.ts +0 -41
- package/src/threed/real-object-dom-element.ts +0 -55
- package/src/threed/real-object-dummy.ts +0 -13
- package/src/threed/real-object-extrude.ts +0 -210
- package/src/threed/real-object-gltf.ts +0 -136
- package/src/threed/real-object-group.ts +0 -35
- package/src/threed/real-object-mesh.ts +0 -74
- package/src/threed/real-object-plane.ts +0 -27
- package/src/threed/real-object-scene.ts +0 -84
- package/src/threed/real-object-sprite-2d.ts +0 -54
- package/src/threed/real-object-sprite.ts +0 -64
- package/src/threed/real-object-text.ts +0 -86
- package/src/threed/real-object.ts +0 -321
- package/src/threed/texture/canvas-texture.ts +0 -67
- package/src/threed/texture/text-texture.ts +0 -100
- package/src/threed/three-dimensional-container.ts +0 -9
- package/src/threed/utils/bound-uv-generator.ts +0 -80
- package/src/visualizer.ts +0 -319
- package/src/wall.ts +0 -50
- package/tsconfig.json +0 -24
- package/tsconfig.tsbuildinfo +0 -1
- package/web-dev-server.config.mjs +0 -27
package/src/templates/cube.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/cube.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'cube',
|
|
5
|
-
description: '3D cube',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'cube',
|
|
10
|
-
left: 100,
|
|
11
|
-
top: 100,
|
|
12
|
-
width: 100,
|
|
13
|
-
height: 100,
|
|
14
|
-
depth: 100,
|
|
15
|
-
fillStyle: '#ffffff',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 1,
|
|
18
|
-
alpha: 1
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/cylinder.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'cylinder',
|
|
5
|
-
description: '3D cylinder',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'cylinder',
|
|
10
|
-
cx: 100,
|
|
11
|
-
cy: 100,
|
|
12
|
-
rx: 100,
|
|
13
|
-
ry: 100,
|
|
14
|
-
depth: 100,
|
|
15
|
-
fillStyle: '#ffffff',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 1,
|
|
18
|
-
alpha: 1
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/templates/desk.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/desk.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'desk',
|
|
5
|
-
description: '3D desk',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'desk',
|
|
10
|
-
left: 100,
|
|
11
|
-
top: 100,
|
|
12
|
-
width: 100,
|
|
13
|
-
height: 100,
|
|
14
|
-
depth: 50,
|
|
15
|
-
fillStyle: '#CCAA76',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 1,
|
|
18
|
-
alpha: 1
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/gltf-object.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'gltf-object',
|
|
5
|
-
description: '3D gltf-object',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'gltf-object',
|
|
10
|
-
left: 100,
|
|
11
|
-
top: 100,
|
|
12
|
-
width: 200,
|
|
13
|
-
height: 200,
|
|
14
|
-
depth: 200,
|
|
15
|
-
fillStyle: '#CCAA76',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 1,
|
|
18
|
-
alpha: 1
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/templates/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import threeContainer from './3d-container'
|
|
2
|
-
import visualizer from './visualizer'
|
|
3
|
-
import rackTable from './rack-table'
|
|
4
|
-
import cube from './cube'
|
|
5
|
-
import cylinder from './cylinder'
|
|
6
|
-
import sphere from './sphere'
|
|
7
|
-
import banner from './banner'
|
|
8
|
-
import sprite from './sprite'
|
|
9
|
-
import wall from './wall'
|
|
10
|
-
import desk from './desk'
|
|
11
|
-
import camera from './camera'
|
|
12
|
-
import light from './light'
|
|
13
|
-
import GLTFObject from './gltf-object'
|
|
14
|
-
|
|
15
|
-
export default [
|
|
16
|
-
threeContainer,
|
|
17
|
-
visualizer,
|
|
18
|
-
rackTable,
|
|
19
|
-
camera,
|
|
20
|
-
light,
|
|
21
|
-
cube,
|
|
22
|
-
cylinder,
|
|
23
|
-
sphere,
|
|
24
|
-
sprite,
|
|
25
|
-
banner,
|
|
26
|
-
wall,
|
|
27
|
-
desk,
|
|
28
|
-
GLTFObject
|
|
29
|
-
]
|
package/src/templates/light.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/light.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'light',
|
|
5
|
-
description: 'Light',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'light',
|
|
10
|
-
rx: 10,
|
|
11
|
-
ry: 10,
|
|
12
|
-
cx: 150,
|
|
13
|
-
cy: 150,
|
|
14
|
-
zPos: 1000,
|
|
15
|
-
fillStyle: '#fff',
|
|
16
|
-
strokeStyle: '#000',
|
|
17
|
-
alpha: 1,
|
|
18
|
-
hidden: false,
|
|
19
|
-
lineWidth: 1,
|
|
20
|
-
lineDash: 'solid',
|
|
21
|
-
lineCap: 'butt'
|
|
22
|
-
}
|
|
23
|
-
}
|
package/src/templates/pallet.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/pallet.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'pallet',
|
|
5
|
-
description: '3D pallet',
|
|
6
|
-
group: 'warehouse' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'pallet',
|
|
10
|
-
left: 100,
|
|
11
|
-
top: 100,
|
|
12
|
-
width: 100,
|
|
13
|
-
height: 100,
|
|
14
|
-
depth: 10,
|
|
15
|
-
fillStyle: '#CCAA76',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 1,
|
|
18
|
-
alpha: 1
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/rack-table.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'rack-table',
|
|
5
|
-
description: '3D rack-table',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'rack-table',
|
|
10
|
-
top: 100,
|
|
11
|
-
left: 100,
|
|
12
|
-
width: 500,
|
|
13
|
-
height: 200,
|
|
14
|
-
locPattern: '{z}{s}-{u}{sh}',
|
|
15
|
-
increasePattern: '+u+s',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 2,
|
|
18
|
-
rows: 5,
|
|
19
|
-
columns: 5
|
|
20
|
-
}
|
|
21
|
-
}
|
package/src/templates/sphere.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/sphere.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'sphere',
|
|
5
|
-
description: '3D sphere',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'sphere',
|
|
10
|
-
cx: 100,
|
|
11
|
-
cy: 100,
|
|
12
|
-
rx: 100,
|
|
13
|
-
ry: 100,
|
|
14
|
-
rz: 100,
|
|
15
|
-
fillStyle: '#ffffff',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 1,
|
|
18
|
-
alpha: 1
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/templates/sprite.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/sprite.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'sprite',
|
|
5
|
-
description: 'sprite',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'sprite',
|
|
10
|
-
top: 100,
|
|
11
|
-
left: 100,
|
|
12
|
-
width: 200,
|
|
13
|
-
height: 80,
|
|
14
|
-
zPos: 40,
|
|
15
|
-
depth: 10,
|
|
16
|
-
fillStyle: '#ffffff',
|
|
17
|
-
strokeStyle: '#999',
|
|
18
|
-
lineWidth: 1,
|
|
19
|
-
alpha: 1
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/visualizer.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'visualizer',
|
|
5
|
-
description: '3D visualizer',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'visualizer',
|
|
10
|
-
left: 100,
|
|
11
|
-
top: 100,
|
|
12
|
-
width: 800,
|
|
13
|
-
height: 600,
|
|
14
|
-
fillStyle: 'darkgray',
|
|
15
|
-
fov: 60,
|
|
16
|
-
near: 10,
|
|
17
|
-
far: 10000,
|
|
18
|
-
zoom: 100,
|
|
19
|
-
threed: false
|
|
20
|
-
}
|
|
21
|
-
}
|
package/src/templates/wall.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/wall.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
type: 'wall',
|
|
5
|
-
description: '3D wall',
|
|
6
|
-
group: '3D' /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */,
|
|
7
|
-
icon,
|
|
8
|
-
model: {
|
|
9
|
-
type: 'wall',
|
|
10
|
-
left: 100,
|
|
11
|
-
top: 100,
|
|
12
|
-
width: 100,
|
|
13
|
-
height: 100,
|
|
14
|
-
depth: 50,
|
|
15
|
-
fillStyle: '#ffffff',
|
|
16
|
-
strokeStyle: '#999',
|
|
17
|
-
lineWidth: 1,
|
|
18
|
-
alpha: 1
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/text.ts
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three'
|
|
2
|
-
|
|
3
|
-
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
|
|
4
|
-
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js'
|
|
5
|
-
|
|
6
|
-
export class ThreeContainerEditor {
|
|
7
|
-
private ortho: THREE.OrthographicCamera
|
|
8
|
-
private persp: THREE.PerspectiveCamera
|
|
9
|
-
|
|
10
|
-
private scene: THREE.Scene
|
|
11
|
-
private camera: THREE.Camera
|
|
12
|
-
private renderer: THREE.Renderer
|
|
13
|
-
|
|
14
|
-
private orbit?: OrbitControls
|
|
15
|
-
private transform?: TransformControls
|
|
16
|
-
|
|
17
|
-
constructor(
|
|
18
|
-
scene: THREE.Scene,
|
|
19
|
-
ortho: THREE.OrthographicCamera,
|
|
20
|
-
persp: THREE.PerspectiveCamera,
|
|
21
|
-
camera: THREE.Camera,
|
|
22
|
-
renderer: THREE.Renderer
|
|
23
|
-
) {
|
|
24
|
-
this.ortho = ortho
|
|
25
|
-
this.persp = persp
|
|
26
|
-
|
|
27
|
-
this.scene = scene
|
|
28
|
-
this.camera = camera
|
|
29
|
-
this.renderer = renderer
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
dispose() {
|
|
33
|
-
this.orbit?.dispose()
|
|
34
|
-
this.transform?.dispose()
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get orbitControls(): OrbitControls {
|
|
38
|
-
if (!this.orbit) {
|
|
39
|
-
this.orbit = new OrbitControls(this.camera!, this.renderer.domElement)
|
|
40
|
-
this.orbit.update()
|
|
41
|
-
|
|
42
|
-
this.orbit.addEventListener('change', this.render)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return this.orbit
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get transformControls(): TransformControls {
|
|
49
|
-
if (!this.transform) {
|
|
50
|
-
this.transform = new TransformControls(this.camera!, this.renderer.domElement)
|
|
51
|
-
this.transform.addEventListener('change', this.render)
|
|
52
|
-
|
|
53
|
-
this.transform.addEventListener('dragging-changed', event => {
|
|
54
|
-
this.orbitControls.enabled = !event.value
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return this.transform
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
attach(target: THREE.Object3D) {
|
|
62
|
-
this.transform?.attach(target)
|
|
63
|
-
this.scene.add(this.transformControls)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
detach() {
|
|
67
|
-
this.scene.remove(this.transformControls)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
onKeyDown(e: KeyboardEvent) {
|
|
71
|
-
switch (e.code) {
|
|
72
|
-
case 'KeyQ':
|
|
73
|
-
this.transformControls.setSpace(this.transformControls.space === 'local' ? 'world' : 'local')
|
|
74
|
-
break
|
|
75
|
-
|
|
76
|
-
case 'ShiftLeft':
|
|
77
|
-
case 'ShiftRight':
|
|
78
|
-
this.transformControls.setTranslationSnap(100)
|
|
79
|
-
this.transformControls.setRotationSnap(THREE.MathUtils.degToRad(15))
|
|
80
|
-
this.transformControls.setScaleSnap(0.25)
|
|
81
|
-
break
|
|
82
|
-
|
|
83
|
-
case 'KeyW':
|
|
84
|
-
this.transformControls.setMode('translate')
|
|
85
|
-
break
|
|
86
|
-
|
|
87
|
-
case 'KeyE':
|
|
88
|
-
this.transformControls.setMode('rotate')
|
|
89
|
-
break
|
|
90
|
-
|
|
91
|
-
case 'KeyR':
|
|
92
|
-
this.transformControls.setMode('scale')
|
|
93
|
-
break
|
|
94
|
-
|
|
95
|
-
case 'KeyC':
|
|
96
|
-
const position = this.camera.position.clone()
|
|
97
|
-
|
|
98
|
-
this.camera = (this.camera as THREE.PerspectiveCamera).isPerspectiveCamera ? this.ortho : this.persp
|
|
99
|
-
this.camera.position.copy(position)
|
|
100
|
-
|
|
101
|
-
this.orbitControls.object = this.camera
|
|
102
|
-
this.transformControls.camera = this.camera
|
|
103
|
-
|
|
104
|
-
this.camera.lookAt(this.orbitControls.target.x, this.orbitControls.target.y, this.orbitControls.target.z)
|
|
105
|
-
|
|
106
|
-
this.onWindowResize()
|
|
107
|
-
|
|
108
|
-
break
|
|
109
|
-
|
|
110
|
-
case 'KeyV':
|
|
111
|
-
const randomFoV = Math.random() + 0.1
|
|
112
|
-
const randomZoom = Math.random() + 0.1
|
|
113
|
-
|
|
114
|
-
this.persp.fov = randomFoV * 160
|
|
115
|
-
this.ortho.bottom = -randomFoV * 500
|
|
116
|
-
this.ortho.top = randomFoV * 500
|
|
117
|
-
|
|
118
|
-
this.persp.zoom = randomZoom * 5
|
|
119
|
-
this.ortho.zoom = randomZoom * 5
|
|
120
|
-
|
|
121
|
-
this.onWindowResize()
|
|
122
|
-
|
|
123
|
-
break
|
|
124
|
-
|
|
125
|
-
case 'Equal':
|
|
126
|
-
case 'NumpadAdd':
|
|
127
|
-
case 'NumpadEqual':
|
|
128
|
-
this.transformControls.setSize(this.transformControls.size + 0.1)
|
|
129
|
-
break
|
|
130
|
-
|
|
131
|
-
case 'Minus': // -
|
|
132
|
-
case 'IntlRo': // _
|
|
133
|
-
case 'NumpadSubtract': // num-
|
|
134
|
-
this.transformControls.setSize(Math.max(this.transformControls.size - 0.1, 0.1))
|
|
135
|
-
break
|
|
136
|
-
|
|
137
|
-
case 'KeyX':
|
|
138
|
-
this.transformControls.showX = !this.transformControls.showX
|
|
139
|
-
break
|
|
140
|
-
|
|
141
|
-
case 'KeyY':
|
|
142
|
-
this.transformControls.showY = !this.transformControls.showY
|
|
143
|
-
break
|
|
144
|
-
|
|
145
|
-
case 'KeyZ':
|
|
146
|
-
this.transformControls.showZ = !this.transformControls.showZ
|
|
147
|
-
break
|
|
148
|
-
|
|
149
|
-
case 'Space':
|
|
150
|
-
this.transformControls.enabled = !this.transformControls.enabled
|
|
151
|
-
break
|
|
152
|
-
|
|
153
|
-
case 'Esc':
|
|
154
|
-
this.transformControls.reset()
|
|
155
|
-
break
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
onKeyUp(e: KeyboardEvent) {
|
|
160
|
-
switch (e.code) {
|
|
161
|
-
case 'Shift':
|
|
162
|
-
this.transformControls.setTranslationSnap(null)
|
|
163
|
-
this.transformControls.setRotationSnap(null)
|
|
164
|
-
this.transformControls.setScaleSnap(null)
|
|
165
|
-
break
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
onWindowResize() {
|
|
170
|
-
const aspect = window.innerWidth / window.innerHeight
|
|
171
|
-
|
|
172
|
-
this.persp.aspect = aspect
|
|
173
|
-
this.persp.updateProjectionMatrix()
|
|
174
|
-
|
|
175
|
-
this.ortho.left = this.ortho.bottom * aspect
|
|
176
|
-
this.ortho.right = this.ortho.top * aspect
|
|
177
|
-
this.ortho.updateProjectionMatrix()
|
|
178
|
-
|
|
179
|
-
this.renderer.setSize(window.innerWidth, window.innerHeight)
|
|
180
|
-
|
|
181
|
-
this.render()
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
render() {
|
|
185
|
-
this.renderer.render(this.scene, this.camera)
|
|
186
|
-
}
|
|
187
|
-
}
|