How shenzili/forbidden-city-3d works
Forbidden City 3D is a browser-based procedural 3D palace exploration experience. Visitors enter the rendered world, navigate on foot or teleport between destinations, inspect nearby-building records, and adjust the view and environment. The graph preserves the documented map, streaming, procedural architecture, art-review, material-inspection, and settings capabilities. Relationships are limited to excerpted imports/calls or README statements; several world-rendering and navigation internals are unsampled, so those links are documented rather than inferred from filenames.
Main entry points: App.tsx Application · GameHUD.tsx Exploration HUD · worldManifest.ts World Manifest · BuildingFactory.tsx Building Factory
Components 30
Experience
- Application
src/app/App.tsx - Game State
src/app/GameContext.tsx
World Data
- Palace World
src/world/ForbiddenCityWorld.tsx - World Manifest
src/data/worldManifest.ts - Region Streaming
src/streaming/RegionStreamer.tsx - Asset Lifecycle
src/streaming/AssetManager.ts - World Coordinates
src/world/WorldCoordinates.ts - Ambient Audio
src/world/AudioEnvironment.tsx
Navigation
- Player Controller
src/navigation/PlayerController.tsx - Collision Rules
src/navigation/CollisionSystem.ts - Avatar
src/navigation/Avatar.tsx - View Modes
src/navigation/ViewModeController.ts
Architecture
- Building Factory
src/architecture/BuildingFactory.tsx - Palace Buildings
src/architecture/PalaceBuilding.tsx - Gate Models
src/architecture/Gate.tsx - Roof System
src/architecture/RoofSystem.tsx - Hall Model
src/architecture/hero/HeroPalace.tsx - Facade Details
src/architecture/FacadeDetails.tsx - Instanced Parts
src/architecture/Instances.tsx - Surface Materials
src/architecture/materials.ts - Imperial Materials
src/hooks/useImperialMaterials.ts
Interface and Review
- Exploration HUD
src/components/GameHUD.tsx - Minimap
src/components/Minimap.tsx - Building Records
src/components/BuildingInfoPanel.tsx - Experience Settings
src/components/SettingsPanel.tsx - Art Review Mode
src/art/ArtReviewMode.ts - Review Cameras
src/art/reviewCameras.ts - Review Overlay
src/art/ArtReviewOverlay.tsx - Material Lab
src/art/MaterialLab.tsx
Other components
- Visitor
Connections 37
- Visitor → Application: enters
README.md - Application → Game State: provides state
src/app/App.tsx - Application → Region Streaming: wraps experience
src/app/App.tsx - Application → Palace World: renders
src/app/App.tsx - Application → Exploration HUD: renders
src/app/App.tsx - Application → Ambient Audio: renders
src/app/App.tsx - Application → Art Review Mode: selects review
src/app/App.tsx - Application → Review Overlay: renders
src/app/App.tsx - Application → Material Lab: opens lab
src/app/App.tsx - Region Streaming → World Manifest: reads regions
src/streaming/RegionStreamer.tsx - Region Streaming → Asset Lifecycle: acquires assets
src/streaming/RegionStreamer.tsx - World Manifest → World Coordinates: uses transforms
src/data/worldManifest.ts - Exploration HUD → Game State: reads controls
src/components/GameHUD.tsx - Exploration HUD → World Manifest: reads destinations
src/components/GameHUD.tsx - Exploration HUD → Minimap: renders
src/components/GameHUD.tsx - Exploration HUD → Building Records: renders
src/components/GameHUD.tsx - Exploration HUD → Experience Settings: renders
src/components/GameHUD.tsx - Exploration HUD → Player Controller: controls movement
README.md - Player Controller → Collision Rules: checks collisions
src/navigation/PlayerController.tsx - Player Controller → Avatar: renders
src/navigation/PlayerController.tsx - Game State → View Modes: types view mode
src/app/GameContext.tsx - Building Factory → World Manifest: reads buildings
src/architecture/BuildingFactory.tsx - Building Factory → Palace Buildings: creates
src/architecture/BuildingFactory.tsx - Building Factory → Gate Models: creates
src/architecture/BuildingFactory.tsx - Building Factory → Hall Model: creates focal model
src/architecture/BuildingFactory.tsx - Palace Buildings → Roof System: uses roofs
src/architecture/PalaceBuilding.tsx - Gate Models → Roof System: uses roofs
src/architecture/Gate.tsx - Gate Models → Facade Details: uses details
src/architecture/Gate.tsx - Hall Model → Instanced Parts: uses parts
src/architecture/hero/HeroPalace.tsx - Palace Buildings → Instanced Parts: uses parts
src/architecture/PalaceBuilding.tsx - Roof System → Surface Materials: uses materials
src/architecture/RoofSystem.tsx - Hall Model → Surface Materials: uses materials
src/architecture/hero/HeroPalace.tsx - Material Lab → Imperial Materials: loads materials
src/art/MaterialLab.tsx - Imperial Materials → Surface Materials: configures
src/hooks/useImperialMaterials.ts - Art Review Mode → Review Cameras: selects preset
src/art/ArtReviewMode.ts - Review Cameras → World Manifest: anchors cameras
src/art/reviewCameras.ts - Review Overlay → Art Review Mode: reads preset
src/art/ArtReviewOverlay.tsx