@umituz/web-virtual 1.0.5 → 1.1.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.
Files changed (31) hide show
  1. package/assets/ASSET_CREDITS.md +45 -0
  2. package/assets/models/characters/character-female-a.glb +0 -0
  3. package/assets/models/characters/character-female-b.glb +0 -0
  4. package/assets/models/characters/character-male-a.glb +0 -0
  5. package/assets/models/characters/character-male-b.glb +0 -0
  6. package/assets/models/decor/lampRoundFloor.glb +0 -0
  7. package/assets/models/decor/plantSmall1.glb +0 -0
  8. package/assets/models/decor/pottedPlant.glb +0 -0
  9. package/assets/models/decor/trashcan.glb +0 -0
  10. package/assets/models/equipment/computerKeyboard.glb +0 -0
  11. package/assets/models/equipment/computerMouse.glb +0 -0
  12. package/assets/models/equipment/computerScreen.glb +0 -0
  13. package/assets/models/equipment/laptop.glb +0 -0
  14. package/assets/models/furniture/bookcaseOpen.glb +0 -0
  15. package/assets/models/furniture/chairDesk.glb +0 -0
  16. package/assets/models/furniture/desk.glb +0 -0
  17. package/assets/models/furniture/deskCorner.glb +0 -0
  18. package/assets/models/furniture/loungeChair.glb +0 -0
  19. package/assets/models/furniture/loungeSofa.glb +0 -0
  20. package/assets/models/furniture/table.glb +0 -0
  21. package/assets/models/furniture/tableCoffee.glb +0 -0
  22. package/package.json +2 -1
  23. package/src/components/EntityPins.tsx +0 -1
  24. package/src/engine/assetCatalog.test.ts +29 -0
  25. package/src/engine/assetCatalog.ts +222 -0
  26. package/src/engine/index.ts +2 -0
  27. package/src/engine/modelLoader.ts +126 -0
  28. package/src/entities/furniture/DeskBuilder.ts +197 -201
  29. package/src/entities/people/AvatarBuilder.ts +150 -208
  30. package/src/entities/props/PlantBuilder.ts +33 -36
  31. package/src/presets/officePreset.ts +37 -0
@@ -1,6 +1,7 @@
1
1
  import * as THREE from 'three'
2
2
  import type { WorldEntity } from '../../core/types'
3
3
  import type { MaterialPalette } from '../../engine/materials'
4
+ import { ModelLoader } from '../../engine/modelLoader'
4
5
 
5
6
  export interface CreatedAvatar {
6
7
  group: THREE.Group
@@ -21,15 +22,10 @@ export function createStylizedAvatar(
21
22
  : parseInt(String(entity.pinNumber || '1'), 10) || 1
22
23
  const seed = (pinNum * 2.39996) + ((entity.id.charCodeAt(0) || 1) * 0.15)
23
24
 
24
- // Material selection
25
- const skinMat = materials.getSkinMaterial()
26
- const hairMat = materials.getHairMaterial(entity.avatarHair || '#1e1b4b')
27
- const clothesMat = materials.getClothingMaterial(entity.avatarColor || '#2563eb')
28
- const pantsMat = materials.getDarkSlate('#1e293b')
25
+ // Status Material
29
26
  const statusMat = materials.getStatusGlow(entity.status || 'idle')
30
27
 
31
- // Seated offset relative to workstation center (chair seat is at z = +0.45)
32
- // For executive desk (slot-1), chair is at z = +0.65
28
+ // Seated offset relative to workstation center (chair seat is at z = +0.44)
33
29
  const isExecutive = entity.id === 'slot-1' || entity.zoneId === 'executive'
34
30
  const seatZ = isExecutive ? 0.62 : 0.44
35
31
 
@@ -46,172 +42,121 @@ export function createStylizedAvatar(
46
42
  clickProxy.userData = { entityId: entity.id }
47
43
  avatarRoot.add(clickProxy)
48
44
 
49
- // 2. Seated Thighs & Lower Legs in Dark Slacks
50
- const thighsGeo = new THREE.BoxGeometry(0.36, 0.12, 0.38)
51
- const thighs = new THREE.Mesh(thighsGeo, pantsMat)
45
+ // 2. Real 3D Model Container
46
+ const modelsContainer = new THREE.Group()
47
+ modelsContainer.name = `character-real-${entity.id}`
48
+ avatarRoot.add(modelsContainer)
49
+
50
+ // Bone node references for procedural animation
51
+ let realHead: THREE.Object3D | null = null
52
+ let realTorso: THREE.Object3D | null = null
53
+ let realLeftArm: THREE.Object3D | null = null
54
+ let realRightArm: THREE.Object3D | null = null
55
+
56
+ // 3. Fallback Placeholder Geometry (shown while 3D GLB model loads)
57
+ const placeholderGroup = new THREE.Group()
58
+ placeholderGroup.name = 'character-placeholder'
59
+
60
+ const skinMat = materials.getSkinMaterial()
61
+ const hairMat = materials.getHairMaterial(entity.avatarHair || '#1e1b4b')
62
+ const clothesMat = materials.getClothingMaterial(entity.avatarColor || '#2563eb')
63
+ const pantsMat = materials.getDarkSlate('#1e293b')
64
+
65
+ const thighs = new THREE.Mesh(new THREE.BoxGeometry(0.36, 0.12, 0.38), pantsMat)
52
66
  thighs.position.set(0, 0.48, -0.16)
53
67
  thighs.userData = { entityId: entity.id }
54
- avatarRoot.add(thighs)
55
-
56
- const leftShin = new THREE.Mesh(new THREE.BoxGeometry(0.12, 0.38, 0.12), pantsMat)
57
- leftShin.position.set(-0.11, 0.22, -0.32)
58
- leftShin.userData = { entityId: entity.id }
59
- avatarRoot.add(leftShin)
60
-
61
- const rightShin = leftShin.clone()
62
- rightShin.position.x = 0.11
63
- avatarRoot.add(rightShin)
64
-
65
- // 3. Pelvis / Hips
66
- const hipsGeo = new THREE.BoxGeometry(0.38, 0.14, 0.26)
67
- const hips = new THREE.Mesh(hipsGeo, pantsMat)
68
- hips.position.set(0, 0.52, 0)
69
- hips.userData = { entityId: entity.id }
70
- avatarRoot.add(hips)
71
-
72
- // 4. Upper Torso / Tailored Polo or Shirt
73
- const torsoGroup = new THREE.Group()
74
- torsoGroup.position.set(0, 0.6, 0)
75
- avatarRoot.add(torsoGroup)
76
-
77
- const torsoGeo = new THREE.CylinderGeometry(0.20, 0.17, 0.44, 12)
78
- const torso = new THREE.Mesh(torsoGeo, clothesMat)
79
- torso.position.set(0, 0.22, 0)
80
- torso.castShadow = true
81
- torso.userData = { entityId: entity.id }
82
- torsoGroup.add(torso)
83
-
84
- // Collar / neckline detail
85
- const collarGeo = new THREE.CylinderGeometry(0.13, 0.14, 0.06, 10)
86
- const collar = new THREE.Mesh(collarGeo, clothesMat)
87
- collar.position.set(0, 0.44, 0)
88
- collar.userData = { entityId: entity.id }
89
- torsoGroup.add(collar)
90
-
91
- // 5. Neck & Sculpted Head
92
- const neckGeo = new THREE.CylinderGeometry(0.065, 0.075, 0.1, 10)
93
- const neck = new THREE.Mesh(neckGeo, skinMat)
94
- neck.position.set(0, 0.5, 0)
95
- neck.userData = { entityId: entity.id }
96
- torsoGroup.add(neck)
97
-
98
- const headGroup = new THREE.Group()
99
- headGroup.position.set(0, 0.66, 0)
100
- torsoGroup.add(headGroup)
101
-
102
- const headGeo = new THREE.SphereGeometry(0.17, 18, 18)
103
- const head = new THREE.Mesh(headGeo, skinMat)
104
- head.castShadow = true
105
- head.userData = { entityId: entity.id }
106
- headGroup.add(head)
107
-
108
- // Nose & stylized face profile hint
109
- const noseGeo = new THREE.ConeGeometry(0.03, 0.06, 6)
110
- const nose = new THREE.Mesh(noseGeo, skinMat)
111
- nose.position.set(0, 0, -0.175)
112
- nose.rotation.x = -Math.PI / 2
113
- headGroup.add(nose)
114
-
115
- // 6. Stylized Hair (3 distinct styles for visual diversity)
116
- const hairStyle = pinNum % 3
117
- if (hairStyle === 0) {
118
- // Executive side-part / neat crop
119
- const hairCropGeo = new THREE.SphereGeometry(0.178, 14, 14, 0, Math.PI * 2, 0, Math.PI * 0.55)
120
- const hair = new THREE.Mesh(hairCropGeo, hairMat)
121
- hair.position.set(0, 0.03, 0)
122
- hair.rotation.x = -0.1
123
- headGroup.add(hair)
124
-
125
- // Side part sweep
126
- const sweepGeo = new THREE.BoxGeometry(0.18, 0.06, 0.12)
127
- const sweep = new THREE.Mesh(sweepGeo, hairMat)
128
- sweep.position.set(0.05, 0.14, -0.06)
129
- sweep.rotation.z = -0.15
130
- headGroup.add(sweep)
131
- } else if (hairStyle === 1) {
132
- // Textured fringe / pompadour
133
- const hairCapGeo = new THREE.SphereGeometry(0.18, 14, 14, 0, Math.PI * 2, 0, Math.PI * 0.52)
134
- const hairCap = new THREE.Mesh(hairCapGeo, hairMat)
135
- hairCap.position.set(0, 0.035, 0)
136
- headGroup.add(hairCap)
137
-
138
- const fringeGeo = new THREE.CylinderGeometry(0.14, 0.15, 0.08, 10)
139
- const fringe = new THREE.Mesh(fringeGeo, hairMat)
140
- fringe.position.set(0, 0.14, -0.05)
141
- fringe.rotation.x = -0.3
142
- headGroup.add(fringe)
143
- } else {
144
- // Elegant top bun / sleek bob
145
- const hairBobGeo = new THREE.SphereGeometry(0.182, 14, 14, 0, Math.PI * 2, 0, Math.PI * 0.6)
146
- const hairBob = new THREE.Mesh(hairBobGeo, hairMat)
147
- hairBob.position.set(0, 0.02, 0)
148
- headGroup.add(hairBob)
149
-
150
- const bunGeo = new THREE.SphereGeometry(0.08, 12, 12)
151
- const bun = new THREE.Mesh(bunGeo, hairMat)
152
- bun.position.set(0, 0.16, 0.12)
153
- headGroup.add(bun)
154
- }
68
+ placeholderGroup.add(thighs)
69
+
70
+ const torsoPlaceholder = new THREE.Group()
71
+ torsoPlaceholder.position.set(0, 0.6, 0)
72
+ placeholderGroup.add(torsoPlaceholder)
73
+
74
+ const torsoMesh = new THREE.Mesh(new THREE.CylinderGeometry(0.20, 0.17, 0.44, 12), clothesMat)
75
+ torsoMesh.position.set(0, 0.22, 0)
76
+ torsoMesh.castShadow = true
77
+ torsoMesh.userData = { entityId: entity.id }
78
+ torsoPlaceholder.add(torsoMesh)
79
+
80
+ const headMesh = new THREE.Mesh(new THREE.SphereGeometry(0.17, 16, 16), skinMat)
81
+ headMesh.position.set(0, 0.66, 0)
82
+ headMesh.castShadow = true
83
+ headMesh.userData = { entityId: entity.id }
84
+ torsoPlaceholder.add(headMesh)
85
+
86
+ const hairMesh = new THREE.Mesh(
87
+ new THREE.SphereGeometry(0.178, 14, 14, 0, Math.PI * 2, 0, Math.PI * 0.55),
88
+ hairMat,
89
+ )
90
+ hairMesh.position.set(0, 0.69, 0)
91
+ hairMesh.rotation.x = -0.1
92
+ torsoPlaceholder.add(hairMesh)
93
+
94
+ avatarRoot.add(placeholderGroup)
95
+
96
+ // 4. Select character model variety across 4 distinct models
97
+ const charModels = [
98
+ 'character:male-a',
99
+ 'character:female-a',
100
+ 'character:male-b',
101
+ 'character:female-b',
102
+ ]
103
+ const selectedCharId = charModels[pinNum % charModels.length] || 'character:male-a'
104
+
105
+ // Load Real 3D Character Model
106
+ const loader = ModelLoader.getInstance()
107
+ void loader.load(selectedCharId).then((charModel) => {
108
+ if (charModel) {
109
+ placeholderGroup.visible = false
110
+
111
+ // Scale and position character seated on chair
112
+ charModel.scale.set(1.65, 1.65, 1.65)
113
+ charModel.position.set(0, 0.44, -0.05)
114
+ charModel.traverse((node) => {
115
+ if (node instanceof THREE.Mesh) {
116
+ node.castShadow = true
117
+ node.receiveShadow = true
118
+ }
119
+ node.userData = { entityId: entity.id }
120
+ })
121
+
122
+ // Locate anatomical bone nodes
123
+ realHead = charModel.getObjectByName('head') || null
124
+ realTorso = charModel.getObjectByName('torso') || null
125
+ realLeftArm = charModel.getObjectByName('arm-left') || null
126
+ realRightArm = charModel.getObjectByName('arm-right') || null
127
+
128
+ const legLeft = charModel.getObjectByName('leg-left')
129
+ const legRight = charModel.getObjectByName('leg-right')
130
+
131
+ // Bend legs forward at 90 degrees into natural seated posture
132
+ if (legLeft) legLeft.rotation.x = -Math.PI / 2.2
133
+ if (legRight) legRight.rotation.x = -Math.PI / 2.2
134
+
135
+ // Position arms forward resting on desk
136
+ if (realLeftArm) {
137
+ realLeftArm.rotation.x = Math.PI / 2.6
138
+ realLeftArm.rotation.z = -0.15
139
+ }
140
+ if (realRightArm) {
141
+ realRightArm.rotation.x = Math.PI / 2.6
142
+ realRightArm.rotation.z = 0.15
143
+ }
155
144
 
156
- // 7. Articulated Left Arm (Shoulder -> Forearm -> Hand on Keyboard)
157
- const leftShoulder = new THREE.Group()
158
- leftShoulder.position.set(-0.21, 0.38, 0)
159
- torsoGroup.add(leftShoulder)
160
-
161
- const leftUpperArm = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.045, 0.26, 8), clothesMat)
162
- leftUpperArm.position.set(0, -0.12, -0.04)
163
- leftUpperArm.rotation.x = 0.35
164
- leftShoulder.add(leftUpperArm)
165
-
166
- const leftElbow = new THREE.Group()
167
- leftElbow.position.set(0, -0.24, -0.08)
168
- leftShoulder.add(leftElbow)
169
-
170
- const leftForearm = new THREE.Mesh(new THREE.CylinderGeometry(0.042, 0.038, 0.24, 8), clothesMat)
171
- leftForearm.position.set(0, 0.02, -0.12)
172
- leftForearm.rotation.x = -Math.PI / 2.3
173
- leftElbow.add(leftForearm)
174
-
175
- const leftHand = new THREE.Mesh(new THREE.SphereGeometry(0.04, 8, 8), skinMat)
176
- leftHand.position.set(0, 0.02, -0.24)
177
- leftHand.userData = { entityId: entity.id }
178
- leftElbow.add(leftHand)
179
-
180
- // 8. Articulated Right Arm (Shoulder -> Forearm -> Hand on Keyboard / Mouse)
181
- const rightShoulder = new THREE.Group()
182
- rightShoulder.position.set(0.21, 0.38, 0)
183
- torsoGroup.add(rightShoulder)
184
-
185
- const rightUpperArm = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.045, 0.26, 8), clothesMat)
186
- rightUpperArm.position.set(0, -0.12, -0.04)
187
- rightUpperArm.rotation.x = 0.35
188
- rightShoulder.add(rightUpperArm)
189
-
190
- const rightElbow = new THREE.Group()
191
- rightElbow.position.set(0, -0.24, -0.08)
192
- rightShoulder.add(rightElbow)
193
-
194
- const rightForearm = new THREE.Mesh(new THREE.CylinderGeometry(0.042, 0.038, 0.24, 8), clothesMat)
195
- rightForearm.position.set(0, 0.02, -0.12)
196
- rightForearm.rotation.x = -Math.PI / 2.3
197
- rightElbow.add(rightForearm)
198
-
199
- const rightHand = new THREE.Mesh(new THREE.SphereGeometry(0.04, 8, 8), skinMat)
200
- rightHand.position.set(0, 0.02, -0.24)
201
- rightHand.userData = { entityId: entity.id }
202
- rightElbow.add(rightHand)
203
-
204
- // 9. Floating Status Pin Indicator (Compact, elegant glow disk)
145
+ modelsContainer.add(charModel)
146
+ }
147
+ })
148
+
149
+ // 5. Floating Status Pin Indicator (Compact, elegant glow disk)
205
150
  const statusHalo = new THREE.Mesh(
206
151
  new THREE.RingGeometry(0.07, 0.11, 24),
207
152
  statusMat,
208
153
  )
209
- statusHalo.position.set(0, 1.05, 0)
154
+ statusHalo.position.set(0, 1.7, 0)
210
155
  statusHalo.rotation.x = -Math.PI / 2
211
156
  statusHalo.userData = { entityId: entity.id }
212
- headGroup.add(statusHalo)
157
+ avatarRoot.add(statusHalo)
213
158
 
214
- // 10. Realistic Procedural Animation Function
159
+ // 6. Realistic Procedural Animation Function
215
160
  const baseTorsoY = 0.6
216
161
  const isWorking = entity.status === 'running' || entity.status === 'working'
217
162
  const isAwaiting = entity.status === 'awaiting_approval'
@@ -219,62 +164,59 @@ export function createStylizedAvatar(
219
164
  const glanceFreq = 0.22 + ((seed * 3) % 0.15)
220
165
 
221
166
  const animate = (_delta: number, elapsed: number) => {
222
- // A. Natural Non-Synchronized Breathing (Multi-harmonic sine wave)
167
+ // Breathing cycle
223
168
  const breath = Math.sin(elapsed * breathFreq + seed) * 0.007
224
- + Math.sin(elapsed * (breathFreq * 0.5) + seed) * 0.003
225
- torsoGroup.position.y = baseTorsoY + breath
226
- torso.rotation.x = Math.sin(elapsed * breathFreq + seed) * 0.012
169
+ torsoPlaceholder.position.y = baseTorsoY + breath
170
+
171
+ if (realTorso) {
172
+ realTorso.position.y = breath * 0.5
173
+ realTorso.rotation.x = Math.sin(elapsed * breathFreq + seed) * 0.012
174
+ }
227
175
 
228
- // B. Natural Gaze / Head Turning Between Dual Monitors
229
- // Smooth transitions between center screen, secondary screen and keyboard
176
+ // Natural Gaze between dual monitors
230
177
  const glanceCycle = Math.sin(elapsed * glanceFreq + seed)
231
- const keyboardLook = Math.cos(elapsed * (glanceFreq * 1.7) + seed)
232
178
 
233
179
  if (isWorking) {
234
- // Focused worker shifts gaze between main display and side display
235
- headGroup.rotation.y = glanceCycle * 0.28
236
- headGroup.rotation.x = keyboardLook > 0.65 ? 0.14 : -0.04
237
- headGroup.rotation.z = 0
238
-
239
- // Active keystrokes (asymmetric micro-movements on forearms & hands)
240
- const typeLeft = Math.sin(elapsed * 13 + seed) * 0.035
241
- const typeRight = Math.cos(elapsed * 15 + seed) * 0.035
242
- leftElbow.rotation.x = typeLeft
243
- rightElbow.rotation.x = typeRight
244
-
245
- // Periodic shift of right hand to mouse (every ~7 seconds)
246
- const mouseCycle = Math.sin(elapsed * 0.9 + seed)
247
- if (mouseCycle > 0.3) {
248
- // Move right forearm slightly outward to mouse position
249
- rightShoulder.rotation.y = 0.18
250
- rightElbow.position.x = 0.08
251
- rightElbow.rotation.x = Math.sin(elapsed * 6) * 0.015 // mouse click micro-clicks
252
- } else {
253
- rightShoulder.rotation.y = 0
254
- rightElbow.position.x = 0
180
+ // Active working glances & typing
181
+ if (realHead) {
182
+ realHead.rotation.y = glanceCycle * 0.28
183
+ realHead.rotation.x = -0.04
184
+ }
185
+
186
+ if (realLeftArm) {
187
+ realLeftArm.rotation.x = Math.PI / 2.6 + Math.sin(elapsed * 12 + seed) * 0.03
188
+ }
189
+ if (realRightArm) {
190
+ const mouseCycle = Math.sin(elapsed * 0.9 + seed)
191
+ if (mouseCycle > 0.3) {
192
+ // Slide arm to mouse
193
+ realRightArm.rotation.x = Math.PI / 2.8
194
+ realRightArm.rotation.y = 0.18
195
+ } else {
196
+ // Typing on keyboard
197
+ realRightArm.rotation.x = Math.PI / 2.6 + Math.cos(elapsed * 14 + seed) * 0.03
198
+ realRightArm.rotation.y = 0
199
+ }
255
200
  }
256
201
 
257
- // Status indicator pulsing
258
202
  statusHalo.scale.setScalar(1 + Math.sin(elapsed * 3.5 + seed) * 0.15)
259
203
  } else if (isAwaiting) {
260
- // Thoughtful tilted posture waiting for approval
261
- headGroup.rotation.y = Math.sin(elapsed * 0.4 + seed) * 0.15
262
- headGroup.rotation.z = 0.12 // slight tilt
263
- headGroup.rotation.x = 0.05
264
- leftElbow.rotation.x = 0
265
- rightElbow.rotation.x = 0
266
- rightShoulder.rotation.y = 0
267
- rightElbow.position.x = 0
204
+ if (realHead) {
205
+ realHead.rotation.y = Math.sin(elapsed * 0.4 + seed) * 0.15
206
+ realHead.rotation.z = 0.12 // thoughtful tilt
207
+ }
268
208
  statusHalo.scale.setScalar(1 + Math.sin(elapsed * 2) * 0.2)
269
209
  } else {
270
- // Idle / ready posture: relaxed, occasional glances around
271
- headGroup.rotation.y = glanceCycle * 0.18
272
- headGroup.rotation.x = 0
273
- headGroup.rotation.z = 0
274
- leftElbow.rotation.x = 0
275
- rightElbow.rotation.x = 0
276
- rightShoulder.rotation.y = 0
277
- rightElbow.position.x = 0
210
+ // Idle
211
+ if (realHead) {
212
+ realHead.rotation.y = glanceCycle * 0.18
213
+ realHead.rotation.z = 0
214
+ }
215
+ if (realLeftArm) realLeftArm.rotation.x = Math.PI / 2.6
216
+ if (realRightArm) {
217
+ realRightArm.rotation.x = Math.PI / 2.6
218
+ realRightArm.rotation.y = 0
219
+ }
278
220
  statusHalo.scale.setScalar(1)
279
221
  }
280
222
  }
@@ -1,58 +1,55 @@
1
1
  import * as THREE from 'three'
2
2
  import type { MaterialPalette } from '../../engine/materials'
3
+ import { ModelLoader } from '../../engine/modelLoader'
3
4
 
4
5
  export function createFicusPlant(materials: MaterialPalette): THREE.Group {
5
6
  const group = new THREE.Group()
6
7
 
8
+ // Contact shadow under plant pot
9
+ const shadow = new THREE.Mesh(
10
+ new THREE.PlaneGeometry(0.7, 0.7),
11
+ materials.getContactShadowMaterial(),
12
+ )
13
+ shadow.rotation.x = -Math.PI / 2
14
+ shadow.position.set(0, 0.003, 0)
15
+ group.add(shadow)
16
+
17
+ const modelsContainer = new THREE.Group()
18
+ group.add(modelsContainer)
19
+
20
+ // Placeholder
21
+ const placeholder = new THREE.Group()
7
22
  const potMat = materials.getTerracottaPotMaterial()
8
23
  const leafMat = materials.getPlantLeavesMaterial()
9
24
  const trunkMat = materials.getExecutiveWoodMaterial()
10
25
 
11
- // Terracotta pot
12
26
  const potGeo = new THREE.CylinderGeometry(0.32, 0.22, 0.55, 16)
13
27
  const pot = new THREE.Mesh(potGeo, potMat)
14
28
  pot.position.set(0, 0.275, 0)
15
29
  pot.castShadow = true
16
- group.add(pot)
17
-
18
- // Soil
19
- const soilGeo = new THREE.CylinderGeometry(0.3, 0.3, 0.05, 16)
20
- const soilMat = materials.getDarkSlate('#26180b')
21
- const soil = new THREE.Mesh(soilGeo, soilMat)
22
- soil.position.set(0, 0.53, 0)
23
- group.add(soil)
30
+ placeholder.add(pot)
24
31
 
25
- // Trunks
26
32
  const t1 = new THREE.Mesh(new THREE.CylinderGeometry(0.04, 0.05, 1.2, 8), trunkMat)
27
33
  t1.position.set(0, 1.0, 0)
28
- t1.rotation.z = -0.08
29
- group.add(t1)
30
-
31
- const t2 = new THREE.Mesh(new THREE.CylinderGeometry(0.03, 0.04, 1.0, 8), trunkMat)
32
- t2.position.set(0.08, 0.9, 0.05)
33
- t2.rotation.z = 0.12
34
- group.add(t2)
35
-
36
- // Foliage clusters
37
- const leafClusterGeo = new THREE.DodecahedronGeometry(0.32, 1)
34
+ placeholder.add(t1)
38
35
 
39
- const cluster1 = new THREE.Mesh(leafClusterGeo, leafMat)
40
- cluster1.position.set(-0.1, 1.5, 0.05)
41
- cluster1.scale.set(1.2, 1.0, 1.1)
36
+ const cluster1 = new THREE.Mesh(new THREE.DodecahedronGeometry(0.38, 1), leafMat)
37
+ cluster1.position.set(0, 1.55, 0)
42
38
  cluster1.castShadow = true
43
- group.add(cluster1)
44
-
45
- const cluster2 = new THREE.Mesh(leafClusterGeo, leafMat)
46
- cluster2.position.set(0.18, 1.35, -0.08)
47
- cluster2.scale.set(1.0, 1.1, 1.0)
48
- cluster2.castShadow = true
49
- group.add(cluster2)
50
-
51
- const cluster3 = new THREE.Mesh(leafClusterGeo, leafMat)
52
- cluster3.position.set(0, 1.75, 0)
53
- cluster3.scale.set(0.9, 0.9, 0.9)
54
- cluster3.castShadow = true
55
- group.add(cluster3)
39
+ placeholder.add(cluster1)
40
+
41
+ group.add(placeholder)
42
+
43
+ // Real 3D Plant Model
44
+ const loader = ModelLoader.getInstance()
45
+ void loader.load('decor:pottedPlant').then((plantModel) => {
46
+ if (plantModel) {
47
+ placeholder.visible = false
48
+ plantModel.scale.set(1.4, 1.4, 1.4)
49
+ plantModel.position.set(0, 0, 0)
50
+ modelsContainer.add(plantModel)
51
+ }
52
+ })
56
53
 
57
54
  return group
58
55
  }
@@ -4,6 +4,7 @@ import { MaterialPalette } from '../engine/materials'
4
4
  import { buildOfficeArchitecture } from '../entities/architecture/OfficeArchitectureBuilder'
5
5
  import { createModernWorkstation, createExecutiveDesk, createConferenceTable } from '../entities/furniture/DeskBuilder'
6
6
  import { createFicusPlant } from '../entities/props/PlantBuilder'
7
+ import { ModelLoader } from '../engine/modelLoader'
7
8
 
8
9
  export const DEFAULT_OFFICE_ZONES: WorldZone[] = [
9
10
  {
@@ -480,5 +481,41 @@ export const officePreset: WorldPreset = {
480
481
  plant.position.set(coord[0], 0, coord[1])
481
482
  scene.add(plant)
482
483
  }
484
+
485
+ // 7. Executive Bookcases & Lounge Breakout Real 3D Models
486
+ const loader = ModelLoader.getInstance()
487
+ void loader.load('furniture:bookcaseOpen').then((bookcase) => {
488
+ if (bookcase) {
489
+ bookcase.scale.set(1.8, 1.8, 1.8)
490
+ bookcase.position.set(14.5, 0, -9.2)
491
+ scene.add(bookcase)
492
+ }
493
+ })
494
+
495
+ void loader.load('furniture:loungeSofa').then((sofa) => {
496
+ if (sofa) {
497
+ sofa.scale.set(1.5, 1.5, 1.5)
498
+ sofa.position.set(6.5, 0, -2.5)
499
+ sofa.rotation.y = Math.PI / 2
500
+ scene.add(sofa)
501
+ }
502
+ })
503
+
504
+ void loader.load('furniture:tableCoffee').then((coffeeTable) => {
505
+ if (coffeeTable) {
506
+ coffeeTable.scale.set(1.4, 1.4, 1.4)
507
+ coffeeTable.position.set(5.2, 0, -2.5)
508
+ scene.add(coffeeTable)
509
+ }
510
+ })
511
+
512
+ void loader.load('furniture:loungeChair').then((armchair) => {
513
+ if (armchair) {
514
+ armchair.scale.set(1.4, 1.4, 1.4)
515
+ armchair.position.set(5.2, 0, -1.2)
516
+ armchair.rotation.y = Math.PI
517
+ scene.add(armchair)
518
+ }
519
+ })
483
520
  },
484
521
  }