@umituz/web-virtual 1.2.0 → 2.0.1

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.
@@ -2,6 +2,32 @@ import * as THREE from 'three'
2
2
  import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'
3
3
  import { ASSET_CATALOG, type AssetMetadata } from './assetCatalog'
4
4
 
5
+ /**
6
+ * Rebind skinned meshes in a cloned hierarchy to the clone's own bones.
7
+ *
8
+ * `Object3D.clone()` copies the hierarchy, but cloned `SkinnedMesh`es keep
9
+ * referencing the ORIGINAL skeleton's bones. With several clones in a scene
10
+ * every instance deforms against the source's (frozen) bone matrices —
11
+ * all but one render at the wrong transform or not at all. Rebinding each
12
+ * clone to the same-named bones inside its own hierarchy makes every
13
+ * instance render (and animate) independently.
14
+ */
15
+ export function rebindSkinnedSkeletons(cloned: THREE.Object3D): void {
16
+ cloned.traverse((node) => {
17
+ const skinned = node as THREE.SkinnedMesh
18
+ if (!skinned.isSkinnedMesh || !skinned.skeleton) return
19
+ const bones = skinned.skeleton.bones
20
+ .map((bone) => cloned.getObjectByName(bone.name))
21
+ .filter((b): b is THREE.Bone => !!b && (b as THREE.Bone).isBone === true)
22
+ // Only rebind when every joint maps to a bone inside this clone
23
+ if (bones.length !== skinned.skeleton.bones.length) return
24
+ skinned.bind(
25
+ new THREE.Skeleton(bones, skinned.skeleton.boneInverses),
26
+ skinned.bindMatrix,
27
+ )
28
+ })
29
+ }
30
+
5
31
  export class ModelLoader {
6
32
  private static instance: ModelLoader | null = null
7
33
  private loader: GLTFLoader
@@ -97,6 +123,9 @@ export class ModelLoader {
97
123
 
98
124
  private cloneGroup(source: THREE.Group, meta?: AssetMetadata): THREE.Group {
99
125
  const cloned = source.clone(true)
126
+ // Skinned meshes cannot share a skeleton across clones — rebind each
127
+ // clone to the bones inside its own hierarchy (see rebindSkinnedSkeletons).
128
+ rebindSkinnedSkeletons(cloned)
100
129
  if (meta && meta.defaultScale) {
101
130
  if (typeof meta.defaultScale === 'number') {
102
131
  cloned.scale.setScalar(meta.defaultScale)
@@ -1,5 +1,5 @@
1
1
  import * as THREE from 'three'
2
- import type { WorldPreset, WorldEntity, WorldZone } from '../core/types'
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[] = [
@@ -26,44 +26,13 @@ export const DEFAULT_FACTORY_ZONES: WorldZone[] = [
26
26
  },
27
27
  ]
28
28
 
29
- export const DEFAULT_FACTORY_ENTITIES: WorldEntity[] = [
30
- {
31
- id: 'factory-op-1',
32
- type: 'person',
33
- name: 'Serkan — Line Chief',
34
- role: 'Production flow supervisor',
35
- department: 'Manufacturing',
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: 'Robotic Arm RX-4',
46
- role: 'Precision welding & assembly',
47
- department: 'Robotics',
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 — Quality Engineer',
57
- role: 'Tolerance verification',
58
- department: 'Quality',
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
- defaultEntities: DEFAULT_FACTORY_ENTITIES,
69
+ slots: FACTORY_SLOTS,
101
70
 
102
71
  buildScene: (scene: THREE.Scene, options) => {
103
72
  const materials = new MaterialPalette()
@@ -1,5 +1,5 @@
1
1
  import * as THREE from 'three'
2
- import type { WorldPreset, WorldEntity, WorldZone } from '../core/types'
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[] = [
@@ -26,44 +26,13 @@ export const DEFAULT_FARM_ZONES: WorldZone[] = [
26
26
  },
27
27
  ]
28
28
 
29
- export const DEFAULT_FARM_ENTITIES: WorldEntity[] = [
30
- {
31
- id: 'farm-worker-1',
32
- type: 'person',
33
- name: 'Ahmet — Greenhouse Operator',
34
- role: 'Climate control & irrigation',
35
- department: 'Greenhouse Operations',
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: 'Autonomous Tractor Alpha',
46
- role: 'Plot plowing & crop dusting',
47
- department: 'Fleet Management',
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 — Harvest Supervisor',
57
- role: 'Packaging & storage',
58
- department: 'Logistics',
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
- defaultEntities: DEFAULT_FARM_ENTITIES,
72
+ slots: FARM_SLOTS,
104
73
 
105
74
  buildScene: (scene: THREE.Scene, options) => {
106
75
  const materials = new MaterialPalette()
@@ -1,5 +1,5 @@
1
1
  import * as THREE from 'three'
2
- import type { WorldPreset, WorldEntity, WorldZone } from '../core/types'
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[] = [
@@ -26,33 +26,12 @@ export const DEFAULT_HOSPITAL_ZONES: WorldZone[] = [
26
26
  },
27
27
  ]
28
28
 
29
- export const DEFAULT_HOSPITAL_ENTITIES: WorldEntity[] = [
30
- {
31
- id: 'doctor-1',
32
- type: 'person',
33
- name: 'Dr. Selin — Chief Physician',
34
- role: 'Clinical director & medical decisions',
35
- department: 'Surgery',
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: 'Nurse Burak — Triage Specialist',
46
- role: 'Patient intake & vitals monitoring',
47
- department: 'Emergency',
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
- defaultEntities: DEFAULT_HOSPITAL_ENTITIES,
67
+ slots: HOSPITAL_SLOTS,
89
68
 
90
69
  buildScene: (scene: THREE.Scene, options) => {
91
70
  const materials = new MaterialPalette()
@@ -1,5 +1,5 @@
1
1
  import * as THREE from 'three'
2
- import type { WorldPreset, WorldEntity, WorldZone } from '../core/types'
2
+ import type { WorldPreset, WorldSlot, WorldZone } from '../core/types'
3
3
  import { MaterialPalette } from '../engine/materials'
4
4
  import { buildOfficeArchitecture } from '../entities/architecture/OfficeArchitectureBuilder'
5
5
  import { createModernWorkstation, createExecutiveDesk, createConferenceTable } from '../entities/furniture/DeskBuilder'
@@ -51,310 +51,39 @@ export const DEFAULT_OFFICE_ZONES: WorldZone[] = [
51
51
  },
52
52
  ]
53
53
 
54
- export interface DepartmentInfo {
55
- id: string
56
- name: string
57
- slug: string
58
- description: string
59
- managerSlotId: string
60
- managerRole: string
61
- color: string
62
- slotIds: string[]
63
- iconName?: 'briefcase' | 'palette' | 'megaphone' | 'shield' | 'globe'
64
- }
54
+ type OfficeDeskKind = 'executive' | 'workstation' | 'meeting'
65
55
 
66
- export const DEFAULT_OFFICE_DEPARTMENTS: DepartmentInfo[] = [
67
- {
68
- id: 'dept-management',
69
- name: 'General Management & Strategy',
70
- slug: 'management',
71
- description: 'Company vision, department coordination, strategic planning and approval audits.',
72
- managerSlotId: 'slot-1',
73
- managerRole: 'Digital Agency Director (General Manager)',
74
- color: '#3b82f6',
75
- slotIds: ['slot-1', 'slot-13'],
76
- iconName: 'briefcase',
77
- },
78
- {
79
- id: 'dept-creative',
80
- name: 'Content & Creative Design',
81
- slug: 'creative',
82
- description: 'Social media content, visual concepts, ad hooks and viral video production.',
83
- managerSlotId: 'slot-3',
84
- managerRole: 'Creative Visual Director',
85
- color: '#a855f7',
86
- slotIds: ['slot-2', 'slot-3', 'slot-4', 'slot-5'],
87
- iconName: 'palette',
88
- },
89
- {
90
- id: 'dept-marketing',
91
- name: 'Marketing & Growth',
92
- slug: 'marketing',
93
- description: 'Google & Meta ads, organic SEO, email funnel automation and customer relationships (CRM).',
94
- managerSlotId: 'slot-6',
95
- managerRole: 'Performance Marketing & Media Buying',
96
- color: '#10b981',
97
- slotIds: ['slot-6', 'slot-7', 'slot-8', 'slot-9', 'slot-14'],
98
- iconName: 'megaphone',
99
- },
100
- {
101
- id: 'dept-tech',
102
- name: 'Technology, UI/UX & Data',
103
- slug: 'tech',
104
- description: 'Conversion-focused web interfaces, landing page wireframes and campaign growth analytics.',
105
- managerSlotId: 'slot-11',
106
- managerRole: 'UI/UX & Web Interface Designer',
107
- color: '#06b6d4',
108
- slotIds: ['slot-11', 'slot-12'],
109
- iconName: 'globe',
110
- },
111
- {
112
- id: 'dept-operations',
113
- name: 'Operations, Quality & Finance',
114
- slug: 'operations',
115
- description: 'Revenue/expense balance, budget control, quality assurance and the corporate knowledge archive.',
116
- managerSlotId: 'slot-10',
117
- managerRole: 'Agency Accountant & Finance Specialist',
118
- color: '#f59e0b',
119
- slotIds: ['slot-10', 'slot-15', 'slot-16', 'slot-17'],
120
- iconName: 'shield',
121
- },
122
- ]
123
-
124
- // 17 standard desk positions matching the reference architectural layout
125
- export const DEFAULT_OFFICE_ENTITIES: WorldEntity[] = [
126
- // 1. General Manager / Executive Suite
56
+ /**
57
+ * The 17 architectural anchor points of the office floorplan — the single
58
+ * source of truth for BOTH `buildScene` furniture placement and consumer
59
+ * entity auto-placement. Slots describe WHERE someone can sit, never WHO.
60
+ */
61
+ export const OFFICE_SLOTS: WorldSlot[] = [
127
62
  {
128
63
  id: 'slot-1',
129
- type: 'person',
130
- name: 'General Manager (CEO)',
131
- role: 'Company director & orchestrator',
132
- department: 'Management',
64
+ label: 'Executive desk',
65
+ position: [11, 0, -5.5],
133
66
  zoneId: 'executive',
134
- status: 'idle',
135
67
  pinNumber: 1,
136
- position: [11, 0, -5.5],
137
- rotation: [0, 0, 0],
138
68
  avatarColor: '#1e293b',
139
- avatarHair: '#0f172a',
140
- },
141
- // Row 1 (Creative & Ads)
142
- {
143
- id: 'slot-2',
144
- type: 'person',
145
- name: 'Performance Marketing Specialist',
146
- role: 'Ads & campaign optimization',
147
- department: 'Marketing',
148
- zoneId: 'growth',
149
- status: 'idle',
150
- pinNumber: 2,
151
- position: [-13, 0, -6.8],
152
- rotation: [0, 0, 0],
153
- avatarColor: '#0284c7',
154
- },
155
- {
156
- id: 'slot-3',
157
- type: 'person',
158
- name: 'Creative Director',
159
- role: 'Visual identity & design',
160
- department: 'Creative',
161
- zoneId: 'creative',
162
- status: 'idle',
163
- pinNumber: 3,
164
- position: [-9, 0, -6.8],
165
- rotation: [0, 0, 0],
166
- avatarColor: '#db2777',
167
- },
168
- {
169
- id: 'slot-4',
170
- type: 'person',
171
- name: 'Ads Manager',
172
- role: 'Budget & conversion strategy',
173
- department: 'Marketing',
174
- zoneId: 'growth',
175
- status: 'idle',
176
- pinNumber: 4,
177
- position: [-5, 0, -6.8],
178
- rotation: [0, 0, 0],
179
- avatarColor: '#2563eb',
180
- },
181
- {
182
- id: 'slot-5',
183
- type: 'person',
184
- name: 'Email Marketing Specialist',
185
- role: 'CRM & newsletter flows',
186
- department: 'Marketing',
187
- zoneId: 'growth',
188
- status: 'idle',
189
- pinNumber: 5,
190
- position: [-1, 0, -6.8],
191
- rotation: [0, 0, 0],
192
- avatarColor: '#7c3aed',
193
- },
194
-
195
- // Row 2 (Content, Video, Management)
196
- {
197
- id: 'slot-6',
198
- type: 'person',
199
- name: 'Social Media Manager',
200
- role: 'Community & content calendar',
201
- department: 'Creative',
202
- zoneId: 'creative',
203
- status: 'idle',
204
- pinNumber: 6,
205
- position: [-13, 0, -2.0],
206
- rotation: [0, 0, 0],
207
- avatarColor: '#ea580c',
208
- },
209
- {
210
- id: 'slot-7',
211
- type: 'person',
212
- name: 'Agency Operations Lead',
213
- role: 'Process & workflow tracking',
214
- department: 'Operations',
215
- zoneId: 'operations',
216
- status: 'idle',
217
- pinNumber: 7,
218
- position: [-9, 0, -2.0],
219
- rotation: [0, 0, 0],
220
- avatarColor: '#059669',
221
- },
222
- {
223
- id: 'slot-8',
224
- type: 'person',
225
- name: 'Video & Motion Producer',
226
- role: 'Reels, editing & animation',
227
- department: 'Creative',
228
- zoneId: 'creative',
229
- status: 'idle',
230
- pinNumber: 8,
231
- position: [-5, 0, -2.0],
232
- rotation: [0, 0, 0],
233
- avatarColor: '#dc2626',
234
- },
235
- {
236
- id: 'slot-9',
237
- type: 'person',
238
- name: 'Client Services Director',
239
- role: 'Team & client coordination',
240
- department: 'Management',
241
- zoneId: 'executive',
242
- status: 'idle',
243
- pinNumber: 9,
244
- position: [-1, 0, -2.0],
245
- rotation: [0, 0, 0],
246
- avatarColor: '#4f46e5',
247
- },
248
-
249
- // Row 3 (Copywriter, Research, SEO)
250
- {
251
- id: 'slot-10',
252
- type: 'person',
253
- name: 'Copywriter',
254
- role: 'Landing & ad copy',
255
- department: 'Creative',
256
- zoneId: 'creative',
257
- status: 'idle',
258
- pinNumber: 10,
259
- position: [-13, 0, 2.8],
260
- rotation: [0, 0, 0],
261
- avatarColor: '#0891b2',
262
- },
263
- {
264
- id: 'slot-11',
265
- type: 'person',
266
- name: 'Market Researcher',
267
- role: 'Competitor & trend analysis',
268
- department: 'Marketing',
269
- zoneId: 'growth',
270
- status: 'idle',
271
- pinNumber: 11,
272
- position: [-9, 0, 2.8],
273
- rotation: [0, 0, 0],
274
- avatarColor: '#16a34a',
275
- },
276
- {
277
- id: 'slot-12',
278
- type: 'person',
279
- name: 'Brand Strategist',
280
- role: 'Positioning & messaging',
281
- department: 'Management',
282
- zoneId: 'executive',
283
- status: 'idle',
284
- pinNumber: 12,
285
- position: [-5, 0, 2.8],
286
- rotation: [0, 0, 0],
287
- avatarColor: '#9333ea',
288
- },
289
- {
290
- id: 'slot-13',
291
- type: 'person',
292
- name: 'SEO & Organic Growth',
293
- role: 'Search engine & content distribution',
294
- department: 'Marketing',
295
- zoneId: 'growth',
296
- status: 'idle',
297
- pinNumber: 13,
298
- position: [-1, 0, 2.8],
299
- rotation: [0, 0, 0],
300
- avatarColor: '#0284c7',
301
- },
302
-
303
- // Front Hub (Art Direction & Design)
304
- {
305
- id: 'slot-14',
306
- type: 'person',
307
- name: 'Visual Designer (UI/UX)',
308
- role: 'Interface & web design',
309
- department: 'Technology',
310
- zoneId: 'tech',
311
- status: 'idle',
312
- pinNumber: 14,
313
- position: [-10, 0, 7.5],
314
- rotation: [0, 0, 0],
315
- avatarColor: '#e11d48',
316
- },
317
- {
318
- id: 'slot-15',
319
- type: 'person',
320
- name: 'Art Director (AI imagery)',
321
- role: 'AI visual artist',
322
- department: 'Creative',
323
- zoneId: 'creative',
324
- status: 'idle',
325
- pinNumber: 15,
326
- position: [-4, 0, 7.5],
327
- rotation: [0, 0, 0],
328
- avatarColor: '#475569',
329
- },
330
-
331
- // Meeting Room Desks / Client Relations
332
- {
333
- id: 'slot-16',
334
- type: 'person',
335
- name: 'Knowledge Librarian & QA',
336
- role: 'Process validation & documentation',
337
- department: 'Operations',
338
- zoneId: 'operations',
339
- status: 'idle',
340
- pinNumber: 16,
341
- position: [7.5, 0, 7.5],
342
- rotation: [0, -Math.PI / 4, 0],
343
- avatarColor: '#ca8a04',
344
- },
345
- {
346
- id: 'slot-17',
347
- type: 'person',
348
- name: 'Client Relations Lead',
349
- role: 'Onboarding & communication',
350
- department: 'Operations',
351
- zoneId: 'meeting',
352
- status: 'idle',
353
- pinNumber: 17,
354
- position: [13.5, 0, 7.5],
355
- rotation: [0, Math.PI / 4, 0],
356
- avatarColor: '#059669',
357
- },
69
+ metadata: { desk: 'executive' as OfficeDeskKind },
70
+ },
71
+ { id: 'slot-2', label: 'Workstation 2', position: [-13, 0, -6.8], zoneId: 'growth', pinNumber: 2, avatarColor: '#0284c7', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: false } },
72
+ { id: 'slot-3', label: 'Workstation 3', position: [-9, 0, -6.8], zoneId: 'creative', pinNumber: 3, avatarColor: '#db2777', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
73
+ { id: 'slot-4', label: 'Workstation 4', position: [-5, 0, -6.8], zoneId: 'growth', pinNumber: 4, avatarColor: '#2563eb', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: false } },
74
+ { id: 'slot-5', label: 'Workstation 5', position: [-1, 0, -6.8], zoneId: 'growth', pinNumber: 5, avatarColor: '#7c3aed', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
75
+ { id: 'slot-6', label: 'Workstation 6', position: [-13, 0, -2.0], zoneId: 'creative', pinNumber: 6, avatarColor: '#ea580c', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: false } },
76
+ { id: 'slot-7', label: 'Workstation 7', position: [-9, 0, -2.0], zoneId: 'operations', pinNumber: 7, avatarColor: '#059669', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
77
+ { id: 'slot-8', label: 'Workstation 8', position: [-5, 0, -2.0], zoneId: 'creative', pinNumber: 8, avatarColor: '#dc2626', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
78
+ { id: 'slot-9', label: 'Workstation 9', position: [-1, 0, -2.0], zoneId: 'executive', pinNumber: 9, avatarColor: '#4f46e5', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: false } },
79
+ { id: 'slot-10', label: 'Workstation 10', position: [-13, 0, 2.8], zoneId: 'creative', pinNumber: 10, avatarColor: '#0891b2', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: false } },
80
+ { id: 'slot-11', label: 'Workstation 11', position: [-9, 0, 2.8], zoneId: 'growth', pinNumber: 11, avatarColor: '#16a34a', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: false } },
81
+ { id: 'slot-12', label: 'Workstation 12', position: [-5, 0, 2.8], zoneId: 'executive', pinNumber: 12, avatarColor: '#9333ea', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
82
+ { id: 'slot-13', label: 'Workstation 13', position: [-1, 0, 2.8], zoneId: 'growth', pinNumber: 13, avatarColor: '#0284c7', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
83
+ { id: 'slot-14', label: 'Workstation 14', position: [-10, 0, 7.5], zoneId: 'tech', pinNumber: 14, avatarColor: '#e11d48', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
84
+ { id: 'slot-15', label: 'Workstation 15', position: [-4, 0, 7.5], zoneId: 'creative', pinNumber: 15, avatarColor: '#475569', metadata: { desk: 'workstation' as OfficeDeskKind, dualMonitor: true } },
85
+ { id: 'slot-16', label: 'Meeting room desk A', position: [7.5, 0, 7.5], rotation: [0, -Math.PI / 4, 0], zoneId: 'operations', pinNumber: 16, avatarColor: '#ca8a04', metadata: { desk: 'meeting' as OfficeDeskKind, dualMonitor: false } },
86
+ { id: 'slot-17', label: 'Meeting room desk B', position: [13.5, 0, 7.5], rotation: [0, Math.PI / 4, 0], zoneId: 'meeting', pinNumber: 17, avatarColor: '#059669', metadata: { desk: 'meeting' as OfficeDeskKind, dualMonitor: true } },
358
87
  ]
359
88
 
360
89
  export const officePreset: WorldPreset = {
@@ -404,7 +133,7 @@ export const officePreset: WorldPreset = {
404
133
  nightBackgroundColor: '#0f172a',
405
134
  },
406
135
  zones: DEFAULT_OFFICE_ZONES,
407
- defaultEntities: DEFAULT_OFFICE_ENTITIES,
136
+ slots: OFFICE_SLOTS,
408
137
 
409
138
  buildScene: (scene: THREE.Scene, options) => {
410
139
  const materials = new MaterialPalette()
@@ -417,56 +146,36 @@ export const officePreset: WorldPreset = {
417
146
  })
418
147
  scene.add(arch)
419
148
 
420
- // 2. Executive Suite Desk (Slot 1)
421
- const execDesk = createExecutiveDesk(materials, { entityId: 'slot-1' })
422
- execDesk.position.set(11, 0, -5.5)
423
- scene.add(execDesk)
424
-
425
- // 3. Conference Table in Meeting Room (Center of east parquet wing)
426
- const confTable = createConferenceTable(materials)
427
- confTable.position.set(11, 0, 2.5)
428
- scene.add(confTable)
429
-
430
- // 4. Meeting Room Desks (Slots 16 & 17)
431
- const desk16 = createModernWorkstation(materials, { entityId: 'slot-16', dualMonitor: false })
432
- desk16.position.set(7.5, 0, 7.5)
433
- desk16.rotation.y = -Math.PI / 4
434
- scene.add(desk16)
435
-
436
- const desk17 = createModernWorkstation(materials, { entityId: 'slot-17', dualMonitor: true })
437
- desk17.position.set(13.5, 0, 7.5)
438
- desk17.rotation.y = Math.PI / 4
439
- scene.add(desk17)
440
-
441
- // 5. Open Office Desks (Slots 2-15)
442
- const workstationSlots: Array<{ id: string; pos: [number, number, number]; dual: boolean }> = [
443
- { id: 'slot-2', pos: [-13, 0, -6.8], dual: false },
444
- { id: 'slot-3', pos: [-9, 0, -6.8], dual: true },
445
- { id: 'slot-4', pos: [-5, 0, -6.8], dual: false },
446
- { id: 'slot-5', pos: [-1, 0, -6.8], dual: true },
447
- { id: 'slot-6', pos: [-13, 0, -2.0], dual: false },
448
- { id: 'slot-7', pos: [-9, 0, -2.0], dual: true },
449
- { id: 'slot-8', pos: [-5, 0, -2.0], dual: true },
450
- { id: 'slot-9', pos: [-1, 0, -2.0], dual: false },
451
- { id: 'slot-10', pos: [-13, 0, 2.8], dual: false },
452
- { id: 'slot-11', pos: [-9, 0, 2.8], dual: false },
453
- { id: 'slot-12', pos: [-5, 0, 2.8], dual: true },
454
- { id: 'slot-13', pos: [-1, 0, 2.8], dual: true },
455
- { id: 'slot-14', pos: [-10, 0, 7.5], dual: true },
456
- { id: 'slot-15', pos: [-4, 0, 7.5], dual: true },
457
- ]
149
+ // 2. Desk furniture is generated from the architectural slot anchors —
150
+ // the same data consumer entities are auto-placed onto.
151
+ for (const slot of OFFICE_SLOTS) {
152
+ const kind = (slot.metadata?.desk as OfficeDeskKind) || 'workstation'
153
+ const dual = slot.metadata?.dualMonitor !== false
154
+
155
+ if (kind === 'executive') {
156
+ const desk = createExecutiveDesk(materials, { entityId: slot.id })
157
+ desk.position.set(slot.position[0], slot.position[1], slot.position[2])
158
+ if (slot.rotation) desk.rotation.set(slot.rotation[0], slot.rotation[1], slot.rotation[2])
159
+ scene.add(desk)
160
+ continue
161
+ }
458
162
 
459
- for (const ws of workstationSlots) {
460
163
  const desk = createModernWorkstation(materials, {
461
- entityId: ws.id,
462
- dualMonitor: ws.dual,
164
+ entityId: slot.id,
165
+ dualMonitor: dual,
463
166
  hasLaptop: true,
464
167
  })
465
- desk.position.set(ws.pos[0], ws.pos[1], ws.pos[2])
168
+ desk.position.set(slot.position[0], slot.position[1], slot.position[2])
169
+ if (slot.rotation) desk.rotation.set(slot.rotation[0], slot.rotation[1], slot.rotation[2])
466
170
  scene.add(desk)
467
171
  }
468
172
 
469
- // 6. Architectural Ficus Indoor Plants
173
+ // 3. Conference Table in Meeting Room (Center of east parquet wing)
174
+ const confTable = createConferenceTable(materials)
175
+ confTable.position.set(11, 0, 2.5)
176
+ scene.add(confTable)
177
+
178
+ // 4. Architectural Ficus Indoor Plants
470
179
  const plantCoords: [number, number][] = [
471
180
  [-17, -9],
472
181
  [-17, 9],
@@ -482,7 +191,7 @@ export const officePreset: WorldPreset = {
482
191
  scene.add(plant)
483
192
  }
484
193
 
485
- // 7. Executive Bookcases & Lounge Breakout Real 3D Models
194
+ // 5. Executive Bookcases & Lounge Breakout Real 3D Models
486
195
  const loader = ModelLoader.getInstance()
487
196
  void loader.load('furniture:bookcaseOpen').then((bookcase) => {
488
197
  if (bookcase) {