@@ -14,6 +14,7 @@ import {
14
14
} from "../../../systems/corridorSystem" ;
15
15
import { CORRIDOR_MAP } from "../../../systems/map/SeveranceCorridorMap.js" ;
16
16
import PerformanceArtLetterGenerator from '../performance/PerformanceArtLetterGenerator.js' ;
17
+ import { getAssetPath } from '../../../utils/assetPath.js' ;
17
18
18
19
19
20
const DOORWAY_WIDTH = 1.8 ; // Widened from 1.2 for a more spacious doorframe
@@ -242,7 +243,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
242
243
console . log ( "[Door Models] Loading door frame model..." ) ;
243
244
const doorFrameResult = await new Promise ( ( resolve , reject ) => {
244
245
this . gltfLoader . load (
245
- 'assets/models/door frame.glb' ,
246
+ getAssetPath ( 'assets/models/door frame.glb' ) ,
246
247
resolve ,
247
248
( progress ) => {
248
249
console . log ( `[Door Models] Frame loading progress: ${ Math . round ( progress . loaded / progress . total * 100 ) } %` ) ;
@@ -260,7 +261,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
260
261
console . log ( "[Door Models] Loading door pivot model..." ) ;
261
262
const doorPivotResult = await new Promise ( ( resolve , reject ) => {
262
263
this . gltfLoader . load (
263
- 'assets/models/door pivot.glb' ,
264
+ getAssetPath ( 'assets/models/door pivot.glb' ) ,
264
265
resolve ,
265
266
( progress ) => {
266
267
console . log ( `[Door Models] Pivot loading progress: ${ Math . round ( progress . loaded / progress . total * 100 ) } %` ) ;
@@ -278,7 +279,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
278
279
console . log ( "[Door Models] Loading card reader model..." ) ;
279
280
const cardReaderResult = await new Promise ( ( resolve , reject ) => {
280
281
this . gltfLoader . load (
281
- 'assets/models/card reader.glb' ,
282
+ getAssetPath ( 'assets/models/card reader.glb' ) ,
282
283
resolve ,
283
284
( progress ) => {
284
285
console . log ( `[Door Models] Card reader loading progress: ${ Math . round ( progress . loaded / progress . total * 100 ) } %` ) ;
@@ -432,10 +433,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
432
433
// Use material system to load vertex shader instead of inline definition
433
434
// This ensures we're following the project organization guidelines
434
435
vertexShader : await this . materialSystem . _loadShaderFile (
435
- "./src/shaders/common/vertex.txt"
436
+ getAssetPath ( "./src/shaders/common/vertex.txt" )
436
437
) ,
437
438
fragmentShader : await this . materialSystem . _loadShaderFile (
438
- "./src/shaders/wall.txt"
439
+ getAssetPath ( "./src/shaders/wall.txt" )
439
440
) ,
440
441
side : THREE . DoubleSide ,
441
442
} ) ;
@@ -483,10 +484,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
483
484
} ,
484
485
// Use material system to load vertex shader instead of inline definition
485
486
vertexShader : await this . materialSystem . _loadShaderFile (
486
- "./src/shaders/common/vertex.txt"
487
+ getAssetPath ( "./src/shaders/common/vertex.txt" )
487
488
) ,
488
489
fragmentShader : await this . materialSystem . _loadShaderFile (
489
- "./src/shaders/corridor.txt"
490
+ getAssetPath ( "./src/shaders/corridor.txt" )
490
491
) ,
491
492
transparent : true ,
492
493
blending : THREE . AdditiveBlending ,
@@ -1564,16 +1565,6 @@ export class SeveranceEnvironment extends BaseEnvironment {
1564
1565
return doorGroup ;
1565
1566
}
1566
1567
1567
- /**
1568
- * Set up department locations and access points - REMOVED/TO BE REPLACED
1569
- * @private
1570
- */
1571
- /*
1572
- setupDepartments() {
1573
- // ... Entire function content removed ...
1574
- }
1575
- */ // KEEPING THE FUNCTION SIGNATURE AS A REMINDER TO ADD PORTFOLIO SETUP LATER
1576
-
1577
1568
// --- Portfolio Section Configuration ---
1578
1569
portfolioSectionsConfig = {
1579
1570
DESIGN : {
@@ -2124,19 +2115,6 @@ export class SeveranceEnvironment extends BaseEnvironment {
2124
2115
getCurrentLocation ( ) {
2125
2116
if ( ! this . camera ) return "Unknown" ;
2126
2117
2127
- // Check if in any department - REMOVED departmentBounds check
2128
- /*
2129
- for (const [name, bounds] of this.departmentBounds) {
2130
- if (bounds.containsPoint(this.camera.position)) {
2131
- return name;
2132
- }
2133
- }
2134
- */
2135
-
2136
- // TODO: Implement logic to detect which portfolio section the player is in,
2137
- // potentially based on proximity to section entrances or defined zones.
2138
- // For now, just return "CORRIDOR".
2139
-
2140
2118
// If not in a department, must be in a corridor
2141
2119
return "CORRIDOR" ;
2142
2120
}
@@ -3299,22 +3277,6 @@ export class SeveranceEnvironment extends BaseEnvironment {
3299
3277
eButtonCanvas . width = 320 ; // Keep width
3300
3278
eButtonCanvas . height = 100 ; // Reduce height slightly
3301
3279
const eButtonCtx = eButtonCanvas . getContext ( '2d' ) ;
3302
- import * as THREE from "three" ;
3303
- import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js" ; // Added GLTFLoader import
3304
- import { TextureLoader } from "three" ; // Add TextureLoader import
3305
- import { BaseEnvironment } from "./BaseEnvironment" ;
3306
- import { MapSystem } from "../../../systems/map/MapSystem" ;
3307
- import { SeveranceMaterials } from "../materials/SeveranceMaterials" ;
3308
- import { UnifiedMovementController } from "../../../systems/movement/UnifiedMovementController" ;
3309
- import {
3310
- CorridorSystem ,
3311
- CORRIDOR_WIDTH ,
3312
- SEGMENT_LENGTH ,
3313
- CORRIDOR_HEIGHT ,
3314
- CORRIDOR_TRIM_HEIGHT ,
3315
- } from "../../../systems/corridorSystem" ;
3316
- import { CORRIDOR_MAP } from "../../../systems/map/SeveranceCorridorMap.js" ;
3317
- import PerformanceArtLetterGenerator from '../performance/PerformanceArtLetterGenerator.js' ;
3318
3280
3319
3281
3320
3282
const DOORWAY_WIDTH = 1.8 ; // Widened from 1.2 for a more spacious doorframe
@@ -3543,7 +3505,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
3543
3505
console . log ( "[Door Models] Loading door frame model..." ) ;
3544
3506
const doorFrameResult = await new Promise ( ( resolve , reject ) => {
3545
3507
this . gltfLoader . load (
3546
- 'assets/models/door frame.glb' ,
3508
+ getAssetPath ( 'assets/models/door frame.glb' ) ,
3547
3509
resolve ,
3548
3510
( progress ) => {
3549
3511
console . log ( `[Door Models] Frame loading progress: ${ Math . round ( progress . loaded / progress . total * 100 ) } %` ) ;
@@ -3561,7 +3523,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
3561
3523
console . log ( "[Door Models] Loading door pivot model..." ) ;
3562
3524
const doorPivotResult = await new Promise ( ( resolve , reject ) => {
3563
3525
this . gltfLoader . load (
3564
- 'assets/models/door pivot.glb' ,
3526
+ getAssetPath ( 'assets/models/door pivot.glb' ) ,
3565
3527
resolve ,
3566
3528
( progress ) => {
3567
3529
console . log ( `[Door Models] Pivot loading progress: ${ Math . round ( progress . loaded / progress . total * 100 ) } %` ) ;
@@ -3579,7 +3541,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
3579
3541
console . log ( "[Door Models] Loading card reader model..." ) ;
3580
3542
const cardReaderResult = await new Promise ( ( resolve , reject ) => {
3581
3543
this . gltfLoader . load (
3582
- 'assets/models/card reader.glb' ,
3544
+ getAssetPath ( 'assets/models/card reader.glb' ) ,
3583
3545
resolve ,
3584
3546
( progress ) => {
3585
3547
console . log ( `[Door Models] Card reader loading progress: ${ Math . round ( progress . loaded / progress . total * 100 ) } %` ) ;
@@ -3733,10 +3695,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
3733
3695
// Use material system to load vertex shader instead of inline definition
3734
3696
// This ensures we're following the project organization guidelines
3735
3697
vertexShader : await this . materialSystem . _loadShaderFile (
3736
- "./src/shaders/common/vertex.txt"
3698
+ getAssetPath ( "./src/shaders/common/vertex.txt" )
3737
3699
) ,
3738
3700
fragmentShader : await this . materialSystem . _loadShaderFile (
3739
- "./src/shaders/wall.txt"
3701
+ getAssetPath ( "./src/shaders/wall.txt" )
3740
3702
) ,
3741
3703
side : THREE . DoubleSide ,
3742
3704
} ) ;
@@ -3784,10 +3746,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
3784
3746
} ,
3785
3747
// Use material system to load vertex shader instead of inline definition
3786
3748
vertexShader : await this . materialSystem . _loadShaderFile (
3787
- "./src/shaders/common/vertex.txt"
3749
+ getAssetPath ( "./src/shaders/common/vertex.txt" )
3788
3750
) ,
3789
3751
fragmentShader : await this . materialSystem . _loadShaderFile (
3790
- "./src/shaders/corridor.txt"
3752
+ getAssetPath ( "./src/shaders/corridor.txt" )
3791
3753
) ,
3792
3754
transparent : true ,
3793
3755
blending : THREE . AdditiveBlending ,
@@ -5425,19 +5387,6 @@ export class SeveranceEnvironment extends BaseEnvironment {
5425
5387
getCurrentLocation ( ) {
5426
5388
if ( ! this . camera ) return "Unknown" ;
5427
5389
5428
- // Check if in any department - REMOVED departmentBounds check
5429
- /*
5430
- for (const [name, bounds] of this.departmentBounds) {
5431
- if (bounds.containsPoint(this.camera.position)) {
5432
- return name;
5433
- }
5434
- }
5435
- */
5436
-
5437
- // TODO: Implement logic to detect which portfolio section the player is in,
5438
- // potentially based on proximity to section entrances or defined zones.
5439
- // For now, just return "CORRIDOR".
5440
-
5441
5390
// If not in a department, must be in a corridor
5442
5391
return "CORRIDOR" ;
5443
5392
}
@@ -5466,21 +5415,6 @@ export class SeveranceEnvironment extends BaseEnvironment {
5466
5415
}
5467
5416
}
5468
5417
5469
- // Get department information - REMOVED departmentBounds check
5470
- /*
5471
- for (const [deptName, bounds] of this.departmentBounds) {
5472
- if (bounds.containsPoint(position)) {
5473
- return {
5474
- department: deptName.toLowerCase(),
5475
- position: position.clone(),
5476
- };
5477
- }
5478
- }
5479
- */
5480
-
5481
- // TODO: Adapt this to return portfolio section info later.
5482
- // For now, it primarily returns corridor info based on segments.
5483
-
5484
5418
// Return corridor segment info if found
5485
5419
if ( closestSegment ) {
5486
5420
const segmentId = closestSegment . id ;
@@ -5550,12 +5484,9 @@ export class SeveranceEnvironment extends BaseEnvironment {
5550
5484
this . systems . clear ( ) ;
5551
5485
this . doors . clear ( ) ;
5552
5486
this . interactiveObjects . clear ( ) ;
5553
- // REMOVED: this.departmentBounds.clear();
5554
5487
this . corridorSegments . clear ( ) ;
5555
5488
this . wayfinding . clear ( ) ; // Clear wayfinding elements
5556
5489
5557
- // Don't dispose movement controller here as it's managed by main.js
5558
-
5559
5490
// Clear global references
5560
5491
window . doorLocations = [ ] ;
5561
5492
}
@@ -6717,22 +6648,22 @@ export class SeveranceEnvironment extends BaseEnvironment {
6717
6648
6718
6649
// Load chair.gltf
6719
6650
const chairGltf = await new Promise ( ( resolve , reject ) => {
6720
- loader . load ( '/chair.glb' , resolve , undefined , reject ) ;
6651
+ loader . load ( getAssetPath ( '/chair.glb' ) , resolve , undefined , reject ) ;
6721
6652
} ) ;
6722
6653
// Load lamp.gltf
6723
6654
const lampGltf = await new Promise ( ( resolve , reject ) => {
6724
- loader . load ( '/lamp.glb' , resolve , undefined , reject ) ;
6655
+ loader . load ( getAssetPath ( '/lamp.glb' ) , resolve , undefined , reject ) ;
6725
6656
} ) ;
6726
6657
// Load projector.glb
6727
6658
const projectorGltf = await new Promise ( ( resolve , reject ) => {
6728
- loader . load ( '/projector.glb' , resolve , undefined , reject ) ;
6659
+ loader . load ( getAssetPath ( '/projector.glb' ) , resolve , undefined , reject ) ;
6729
6660
} ) ;
6730
6661
const projectorScreenGltf = await new Promise ( ( resolve , reject ) => {
6731
- loader . load ( '/projector_screen.glb' , resolve , undefined , reject ) ;
6662
+ loader . load ( getAssetPath ( '/projector_screen.glb' ) , resolve , undefined , reject ) ;
6732
6663
} ) ;
6733
6664
6734
6665
// Load poster textures
6735
- const poster1Texture = await textureLoader . loadAsync ( '/assets/textures/posters/poster1.jpg' ) ;
6666
+ const poster1Texture = await textureLoader . loadAsync ( getAssetPath ( '/assets/textures/posters/poster1.jpg' ) ) ;
6736
6667
// const poster2Texture = await textureLoader.loadAsync('/assets/textures/posters/Severance_Photo_0201.jpg');
6737
6668
6738
6669
const chairMesh = chairGltf . scene ;
@@ -7148,7 +7079,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
7148
7079
) ;
7149
7080
// Load all still textures asynchronously
7150
7081
const stillTextures = await Promise . all (
7151
- stillFilenames . map ( filename => textureLoader . loadAsync ( stillBasePath + filename ) )
7082
+ stillFilenames . map ( filename => textureLoader . loadAsync ( getAssetPath ( stillBasePath + filename ) ) )
7152
7083
) ;
7153
7084
const collage = createFramedCollage ( stillTextures , collagePosition , stillRotation ) ;
7154
7085
interiorGroup . add ( collage ) ;
@@ -7217,7 +7148,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
7217
7148
7218
7149
// Load all favorite film textures
7219
7150
const favoriteFilmTextures = await Promise . all (
7220
- favoriteFilms . map ( film => textureLoader . loadAsync ( `/assets/images/film/favorite films/${ film . filename } ` ) )
7151
+ favoriteFilms . map ( film => textureLoader . loadAsync ( getAssetPath ( `/assets/images/film/favorite films/${ film . filename } ` ) ) )
7221
7152
) ;
7222
7153
7223
7154
// Define right wall position and rotation for gallery
@@ -7464,7 +7395,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
7464
7395
const textureLoader = new THREE . TextureLoader ( ) ;
7465
7396
7466
7397
// Create the appropriate path based on posterTitle
7467
- const basePath = `/assets/Images/performance/solo performances/${ posterTitle . toLowerCase ( ) } /` ;
7398
+ const basePath = getAssetPath ( `/assets/Images/performance/solo performances/${ posterTitle . toLowerCase ( ) } /` ) ;
7468
7399
console . log ( `Looking for images at path: ${ basePath } ` ) ;
7469
7400
7470
7401
for ( let i = 0 ; i < count ; i ++ ) {
@@ -7663,7 +7594,7 @@ export class SeveranceEnvironment extends BaseEnvironment {
7663
7594
console . log ( `Creating MDR interior at ${ center . x } , ${ center . z } ` ) ;
7664
7595
try {
7665
7596
const loader = new GLTFLoader ( ) ;
7666
- const gltf = await loader . loadAsync ( "/severance_tv_show_office.glb" ) ; // Path relative to public/
7597
+ const gltf = await loader . loadAsync ( getAssetPath ( "/severance_tv_show_office.glb" ) ) ; // Path relative to public/
7667
7598
const model = gltf . scene ;
7668
7599
7669
7600
// --- Material Override & Collision Setup --- (Simplified)
@@ -9119,7 +9050,7 @@ function createKrugerTextTexture(text, { width = 1024, height = 256, bgColor = '
9119
9050
// Helper function to get image paths for a given poster title
9120
9051
const getArtPosterImagePaths = ( title ) => {
9121
9052
// Path that matches the known directory structure
9122
- const correctBasePath = `/assets/Images/performance/solo performances/${ title . toLowerCase ( ) } /` ;
9053
+ const correctBasePath = getAssetPath ( `/assets/Images/performance/solo performances/${ title . toLowerCase ( ) } /` ) ;
9123
9054
const urls = [ ] ;
9124
9055
let count = 0 ;
9125
9056
0 commit comments