@umituz/web-virtual 1.1.2 → 2.0.0
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/README.md +97 -8
- package/package.json +1 -1
- package/src/components/DigitalHQView.tsx +91 -52
- package/src/components/EntityInspector.tsx +8 -8
- package/src/components/VirtualCommandBar.tsx +10 -10
- package/src/components/VirtualEntityDrawer.tsx +15 -15
- package/src/components/VirtualReportModal.tsx +7 -6
- package/src/components/VirtualRoster.tsx +12 -11
- package/src/components/VirtualWorld.tsx +170 -35
- package/src/components/WorldControls.tsx +12 -12
- package/src/core/environment.test.ts +100 -16
- package/src/core/environment.ts +93 -7
- package/src/core/types.ts +53 -2
- package/src/engine/renderer.ts +58 -2
- package/src/entities/people/AvatarBuilder.test.ts +75 -0
- package/src/entities/people/AvatarBuilder.ts +23 -3
- package/src/presets/factoryPreset.ts +13 -44
- package/src/presets/farmPreset.ts +13 -44
- package/src/presets/hospitalPreset.ts +12 -33
- package/src/presets/officePreset.ts +65 -356
- package/src/presets/schoolPreset.ts +12 -33
- package/src/styles/virtual.css +215 -0
|
@@ -1,69 +1,38 @@
|
|
|
1
1
|
import * as THREE from 'three'
|
|
2
|
-
import type { WorldPreset,
|
|
2
|
+
import type { WorldPreset, WorldSlot, WorldZone } from '../core/types'
|
|
3
3
|
import { MaterialPalette } from '../engine/materials'
|
|
4
4
|
|
|
5
5
|
export const DEFAULT_FACTORY_ZONES: WorldZone[] = [
|
|
6
6
|
{
|
|
7
7
|
id: 'assembly_line',
|
|
8
|
-
name: '
|
|
8
|
+
name: 'Robotic Assembly Line',
|
|
9
9
|
color: '#0284c7',
|
|
10
|
-
description: '
|
|
10
|
+
description: 'High-speed robotic assembly and part joining line.',
|
|
11
11
|
cameraFocus: [-6, 1.2, 0],
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
id: 'quality_control',
|
|
15
|
-
name: '
|
|
15
|
+
name: 'Quality Control & Optical Testing',
|
|
16
16
|
color: '#10b981',
|
|
17
|
-
description: '
|
|
17
|
+
description: 'Product scanning, defect detection and packaging approval station.',
|
|
18
18
|
cameraFocus: [6, 1.0, -4],
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: 'warehouse_racks',
|
|
22
|
-
name: '
|
|
22
|
+
name: 'Logistics & Rack Warehouse',
|
|
23
23
|
color: '#f59e0b',
|
|
24
|
-
description: '
|
|
24
|
+
description: 'Automated palletizing and vertical storage area.',
|
|
25
25
|
cameraFocus: [6, 2.0, 5],
|
|
26
26
|
},
|
|
27
27
|
]
|
|
28
28
|
|
|
29
|
-
export const
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
name: 'Serkan — Hat Şefi',
|
|
34
|
-
role: 'Üretim Akış Gözetmeni',
|
|
35
|
-
department: 'İmalat',
|
|
36
|
-
zoneId: 'assembly_line',
|
|
37
|
-
status: 'working',
|
|
38
|
-
pinNumber: 1,
|
|
39
|
-
position: [-6, 0, 2],
|
|
40
|
-
avatarColor: '#0369a1',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'robot-arm-1',
|
|
44
|
-
type: 'equipment',
|
|
45
|
-
name: 'Robot Kolu RX-4',
|
|
46
|
-
role: 'Hassas Kaynak & Montaj',
|
|
47
|
-
department: 'Robotik',
|
|
48
|
-
zoneId: 'assembly_line',
|
|
49
|
-
status: 'running',
|
|
50
|
-
pinNumber: 2,
|
|
51
|
-
position: [-6, 0, -2],
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'factory-inspector',
|
|
55
|
-
type: 'person',
|
|
56
|
-
name: 'Ebru — Kalite Mühendisi',
|
|
57
|
-
role: 'Tolerans Doğrulama',
|
|
58
|
-
department: 'Kalite',
|
|
59
|
-
zoneId: 'quality_control',
|
|
60
|
-
status: 'idle',
|
|
61
|
-
pinNumber: 3,
|
|
62
|
-
position: [6, 0, -4],
|
|
63
|
-
avatarColor: '#047857',
|
|
64
|
-
},
|
|
29
|
+
export const FACTORY_SLOTS: WorldSlot[] = [
|
|
30
|
+
{ id: 'slot-1', label: 'Assembly line station', position: [-6, 0, 2], zoneId: 'assembly_line', pinNumber: 1, avatarColor: '#0369a1' },
|
|
31
|
+
{ id: 'slot-2', label: 'Robotic arm bay', position: [-6, 0, -2], zoneId: 'assembly_line', pinNumber: 2 },
|
|
32
|
+
{ id: 'slot-3', label: 'Quality control station', position: [6, 0, -4], zoneId: 'quality_control', pinNumber: 3, avatarColor: '#047857' },
|
|
65
33
|
]
|
|
66
34
|
|
|
35
|
+
|
|
67
36
|
export const factoryPreset: WorldPreset = {
|
|
68
37
|
id: 'preset-factory',
|
|
69
38
|
name: 'Smart Industrial Automation Plant',
|
|
@@ -97,7 +66,7 @@ export const factoryPreset: WorldPreset = {
|
|
|
97
66
|
nightBackgroundColor: '#020617',
|
|
98
67
|
},
|
|
99
68
|
zones: DEFAULT_FACTORY_ZONES,
|
|
100
|
-
|
|
69
|
+
slots: FACTORY_SLOTS,
|
|
101
70
|
|
|
102
71
|
buildScene: (scene: THREE.Scene, options) => {
|
|
103
72
|
const materials = new MaterialPalette()
|
|
@@ -1,69 +1,38 @@
|
|
|
1
1
|
import * as THREE from 'three'
|
|
2
|
-
import type { WorldPreset,
|
|
2
|
+
import type { WorldPreset, WorldSlot, WorldZone } from '../core/types'
|
|
3
3
|
import { MaterialPalette } from '../engine/materials'
|
|
4
4
|
|
|
5
5
|
export const DEFAULT_FARM_ZONES: WorldZone[] = [
|
|
6
6
|
{
|
|
7
7
|
id: 'greenhouse',
|
|
8
|
-
name: '
|
|
8
|
+
name: 'Hydroponics & Greenhouse',
|
|
9
9
|
color: '#22c55e',
|
|
10
|
-
description: '
|
|
10
|
+
description: 'Automated irrigation and climate-controlled greenhouse area.',
|
|
11
11
|
cameraFocus: [-8, 1, -5],
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
id: 'crop_fields',
|
|
15
|
-
name: '
|
|
15
|
+
name: 'Open Crop Fields',
|
|
16
16
|
color: '#84cc16',
|
|
17
|
-
description: '
|
|
17
|
+
description: 'Seasonal organic crop plots.',
|
|
18
18
|
cameraFocus: [6, 0.5, -4],
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: 'barn_storage',
|
|
22
|
-
name: '
|
|
22
|
+
name: 'Logistics Hangar & Storage',
|
|
23
23
|
color: '#b45309',
|
|
24
|
-
description: '
|
|
24
|
+
description: 'Harvest collection, packaging and tractor parking area.',
|
|
25
25
|
cameraFocus: [0, 1.5, 6],
|
|
26
26
|
},
|
|
27
27
|
]
|
|
28
28
|
|
|
29
|
-
export const
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
name: 'Ahmet — Sera Operatörü',
|
|
34
|
-
role: 'İklim Kontrolü & Sulama',
|
|
35
|
-
department: 'Sera Operasyonları',
|
|
36
|
-
zoneId: 'greenhouse',
|
|
37
|
-
status: 'working',
|
|
38
|
-
pinNumber: 1,
|
|
39
|
-
position: [-8, 0, -5],
|
|
40
|
-
avatarColor: '#15803d',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'farm-tractor-1',
|
|
44
|
-
type: 'vehicle',
|
|
45
|
-
name: 'Otonom Traktör Alpha',
|
|
46
|
-
role: 'Parsel Sürüm & İlaçlama',
|
|
47
|
-
department: 'Filo Yönetimi',
|
|
48
|
-
zoneId: 'crop_fields',
|
|
49
|
-
status: 'running',
|
|
50
|
-
pinNumber: 2,
|
|
51
|
-
position: [6, 0, -4],
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'farm-worker-2',
|
|
55
|
-
type: 'person',
|
|
56
|
-
name: 'Mehmet — Hasat Sorumlusu',
|
|
57
|
-
role: 'Paketleme & Depolama',
|
|
58
|
-
department: 'Lojistik',
|
|
59
|
-
zoneId: 'barn_storage',
|
|
60
|
-
status: 'idle',
|
|
61
|
-
pinNumber: 3,
|
|
62
|
-
position: [0, 0, 6],
|
|
63
|
-
avatarColor: '#b45309',
|
|
64
|
-
},
|
|
29
|
+
export const FARM_SLOTS: WorldSlot[] = [
|
|
30
|
+
{ id: 'slot-1', label: 'Greenhouse station', position: [-8, 0, -5], zoneId: 'greenhouse', pinNumber: 1, avatarColor: '#15803d' },
|
|
31
|
+
{ id: 'slot-2', label: 'Crop field unit', position: [6, 0, -4], zoneId: 'crop_fields', pinNumber: 2 },
|
|
32
|
+
{ id: 'slot-3', label: 'Barn & logistics station', position: [0, 0, 6], zoneId: 'barn_storage', pinNumber: 3, avatarColor: '#b45309' },
|
|
65
33
|
]
|
|
66
34
|
|
|
35
|
+
|
|
67
36
|
export const farmPreset: WorldPreset = {
|
|
68
37
|
id: 'preset-farm',
|
|
69
38
|
name: 'Smart Agriculture & Greenhouse Complex',
|
|
@@ -100,7 +69,7 @@ export const farmPreset: WorldPreset = {
|
|
|
100
69
|
nightBackgroundColor: '#020d04',
|
|
101
70
|
},
|
|
102
71
|
zones: DEFAULT_FARM_ZONES,
|
|
103
|
-
|
|
72
|
+
slots: FARM_SLOTS,
|
|
104
73
|
|
|
105
74
|
buildScene: (scene: THREE.Scene, options) => {
|
|
106
75
|
const materials = new MaterialPalette()
|
|
@@ -1,58 +1,37 @@
|
|
|
1
1
|
import * as THREE from 'three'
|
|
2
|
-
import type { WorldPreset,
|
|
2
|
+
import type { WorldPreset, WorldSlot, WorldZone } from '../core/types'
|
|
3
3
|
import { MaterialPalette } from '../engine/materials'
|
|
4
4
|
|
|
5
5
|
export const DEFAULT_HOSPITAL_ZONES: WorldZone[] = [
|
|
6
6
|
{
|
|
7
7
|
id: 'triage_er',
|
|
8
|
-
name: '
|
|
8
|
+
name: 'Emergency Response & Triage',
|
|
9
9
|
color: '#ef4444',
|
|
10
|
-
description: '
|
|
10
|
+
description: 'First assessment and emergency response unit.',
|
|
11
11
|
cameraFocus: [-8, 1.2, 0],
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
id: 'consultation',
|
|
15
|
-
name: '
|
|
15
|
+
name: 'Outpatient & Specialist Rooms',
|
|
16
16
|
color: '#06b6d4',
|
|
17
|
-
description: '
|
|
17
|
+
description: 'Patient examination and clinical diagnosis area.',
|
|
18
18
|
cameraFocus: [4, 1.0, -4],
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: 'icu_ward',
|
|
22
|
-
name: '
|
|
22
|
+
name: 'Intensive Care & Monitoring Ward',
|
|
23
23
|
color: '#3b82f6',
|
|
24
|
-
description: '
|
|
24
|
+
description: 'Vital sign monitors and patient beds.',
|
|
25
25
|
cameraFocus: [6, 1.0, 5],
|
|
26
26
|
},
|
|
27
27
|
]
|
|
28
28
|
|
|
29
|
-
export const
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
type: 'person',
|
|
33
|
-
name: 'Dr. Selin — Başhekim',
|
|
34
|
-
role: 'Klinik Direktörü & Tıbbi Karar',
|
|
35
|
-
department: 'Cerrahi',
|
|
36
|
-
zoneId: 'consultation',
|
|
37
|
-
status: 'working',
|
|
38
|
-
pinNumber: 1,
|
|
39
|
-
position: [4, 0, -4],
|
|
40
|
-
avatarColor: '#0284c7',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'nurse-1',
|
|
44
|
-
type: 'person',
|
|
45
|
-
name: 'Hemşire Burak — Triyaj Uzmanı',
|
|
46
|
-
role: 'Hasta Karşılama & Vital İzlem',
|
|
47
|
-
department: 'Acil',
|
|
48
|
-
zoneId: 'triage_er',
|
|
49
|
-
status: 'idle',
|
|
50
|
-
pinNumber: 2,
|
|
51
|
-
position: [-8, 0, 0],
|
|
52
|
-
avatarColor: '#059669',
|
|
53
|
-
},
|
|
29
|
+
export const HOSPITAL_SLOTS: WorldSlot[] = [
|
|
30
|
+
{ id: 'slot-1', label: 'Triage station', position: [-8, 0, 0], zoneId: 'triage_er', pinNumber: 1, avatarColor: '#059669' },
|
|
31
|
+
{ id: 'slot-2', label: 'Consultation room station', position: [4, 0, -4], zoneId: 'consultation', pinNumber: 2, avatarColor: '#0284c7' },
|
|
54
32
|
]
|
|
55
33
|
|
|
34
|
+
|
|
56
35
|
export const hospitalPreset: WorldPreset = {
|
|
57
36
|
id: 'preset-hospital',
|
|
58
37
|
name: 'Smart Healthcare & Hospital Medical Center',
|
|
@@ -85,7 +64,7 @@ export const hospitalPreset: WorldPreset = {
|
|
|
85
64
|
backgroundColor: '#042f2e',
|
|
86
65
|
},
|
|
87
66
|
zones: DEFAULT_HOSPITAL_ZONES,
|
|
88
|
-
|
|
67
|
+
slots: HOSPITAL_SLOTS,
|
|
89
68
|
|
|
90
69
|
buildScene: (scene: THREE.Scene, options) => {
|
|
91
70
|
const materials = new MaterialPalette()
|