agentscape3d 1.0.0-beta.1 → 1.0.0-beta.2

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 (386) hide show
  1. package/README.md +23 -48
  2. package/dist/core.d.ts +68 -0
  3. package/dist/core.js +209 -0
  4. package/dist/core.js.map +1 -0
  5. package/dist/index.d.ts +10 -229
  6. package/dist/index.js +192 -15462
  7. package/dist/index.js.map +1 -1
  8. package/package.json +11 -40
  9. package/cli.mjs +0 -27
  10. package/dist/AssetCompiler-CDFiElji.js +0 -2451
  11. package/dist/AssetCompiler-CDFiElji.js.map +0 -1
  12. package/dist/AssetInputContracts-Dy8iU4eT.js +0 -228
  13. package/dist/AssetInputContracts-Dy8iU4eT.js.map +0 -1
  14. package/dist/AssetRecipe-DmFpzxr-.js +0 -55
  15. package/dist/AssetRecipe-DmFpzxr-.js.map +0 -1
  16. package/dist/BrowserCodeWorker.js +0 -53615
  17. package/dist/KinematicHypothesisScreen-D-z6qgMB.js +0 -242
  18. package/dist/KinematicHypothesisScreen-D-z6qgMB.js.map +0 -1
  19. package/dist/SceneSerializer-DPVOyeRk.js +0 -353
  20. package/dist/SceneSerializer-DPVOyeRk.js.map +0 -1
  21. package/dist/StylePack-DNrdLeGI.js +0 -6314
  22. package/dist/StylePack-DNrdLeGI.js.map +0 -1
  23. package/dist/WorldArchive-pSBIGxLa.js +0 -420
  24. package/dist/WorldArchive-pSBIGxLa.js.map +0 -1
  25. package/dist/WorldIO-wsDfZGM4.js +0 -150
  26. package/dist/WorldIO-wsDfZGM4.js.map +0 -1
  27. package/dist/blankWorld-CBWbwJGj.js +0 -76
  28. package/dist/blankWorld-CBWbwJGj.js.map +0 -1
  29. package/dist/disposeObject3D-BQ9TyVC_.js +0 -54
  30. package/dist/disposeObject3D-BQ9TyVC_.js.map +0 -1
  31. package/dist/environments-DgH66NqV.js +0 -4220
  32. package/dist/environments-DgH66NqV.js.map +0 -1
  33. package/dist/gltfIO-B87nJaat.js +0 -10
  34. package/dist/gltfIO-B87nJaat.js.map +0 -1
  35. package/dist/grandUrbanBlock-Ob9pN-CB.js +0 -516
  36. package/dist/grandUrbanBlock-Ob9pN-CB.js.map +0 -1
  37. package/dist/magicCabin-D64fD1E2.js +0 -11024
  38. package/dist/magicCabin-D64fD1E2.js.map +0 -1
  39. package/dist/mcp.d.ts +0 -2
  40. package/dist/mcp.js +0 -1
  41. package/dist/monumentHall-BKbs0UOQ.js +0 -404
  42. package/dist/monumentHall-BKbs0UOQ.js.map +0 -1
  43. package/dist/node.d.ts +0 -16
  44. package/dist/node.js +0 -25
  45. package/dist/ruinedCourtyard-BoZxHldu.js +0 -697
  46. package/dist/ruinedCourtyard-BoZxHldu.js.map +0 -1
  47. package/dist/runtime/application/AgentTools.js +0 -25
  48. package/dist/runtime/application/README.md +0 -14
  49. package/dist/runtime/application/buildTaskObservation.js +0 -117
  50. package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +0 -46
  51. package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +0 -35
  52. package/dist/runtime/application/code-execution/BrowserCodeWorker.js +0 -17
  53. package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +0 -72
  54. package/dist/runtime/application/createSession.js +0 -66
  55. package/dist/runtime/application/createWorldAuthoringContext.js +0 -400
  56. package/dist/runtime/application/generation/GenerationOrchestrator.js +0 -629
  57. package/dist/runtime/application/generation/GenerationRuntime.js +0 -214
  58. package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +0 -285
  59. package/dist/runtime/application/native-scene/CodeProject.js +0 -119
  60. package/dist/runtime/application/native-scene/CodeProjectModules.js +0 -128
  61. package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +0 -62
  62. package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +0 -127
  63. package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +0 -51
  64. package/dist/runtime/application/native-scene/NativeSceneHost.js +0 -164
  65. package/dist/runtime/application/native-scene/NativeSceneOverlay.js +0 -116
  66. package/dist/runtime/application/native-scene/NativeThreeModule.js +0 -16
  67. package/dist/runtime/application/object-forge/SceneObjectForge.js +0 -232
  68. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +0 -54
  69. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +0 -22
  70. package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +0 -40
  71. package/dist/runtime/application/scene/CapabilityResolver.js +0 -79
  72. package/dist/runtime/application/scene/RequestWindow.js +0 -54
  73. package/dist/runtime/application/scene/SceneAgentTools.js +0 -21
  74. package/dist/runtime/application/scene/SceneContracts.js +0 -45
  75. package/dist/runtime/application/scene/SceneEditService.js +0 -144
  76. package/dist/runtime/application/scene/SceneFacade.js +0 -267
  77. package/dist/runtime/application/scene/SceneInteractionAdapters.js +0 -40
  78. package/dist/runtime/application/scene/SceneJobController.js +0 -229
  79. package/dist/runtime/application/scene/ScenePackage.js +0 -162
  80. package/dist/runtime/application/scene/ScenePersistence.js +0 -50
  81. package/dist/runtime/application/scene/SceneProject.js +0 -95
  82. package/dist/runtime/application/scene/SceneSkillNames.js +0 -5
  83. package/dist/runtime/application/scene/StarterScene.js +0 -56
  84. package/dist/runtime/application/scene/WorldArchive.js +0 -87
  85. package/dist/runtime/application/scene/WorldDirectory.js +0 -20
  86. package/dist/runtime/application/scene/WorldDocument.js +0 -74
  87. package/dist/runtime/application/scene/WorldIO.js +0 -103
  88. package/dist/runtime/application/scene/WorldStorage.js +0 -137
  89. package/dist/runtime/application/skills/SkillRegistry.js +0 -163
  90. package/dist/runtime/application/skills/packs/acceptanceSkills.js +0 -32
  91. package/dist/runtime/application/skills/packs/affordanceSkills.js +0 -36
  92. package/dist/runtime/application/skills/packs/assetSkills.js +0 -46
  93. package/dist/runtime/application/skills/packs/authoringSkills.js +0 -16
  94. package/dist/runtime/application/skills/packs/batchSkills.js +0 -22
  95. package/dist/runtime/application/skills/packs/codeSkills.js +0 -106
  96. package/dist/runtime/application/skills/packs/generationSkills.js +0 -45
  97. package/dist/runtime/application/skills/packs/interactionSkills.js +0 -46
  98. package/dist/runtime/application/skills/packs/recoverySkills.js +0 -80
  99. package/dist/runtime/application/skills/packs/sceneSkills.js +0 -24
  100. package/dist/runtime/application/skills/packs/spatialSkills.js +0 -35
  101. package/dist/runtime/application/skills/packs/verificationSkills.js +0 -14
  102. package/dist/runtime/application/skills/packs/worldSkills.js +0 -45
  103. package/dist/runtime/application/skills/registerCoreSkills.js +0 -31
  104. package/dist/runtime/application/skills/skillPrimitives.js +0 -4
  105. package/dist/runtime/application/tasks/CabinetCupTask.js +0 -76
  106. package/dist/runtime/application/tasks.jsonl +0 -67
  107. package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +0 -42
  108. package/dist/runtime/application/world-authoring/AuthoringDiff.js +0 -149
  109. package/dist/runtime/application/world-authoring/AuthoringDocument.js +0 -825
  110. package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +0 -109
  111. package/dist/runtime/application/world-authoring/AuthoringIdentity.js +0 -17
  112. package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +0 -29
  113. package/dist/runtime/application/world-authoring/AuthoringPatch.js +0 -118
  114. package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +0 -334
  115. package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +0 -126
  116. package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +0 -144
  117. package/dist/runtime/application/world-authoring/HeadlessImageExport.js +0 -174
  118. package/dist/runtime/application/world-authoring/ModelRef.js +0 -62
  119. package/dist/runtime/apps/mcp-server/AUTHORING.md +0 -71
  120. package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +0 -1
  121. package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +0 -30
  122. package/dist/runtime/apps/mcp-server/BuildEnvironment.js +0 -17
  123. package/dist/runtime/apps/mcp-server/CodeExecutor.js +0 -71
  124. package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +0 -42
  125. package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +0 -66
  126. package/dist/runtime/apps/mcp-server/FileAssetRepository.js +0 -159
  127. package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +0 -8
  128. package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +0 -47
  129. package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +0 -132
  130. package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +0 -6
  131. package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +0 -116
  132. package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +0 -60
  133. package/dist/runtime/apps/mcp-server/README.md +0 -150
  134. package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +0 -1
  135. package/dist/runtime/apps/mcp-server/SandboxBundle.js +0 -13
  136. package/dist/runtime/apps/mcp-server/SessionManager.js +0 -80
  137. package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +0 -58
  138. package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +0 -190
  139. package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +0 -16
  140. package/dist/runtime/apps/mcp-server/VALIDATION.md +0 -45
  141. package/dist/runtime/apps/mcp-server/acceptance-evidence.json +0 -332
  142. package/dist/runtime/apps/mcp-server/errorDiagnostics.js +0 -32
  143. package/dist/runtime/apps/mcp-server/examples/code-house.js +0 -24
  144. package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +0 -37
  145. package/dist/runtime/apps/mcp-server/main.mjs +0 -56
  146. package/dist/runtime/apps/mcp-server/registerTools.js +0 -215
  147. package/dist/runtime/apps/mcp-server/sandbox/run.mjs +0 -23
  148. package/dist/runtime/apps/mcp-server/security.js +0 -21
  149. package/dist/runtime/apps/mcp-server/tasks.jsonl +0 -9
  150. package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +0 -157
  151. package/dist/runtime/apps/server/README.md +0 -7
  152. package/dist/runtime/apps/server/WorldDiskStorage.js +0 -51
  153. package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +0 -278
  154. package/dist/runtime/apps/server/tasks.jsonl +0 -10
  155. package/dist/runtime/foundation/EventBus.js +0 -18
  156. package/dist/runtime/foundation/JsonGateway.js +0 -47
  157. package/dist/runtime/foundation/PolicyEngine.js +0 -21
  158. package/dist/runtime/foundation/README.md +0 -7
  159. package/dist/runtime/foundation/TraceRecorder.js +0 -76
  160. package/dist/runtime/foundation/errors.js +0 -8
  161. package/dist/runtime/foundation/simulation/SimulationProfile.js +0 -143
  162. package/dist/runtime/foundation/version.js +0 -2
  163. package/dist/runtime/modules/agent/README.md +0 -11
  164. package/dist/runtime/modules/agent/ToolCallingAgent.js +0 -19
  165. package/dist/runtime/modules/agent/bootstrapWorld.js +0 -10
  166. package/dist/runtime/modules/agent/buildRecoveryProposals.js +0 -533
  167. package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +0 -127
  168. package/dist/runtime/modules/agent/execution/AgentRunResults.js +0 -55
  169. package/dist/runtime/modules/agent/execution/AgentRunSession.js +0 -390
  170. package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +0 -39
  171. package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +0 -19
  172. package/dist/runtime/modules/agent/prompt/index.js +0 -46
  173. package/dist/runtime/modules/agent/tasks.jsonl +0 -94
  174. package/dist/runtime/modules/artifact/ArtifactContentGate.js +0 -144
  175. package/dist/runtime/modules/artifact/ArtifactDescriptor.js +0 -280
  176. package/dist/runtime/modules/artifact/ArtifactImporter.js +0 -185
  177. package/dist/runtime/modules/artifact/ArtifactModule.js +0 -111
  178. package/dist/runtime/modules/artifact/ArtifactRegistry.js +0 -197
  179. package/dist/runtime/modules/artifact/IncrementalSha256.js +0 -129
  180. package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +0 -115
  181. package/dist/runtime/modules/artifact/README.md +0 -7
  182. package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +0 -67
  183. package/dist/runtime/modules/artifact/tasks.jsonl +0 -31
  184. package/dist/runtime/modules/asset/AssetModule.js +0 -399
  185. package/dist/runtime/modules/asset/README.md +0 -54
  186. package/dist/runtime/modules/asset/loading/AssetLoader.js +0 -157
  187. package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +0 -61
  188. package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +0 -95
  189. package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +0 -33
  190. package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +0 -103
  191. package/dist/runtime/modules/asset/model/AssetInputContracts.js +0 -95
  192. package/dist/runtime/modules/asset/model/AssetRef.js +0 -12
  193. package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +0 -172
  194. package/dist/runtime/modules/asset/model/admission.js +0 -117
  195. package/dist/runtime/modules/asset/model/errors.js +0 -6
  196. package/dist/runtime/modules/asset/model/parts.js +0 -27
  197. package/dist/runtime/modules/asset/model/resourceBudget.js +0 -10
  198. package/dist/runtime/modules/asset/model/schema.js +0 -150
  199. package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +0 -78
  200. package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +0 -84
  201. package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +0 -86
  202. package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +0 -81
  203. package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +0 -272
  204. package/dist/runtime/modules/asset/production/AssetRecipe.js +0 -32
  205. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +0 -45
  206. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +0 -590
  207. package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +0 -173
  208. package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +0 -124
  209. package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +0 -56
  210. package/dist/runtime/modules/asset/production/compiler/gltfIO.js +0 -6
  211. package/dist/runtime/modules/asset/production/compiler/partGeometry.js +0 -74
  212. package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +0 -63
  213. package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +0 -48
  214. package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +0 -16
  215. package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +0 -30
  216. package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +0 -75
  217. package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +0 -20
  218. package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +0 -34
  219. package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +0 -32
  220. package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +0 -116
  221. package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +0 -84
  222. package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +0 -63
  223. package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +0 -16
  224. package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +0 -23
  225. package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +0 -50
  226. package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +0 -60
  227. package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +0 -93
  228. package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +0 -32
  229. package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +0 -55
  230. package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +0 -203
  231. package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +0 -43
  232. package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +0 -33
  233. package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +0 -60
  234. package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +0 -23
  235. package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +0 -198
  236. package/dist/runtime/modules/asset/registry/AssetCatalog.js +0 -72
  237. package/dist/runtime/modules/asset/registry/AssetRegistry.js +0 -51
  238. package/dist/runtime/modules/asset/registry/manifests/index.js +0 -173
  239. package/dist/runtime/modules/asset/tasks.jsonl +0 -87
  240. package/dist/runtime/modules/generation/README.md +0 -9
  241. package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +0 -45
  242. package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +0 -169
  243. package/dist/runtime/modules/generation/connector/ConnectorClient.js +0 -192
  244. package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +0 -167
  245. package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +0 -179
  246. package/dist/runtime/modules/generation/connector/ConnectorSession.js +0 -202
  247. package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +0 -239
  248. package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +0 -99
  249. package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +0 -91
  250. package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +0 -50
  251. package/dist/runtime/modules/generation/providers/ProviderRegistry.js +0 -304
  252. package/dist/runtime/modules/generation/tasks.jsonl +0 -35
  253. package/dist/runtime/modules/navigation/NavigationBackend.js +0 -17
  254. package/dist/runtime/modules/navigation/RecastNavigationBackend.js +0 -245
  255. package/dist/runtime/modules/physics/JoltPhysicsBackend.js +0 -850
  256. package/dist/runtime/modules/physics/PhysicsApiSurface.js +0 -651
  257. package/dist/runtime/modules/physics/PhysicsBackend.js +0 -88
  258. package/dist/runtime/modules/physics/RapierPhysicsBackend.js +0 -410
  259. package/dist/runtime/modules/rendering/README.md +0 -7
  260. package/dist/runtime/modules/rendering/RendererProbe.js +0 -153
  261. package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +0 -140
  262. package/dist/runtime/modules/rendering/createRenderer.js +0 -76
  263. package/dist/runtime/modules/rendering/disposeObject3D.js +0 -34
  264. package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +0 -74
  265. package/dist/runtime/modules/rendering/style/StylePack.js +0 -34
  266. package/dist/runtime/modules/rendering/style/StyleSystem.js +0 -173
  267. package/dist/runtime/modules/rendering/tasks.jsonl +0 -7
  268. package/dist/runtime/modules/world/README.md +0 -13
  269. package/dist/runtime/modules/world/build/WorldBuilder.js +0 -170
  270. package/dist/runtime/modules/world/compiler/PipelineEngine.js +0 -32
  271. package/dist/runtime/modules/world/compiler/WorldAdmission.js +0 -43
  272. package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +0 -68
  273. package/dist/runtime/modules/world/compiler/WorldCompilation.js +0 -157
  274. package/dist/runtime/modules/world/compiler/WorldComposer.js +0 -201
  275. package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +0 -76
  276. package/dist/runtime/modules/world/compiler/WorldRecompiler.js +0 -356
  277. package/dist/runtime/modules/world/compiler/WorldRetry.js +0 -75
  278. package/dist/runtime/modules/world/compiler/createWorldPipeline.js +0 -379
  279. package/dist/runtime/modules/world/content/blankWorld.js +0 -35
  280. package/dist/runtime/modules/world/content/environments.js +0 -84
  281. package/dist/runtime/modules/world/content/grandUrbanBlock.js +0 -189
  282. package/dist/runtime/modules/world/content/magic-cabin/README.md +0 -28
  283. package/dist/runtime/modules/world/content/magic-cabin/affordances.js +0 -64
  284. package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +0 -7078
  285. package/dist/runtime/modules/world/content/magic-cabin/lighting.js +0 -26
  286. package/dist/runtime/modules/world/content/magic-cabin/materials.js +0 -20
  287. package/dist/runtime/modules/world/content/magicCabin.js +0 -190
  288. package/dist/runtime/modules/world/content/monumentHall.js +0 -154
  289. package/dist/runtime/modules/world/content/ruinedCourtyard.js +0 -196
  290. package/dist/runtime/modules/world/content/suzhouGarden/README.md +0 -141
  291. package/dist/runtime/modules/world/content/suzhouGarden/index.js +0 -137
  292. package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +0 -491
  293. package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +0 -670
  294. package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +0 -578
  295. package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +0 -127
  296. package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +0 -642
  297. package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +0 -650
  298. package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +0 -280
  299. package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +0 -242
  300. package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +0 -215
  301. package/dist/runtime/modules/world/content/woodlandWorkshop.js +0 -192
  302. package/dist/runtime/modules/world/content/yuanmingyuan/README.md +0 -36
  303. package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +0 -351
  304. package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +0 -490
  305. package/dist/runtime/modules/world/content/yuanmingyuan/core.js +0 -505
  306. package/dist/runtime/modules/world/content/yuanmingyuan/index.js +0 -101
  307. package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +0 -435
  308. package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +0 -169
  309. package/dist/runtime/modules/world/content/yuanmingyuan/water.js +0 -245
  310. package/dist/runtime/modules/world/errors.js +0 -9
  311. package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +0 -50
  312. package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +0 -297
  313. package/dist/runtime/modules/world/runtime/CommandHistory.js +0 -80
  314. package/dist/runtime/modules/world/runtime/ObjectStore.js +0 -31
  315. package/dist/runtime/modules/world/runtime/ObjectTransform.js +0 -62
  316. package/dist/runtime/modules/world/runtime/ObservedEntity.js +0 -37
  317. package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +0 -207
  318. package/dist/runtime/modules/world/runtime/SceneSerializer.js +0 -246
  319. package/dist/runtime/modules/world/runtime/WorldAuthority.js +0 -41
  320. package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +0 -14
  321. package/dist/runtime/modules/world/runtime/WorldCommands.js +0 -502
  322. package/dist/runtime/modules/world/runtime/WorldObservation.js +0 -71
  323. package/dist/runtime/modules/world/runtime/WorldQueries.js +0 -340
  324. package/dist/runtime/modules/world/runtime/WorldRecovery.js +0 -78
  325. package/dist/runtime/modules/world/runtime/WorldRuntime.js +0 -649
  326. package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +0 -107
  327. package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +0 -130
  328. package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +0 -79
  329. package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +0 -195
  330. package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +0 -70
  331. package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +0 -115
  332. package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +0 -216
  333. package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +0 -214
  334. package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +0 -65
  335. package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +0 -222
  336. package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +0 -130
  337. package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +0 -57
  338. package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +0 -123
  339. package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +0 -120
  340. package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +0 -102
  341. package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +0 -89
  342. package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +0 -99
  343. package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +0 -269
  344. package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +0 -56
  345. package/dist/runtime/modules/world/runtime/spatial/ThreeBvhRuntime.js +0 -36
  346. package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +0 -728
  347. package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +0 -269
  348. package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +0 -469
  349. package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +0 -1657
  350. package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +0 -457
  351. package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +0 -284
  352. package/dist/runtime/modules/world/spec/WorldIR.js +0 -165
  353. package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +0 -86
  354. package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +0 -51
  355. package/dist/runtime/modules/world/spec/WorldRevision.js +0 -231
  356. package/dist/runtime/modules/world/spec/WorldSpec.js +0 -86
  357. package/dist/runtime/modules/world/tasks.jsonl +0 -530
  358. package/dist/runtime/modules/world/verification/ArticulationVerifier.js +0 -254
  359. package/dist/runtime/modules/world/verification/Finding.js +0 -105
  360. package/dist/runtime/modules/world/verification/InteractionEvidence.js +0 -69
  361. package/dist/runtime/modules/world/verification/RepairEngine.js +0 -49
  362. package/dist/runtime/modules/world/verification/WorldAcceptance.js +0 -158
  363. package/dist/runtime/modules/world/verification/WorldValidator.js +0 -65
  364. package/dist/runtime/package-lock.json +0 -6245
  365. package/dist/runtime/package.json +0 -91
  366. package/dist/runtime/public/assets/cabinet.glb +0 -0
  367. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
  368. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
  369. package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
  370. package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
  371. package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
  372. package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
  373. package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
  374. package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
  375. package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
  376. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
  377. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
  378. package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
  379. package/dist/schema-Dudvovhu.js +0 -364
  380. package/dist/schema-Dudvovhu.js.map +0 -1
  381. package/dist/suzhouGarden-BCx_JeV5.js +0 -6159
  382. package/dist/suzhouGarden-BCx_JeV5.js.map +0 -1
  383. package/dist/woodlandWorkshop-BGNWPNdK.js +0 -484
  384. package/dist/woodlandWorkshop-BGNWPNdK.js.map +0 -1
  385. package/dist/yuanmingyuan-DAIb1msO.js +0 -4962
  386. package/dist/yuanmingyuan-DAIb1msO.js.map +0 -1
@@ -1,280 +0,0 @@
1
- /* 吴苑澄观 · 假山与叠石
2
- * 太湖石以「等值面孔洞 + 多频噪声皴纹」程序化生成,追求皱、漏、瘦、透;
3
- * 黄石以层理块体拼叠;含主峰群、洞壑、蹬道、峡谷、池岸石矶与庭园特置峰石。
4
- * 跌水 / 溪流的位置通过 ctx.waterfalls / ctx.streams 交给 water.js 生成水面。
5
- */
6
- import * as THREE from 'three';
7
- import {
8
- boxGeo, transform, tube, lathe, clamp, smooth, fbm, mulberry32, rr,
9
- WORLD, waterSDF, terrainHeight, POOLS, ISLES,
10
- } from './core.js';
11
- import { put } from './arch.js';
12
-
13
- /** 3D 近似噪声:以多组可平铺 2D fbm 组合出三向变化 */
14
- function n3(x, y, z, s) {
15
- return fbm(x + s * 0.13, y + s * 0.07, s, 3)
16
- * 0.5 + fbm(z + s * 0.21, y + s * 0.17, s + 71, 3) * 0.5;
17
- }
18
- function gyroid(x, y, z, f, phase) {
19
- const a = x * f + phase, b = y * f + phase * 0.7, c = z * f + phase * 1.3;
20
- return Math.sin(a) * Math.cos(b) + Math.sin(b) * Math.cos(c) + Math.sin(c) * Math.cos(a);
21
- }
22
-
23
- /** 生成一块太湖石:细分球面 + 噪声位移 + gyroid 孔洞筛选 */
24
- export function taihuGeo(seed, w, h, d, opts = {}) {
25
- const rnd = mulberry32(seed);
26
- const detail = opts.detail ?? 4;
27
- const base = new THREE.IcosahedronGeometry(1, detail);
28
- const src = base.index ? base.toNonIndexed() : base;
29
- const sp = src.getAttribute('position');
30
- const n = sp.count;
31
- const pos = new Float32Array(n * 3);
32
- const phase = rnd() * Math.PI * 2;
33
- const f = (opts.holeFreq ?? 2.5) / Math.min(w, h, d);
34
- const amp = opts.amp ?? 0.34;
35
- const pitF = opts.pitFreq ?? 2.7;
36
- for (let i = 0; i < n; i++) {
37
- const nx = sp.getX(i), ny = sp.getY(i), nz = sp.getZ(i);
38
- const q = n3(nx * 1.7 + seed * 0.01, ny * 1.7, nz * 1.7, seed % 997);
39
- const ridge = Math.sin(nx * 8.5 + phase) * Math.sin(ny * 7.1 - phase) * Math.sin(nz * 6.3 + phase);
40
- // gyroid 零等值面处形成深涡孔与沟壑,保持封闭实体(避免碎裂成三角片)
41
- const g = Math.abs(gyroid(nx * pitF, ny * pitF, nz * pitF, 1, phase));
42
- const pit = 1 - smooth(0.05, 0.46, g);
43
- const wrinkle = Math.sin(nx * 13.0 + phase) * Math.sin(ny * 11.0 - phase)
44
- * Math.sin(nz * 12.0 + phase * 0.6) * 0.07;
45
- const r = 1 + (q - 0.5) * amp * 2 + ridge * 0.10 + wrinkle - pit * 0.32;
46
- pos[i * 3] = nx * r * w * 0.5;
47
- pos[i * 3 + 1] = ny * r * h * 0.5;
48
- pos[i * 3 + 2] = nz * r * d * 0.5;
49
- }
50
- // 仅少量三角面被穿透,形成「漏、透」的零星孔洞,主体仍是完整石体
51
- const pierce = opts.pierce ?? 0.075;
52
- const keep = [];
53
- for (let i = 0; i < n; i += 3) {
54
- const cx = (pos[i * 3] + pos[(i + 1) * 3] + pos[(i + 2) * 3]) / 3;
55
- const cy = (pos[i * 3 + 1] + pos[(i + 1) * 3 + 1] + pos[(i + 2) * 3 + 1]) / 3;
56
- const cz = (pos[i * 3 + 2] + pos[(i + 1) * 3 + 2] + pos[(i + 2) * 3 + 2]) / 3;
57
- const g = Math.abs(gyroid(cx, cy, cz, f, phase));
58
- if (g > pierce || rnd() > 0.35) {
59
- for (let k = 0; k < 3; k++) {
60
- keep.push(pos[(i + k) * 3], pos[(i + k) * 3 + 1], pos[(i + k) * 3 + 2]);
61
- }
62
- }
63
- }
64
- const out = new THREE.BufferGeometry();
65
- const arr = new Float32Array(keep);
66
- out.setAttribute('position', new THREE.Float32BufferAttribute(arr, 3));
67
- const uv = new Float32Array((arr.length / 3) * 2);
68
- for (let i = 0; i < arr.length / 3; i++) {
69
- uv[i * 2] = arr[i * 3] * 0.34 + arr[i * 3 + 2] * 0.12;
70
- uv[i * 2 + 1] = arr[i * 3 + 1] * 0.34;
71
- }
72
- out.setAttribute('uv', new THREE.Float32BufferAttribute(uv, 2));
73
- out.computeVertexNormals();
74
- if (src !== base) src.dispose();
75
- base.dispose();
76
- return out;
77
- }
78
-
79
- /** 黄石层理块体 */
80
- export function huangshiGeo(seed, w, h, d) {
81
- const rnd = mulberry32(seed);
82
- const g = new THREE.BoxGeometry(w, h, d, 5, 5, 4).toNonIndexed();
83
- const p = g.getAttribute('position');
84
- const phase = rnd() * 6.28;
85
- for (let i = 0; i < p.count; i++) {
86
- const x = p.getX(i), y = p.getY(i), z = p.getZ(i);
87
- const layer = Math.sin(y * 5.2 + phase) * 0.055;
88
- const n = n3(x, y, z, seed % 331);
89
- p.setXYZ(i, x + (n - 0.5) * 0.16 + layer, y + (n - 0.5) * 0.08, z + (n - 0.5) * 0.16 - layer);
90
- }
91
- p.needsUpdate = true;
92
- const uv = g.getAttribute('uv');
93
- for (let i = 0; i < uv.count; i++) uv.setXY(i, uv.getX(i) * w * 0.32, uv.getY(i) * h * 0.32);
94
- g.computeVertexNormals();
95
- return g;
96
- }
97
-
98
- function stone(ctx, geo, mat, x, y, z, rot = [0, 0, 0], lod = 0) {
99
- put(ctx.B, geo, mat, [x, y, z], rot, lod);
100
- }
101
-
102
- /** 主峰群:(-62,-40) 一带,最高 9.6 m */
103
- function buildMainPeaks(ctx) {
104
- const { M } = ctx;
105
- const prog = ctx.onProgress || (() => {});
106
- const cx = -64, cz = -40;
107
- // 山体基底:以灰白湖石与条石层叠,避免大面积黄砂岩破坏江南山石灰调
108
- for (let i = 0; i < 12; i++) {
109
- const a = i * Math.PI * 2 / 12;
110
- const r = 12.4 + Math.sin(i * 2.1) * 2.0;
111
- const x = cx + Math.cos(a) * r, z = cz + Math.sin(a) * r;
112
- stone(ctx, huangshiGeo(900 + i, 5.2 + (i % 3), 1.6 + (i % 4) * 0.42, 4.2 + (i % 3)),
113
- i % 3 === 0 ? M.stoneDark : M.taihuDark, x, 0.42, z, [0, a, 0]);
114
- }
115
- // 太湖石主峰群(分层堆叠,越高越瘦)
116
- const peaks = [
117
- { x: cx, z: cz, w: 9.5, h: 9.2, d: 8.0, y: 4.4, s: 1 },
118
- { x: cx - 5.0, z: cz + 3.0, w: 7.0, h: 7.0, d: 6.2, y: 3.3, s: 2 },
119
- { x: cx + 5.2, z: cz + 1.8, w: 6.6, h: 6.4, d: 6.0, y: 3.0, s: 3 },
120
- { x: cx + 2.0, z: cz - 5.0, w: 7.4, h: 6.8, d: 6.4, y: 3.2, s: 4 },
121
- { x: cx - 4.0, z: cz - 5.4, w: 6.2, h: 5.6, d: 5.4, y: 2.7, s: 5 },
122
- { x: cx - 9.0, z: cz - 1.0, w: 5.4, h: 4.8, d: 5.0, y: 2.3, s: 6 },
123
- { x: cx + 9.0, z: cz - 3.0, w: 5.0, h: 4.4, d: 4.6, y: 2.1, s: 7 },
124
- { x: cx + 1.0, z: cz + 6.5, w: 5.8, h: 4.2, d: 5.0, y: 2.0, s: 8 },
125
- { x: cx - 8.0, z: cz + 7.0, w: 4.6, h: 3.6, d: 4.4, y: 1.7, s: 9 },
126
- ];
127
- peaks.forEach((p, i) => {
128
- const g = taihuGeo(1100 + p.s * 37, p.w, p.h, p.d, { detail: 4, hole: 0.46, amp: 0.36 });
129
- stone(ctx, g, i < 3 ? M.taihu : M.taihuDark, p.x, p.y, p.z, [0, p.s * 0.7, p.s * 0.04]);
130
- prog((i + 1) / (peaks.length + 12), `叠石主峰 ${i + 1}`);
131
- });
132
- // 次级配峰与散石(近景细节层,LOD 可剔除)
133
- const rnd = mulberry32(2024);
134
- for (let i = 0; i < 26; i++) {
135
- const a = rnd() * Math.PI * 2, r = 6 + rnd() * 15;
136
- const x = cx + Math.cos(a) * r, z = cz + Math.sin(a) * r;
137
- if (waterSDF(x, z) < -0.6) continue;
138
- const w = 1.2 + rnd() * 3.0, h = 1.0 + rnd() * 2.8;
139
- const g = taihuGeo(2200 + i * 17, w, h, w * (0.7 + rnd() * 0.5), { detail: 3, hole: 0.58, amp: 0.40 });
140
- stone(ctx, g, M.taihuDark, x, h * 0.38, z, [rnd() * 0.2, rnd() * 6.28, rnd() * 0.2], i < 10 ? 1 : 2);
141
- }
142
- // 崖壁沟壑与皴纹线(苔痕)
143
- for (let i = 0; i < 18; i++) {
144
- const a = rnd() * Math.PI * 2, r = 3 + rnd() * 11;
145
- const x = cx + Math.cos(a) * r, z = cz + Math.sin(a) * r;
146
- stone(ctx, new THREE.IcosahedronGeometry(0.35 + rnd() * 0.45, 1), M.moss,
147
- x, 0.8 + rnd() * 2.2, z, [0, rnd() * 6.28, 0], 1);
148
- }
149
- // 洞壑:两块巨石之间以暗色内腔与券口石表达
150
- const caveX = cx - 2.0, caveZ = cz + 8.6;
151
- stone(ctx, new THREE.SphereGeometry(2.1, 12, 8), M.ink, caveX, 1.55, caveZ);
152
- for (let i = 0; i < 9; i++) {
153
- const a = Math.PI * (i + 0.5) / 9;
154
- stone(ctx, huangshiGeo(3300 + i, 1.0, 0.65, 0.7), M.huangshi,
155
- caveX - Math.cos(a) * 2.35, 1.3 + Math.sin(a) * 2.1, caveZ + 0.35, [0, 0, -a + Math.PI / 2], 1);
156
- }
157
- // 蹬道:从水湾 (-46,-18) 盘旋至山顶 (-64,-40)
158
- const path = [
159
- [-46, -18], [-50, -22], [-53, -26], [-55, -30], [-58, -33],
160
- [-61, -36], [-64, -38], [-67, -40], [-64, -43], [-62, -40],
161
- ];
162
- for (let i = 0; i < path.length - 1; i++) {
163
- const [x1, z1] = path[i], [x2, z2] = path[i + 1];
164
- const steps = 5;
165
- const y0 = 0.35 + i * 0.72, y1 = 0.35 + (i + 1) * 0.72;
166
- for (let k = 0; k < steps; k++) {
167
- const t = (k + 0.5) / steps;
168
- const x = x1 + (x2 - x1) * t, z = z1 + (z2 - z1) * t;
169
- const y = y0 + (y1 - y0) * t;
170
- const a = -Math.atan2(z2 - z1, x2 - x1);
171
- stone(ctx, boxGeo(1.9, 0.16, 0.72, 0.5), M.huangshi, x, y, z, [0, a, 0]);
172
- }
173
- }
174
- // 峡谷两侧岩壁
175
- for (let i = 0; i < 8; i++) {
176
- const x = -50 - i * 1.5, z = -22 - i * 1.8;
177
- const h = 2.4 + i * 0.42;
178
- const g = taihuGeo(4400 + i, 3.2, h, 2.6, { detail: 3, hole: 0.62, amp: 0.30 });
179
- stone(ctx, g, M.taihuDark, x - 2.4, h * 0.42, z, [0, i * 0.5, 0]);
180
- stone(ctx, taihuGeo(4500 + i, 2.8, h * 0.8, 2.4, { detail: 3, hole: 0.62, amp: 0.30 }),
181
- M.taihuDark, x + 2.4, h * 0.34, z + 1.0, [0, i * 0.6, 0]);
182
- }
183
- // 跌水与山涧(位置交给 water.js)
184
- ctx.waterfalls.push({ x: -53.2, z: -30.5, yTop: 5.8, yBottom: -0.30, width: 2.5, depth: 0.35 });
185
- ctx.waterfalls.push({ x: -47.5, z: -22.0, yTop: 2.4, yBottom: -0.30, width: 1.5, depth: 0.25 });
186
- ctx.streams.push({ points: [[-53, -30], [-50, -26], [-47, -22], [-44, -18]], width: 1.8 });
187
- }
188
-
189
- /** 池岸:沿水系等值线布置黄石驳岸、太湖石石矶与湿苔 */
190
- function buildShore(ctx) {
191
- const { M } = ctx;
192
- const rnd = mulberry32(7717);
193
- // 沿园墙内水岸采样(角度采样 + 椭圆参数)
194
- const samples = [];
195
- POOLS.forEach((p, pi) => {
196
- const N = pi === 0 ? 96 : 40;
197
- for (let i = 0; i < N; i++) {
198
- const a = i * Math.PI * 2 / N + rnd() * 0.02;
199
- const jitter = 1 + (rnd() - 0.5) * 0.10;
200
- const x = p.x + Math.cos(a) * p.rx * jitter;
201
- const z = p.z + Math.sin(a) * p.rz * jitter;
202
- if (waterSDF(x, z) > -1.6 && waterSDF(x, z) < 1.6) samples.push([x, z, a]);
203
- }
204
- });
205
- samples.forEach(([x, z, a], i) => {
206
- if (rnd() < 0.16) return;
207
- const w = 1.0 + rnd() * 1.5, h = 0.45 + rnd() * 0.75;
208
- // 条石驳岸
209
- stone(ctx, boxGeo(w, h, 0.75, 0.55), i % 3 === 0 ? M.stoneDark : M.huangshi,
210
- x, h * 0.22 - 0.10, z, [0, -a + Math.PI / 2, 0]);
211
- if (i % 7 === 0) {
212
- // 石矶:稍大的太湖石挑出水面
213
- const g = taihuGeo(6100 + i, 1.6 + rnd() * 1.3, 1.1 + rnd() * 1.2, 1.4 + rnd(),
214
- { detail: 3, hole: 0.60, amp: 0.38 });
215
- stone(ctx, g, M.taihuDark, x + Math.cos(a) * 0.9, 0.42, z + Math.sin(a) * 0.9, [0, rnd() * 6.28, 0], 1);
216
- }
217
- if (i % 5 === 0) {
218
- stone(ctx, new THREE.IcosahedronGeometry(0.24 + rnd() * 0.2, 1), M.moss,
219
- x, 0.32, z, [0, rnd() * 6.28, 0], 1);
220
- }
221
- });
222
- // 岛屿岸壁加石
223
- ISLES.forEach((is, k) => {
224
- for (let i = 0; i < 16; i++) {
225
- const a = i * Math.PI * 2 / 16;
226
- const x = is.x + Math.cos(a) * (is.rx + 0.35), z = is.z + Math.sin(a) * (is.rz + 0.35);
227
- stone(ctx, huangshiGeo(7000 + k * 20 + i, 1.5, 0.7 + (i % 3) * 0.18, 0.9), M.huangshi,
228
- x, 0.05, z, [0, -a, 0]);
229
- }
230
- });
231
- }
232
-
233
- /** 庭园特置峰石与小品(冠云峰式立峰、石笋、石桌凳) */
234
- function buildFeatureStones(ctx) {
235
- const { B, M } = ctx;
236
- const features = [
237
- { x: -93, z: 52, h: 4.6, w: 2.1, d: 1.7, seed: 801 }, // 竹里馆入口立峰(避开框景视线)
238
- { x: -22, z: 42, h: 3.4, w: 1.8, d: 1.5, seed: 802 }, // 前庭东隅
239
- { x: 24, z: 44, h: 3.8, w: 2.0, d: 1.6, seed: 803 }, // 前庭西隅
240
- { x: 74, z: -40, h: 4.1, w: 2.3, d: 1.9, seed: 804 }, // 小山丛桂
241
- { x: 28, z: -18, h: 5.2, w: 2.6, d: 2.1, seed: 805 }, // 瀛洲岛主峰
242
- { x: -34, z: -24, h: 3.2, w: 1.6, d: 1.4, seed: 806 }, // 方丈岛
243
- { x: 62, z: 18, h: 3.0, w: 1.7, d: 1.4, seed: 807 }, // 荷池东岸
244
- { x: -70, z: 8, h: 3.6, w: 2.0, d: 1.6, seed: 808 }, // 漱石枕流
245
- ];
246
- features.forEach(f => {
247
- const g = taihuGeo(f.seed, f.w, f.h, f.d, { detail: 4, hole: 0.42, amp: 0.32, holeFreq: 2.1 });
248
- stone(ctx, g, M.taihu, f.x, f.h * 0.47, f.z, [0, f.seed * 0.01, 0]);
249
- // 石座
250
- stone(ctx, new THREE.CylinderGeometry(f.w * 0.72, f.w * 0.85, 0.36, 10), M.stoneDark, f.x, 0.18, f.z);
251
- for (let i = 0; i < 4; i++) {
252
- const a = i * Math.PI / 2;
253
- stone(ctx, new THREE.IcosahedronGeometry(0.30 + i * 0.05, 1), M.moss,
254
- f.x + Math.cos(a) * f.w * 0.7, 0.30, f.z + Math.sin(a) * f.d * 0.7, [0, a, 0], 1);
255
- }
256
- });
257
- // 石桌石凳(竹里馆 / 扇面亭旁)
258
- [[-88, 38], [72, -50], [-40, 16]].forEach(([x, z], i) => {
259
- stone(ctx, new THREE.CylinderGeometry(0.85, 0.72, 0.16, 12), M.stone, x, 0.76, z, [0, 0, 0], 1);
260
- stone(ctx, new THREE.CylinderGeometry(0.20, 0.30, 0.70, 8), M.stoneDark, x, 0.36, z, [0, 0, 0], 1);
261
- for (let k = 0; k < 4; k++) {
262
- const a = k * Math.PI / 2 + 0.4;
263
- stone(ctx, new THREE.CylinderGeometry(0.30, 0.32, 0.42, 8), M.stoneDark,
264
- x + Math.cos(a) * 1.4, 0.21, z + Math.sin(a) * 1.4, [0, 0, 0], 1);
265
- }
266
- });
267
- }
268
-
269
- export function buildRockery(ctx) {
270
- if (!ctx.waterfalls) ctx.waterfalls = [];
271
- if (!ctx.streams) ctx.streams = [];
272
- const prog = ctx.onProgress || (() => {});
273
- prog(0.02, '太湖石主峰群');
274
- buildMainPeaks(ctx);
275
- prog(0.62, '池岸驳岸与石矶');
276
- buildShore(ctx);
277
- prog(0.84, '庭园特置峰石');
278
- buildFeatureStones(ctx);
279
- prog(1, '假山叠石完成');
280
- }
@@ -1,242 +0,0 @@
1
- /* 吴苑澄观 · 天穹、时辰光照、天气与软阴影
2
- * 天穹 shader(渐变 + 卷积云 + 日轮 + 地平线散射)、太阳/半球/补光、
3
- * FogExp2 高度雾、三态天气(晴 / 薄霭 / 细雨)与 GPU 顶点动画雨丝。
4
- */
5
- import * as THREE from 'three';
6
- import { WORLD, QUALITY, clamp, lerp, mulberry32 } from './core.js';
7
-
8
- const skyVert = `
9
- varying vec3 vDir;
10
- void main(){
11
- vDir = normalize(position);
12
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
13
- }`;
14
- const skyFrag = `
15
- precision highp float;
16
- uniform vec3 uTop, uHorizon, uSunDir, uSunColor;
17
- uniform float uCloud, uTime, uRain, uSunAlt;
18
- varying vec3 vDir;
19
- float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
20
- float noise(vec2 p){
21
- vec2 i = floor(p), f = fract(p);
22
- vec2 u = f * f * (3.0 - 2.0 * f);
23
- return mix(mix(hash(i), hash(i + vec2(1.0,0.0)), u.x),
24
- mix(hash(i + vec2(0.0,1.0)), hash(i + vec2(1.0,1.0)), u.x), u.y);
25
- }
26
- float fbm(vec2 p){
27
- float a = 0.5, s = 0.0;
28
- for (int i = 0; i < 5; i++){ s += a * noise(p); p *= 2.03; a *= 0.5; }
29
- return s;
30
- }
31
- void main(){
32
- vec3 d = normalize(vDir);
33
- float y = clamp(d.y, -0.12, 1.0);
34
- vec3 col = mix(uHorizon, uTop, pow(clamp(y * 1.35 + 0.04, 0.0, 1.0), 0.62));
35
- // 地平线暖散射
36
- float glow = exp(-abs(y - 0.02) * 9.0);
37
- col += uSunColor * glow * (0.10 + 0.16 * (1.0 - uSunAlt));
38
- // 卷积云(沿天穹切平面投影)
39
- vec2 cp = d.xz / max(0.22, d.y + 0.30);
40
- float cs = fbm(cp * 1.9 + vec2(uTime * 0.006, uTime * 0.002));
41
- float cloud = smoothstep(0.46 - uCloud * 0.22, 0.78 - uCloud * 0.14, cs);
42
- cloud *= smoothstep(0.02, 0.28, y) * (1.0 - smoothstep(0.82, 1.0, y));
43
- vec3 cloudCol = mix(vec3(0.80, 0.83, 0.84), vec3(0.98, 0.96, 0.92), clamp(uSunAlt, 0.0, 1.0));
44
- cloudCol = mix(cloudCol * 0.62, cloudCol, uSunAlt);
45
- col = mix(col, cloudCol, cloud * (0.30 + uCloud * 0.62));
46
- // 日轮与光晕
47
- float sd = max(dot(d, normalize(uSunDir)), 0.0);
48
- col += uSunColor * pow(sd, 1800.0) * 3.2 * (1.0 - uCloud * 0.55);
49
- col += uSunColor * pow(sd, 42.0) * 0.26 * (1.0 - uRain * 0.6);
50
- // 雨天压暗与去饱和
51
- float lum = dot(col, vec3(0.299, 0.587, 0.114));
52
- col = mix(col, vec3(lum) * vec3(0.88, 0.93, 0.96), uRain * 0.55);
53
- gl_FragColor = vec4(col, 1.0);
54
- }`;
55
-
56
- const rainVert = `
57
- uniform float uTime;
58
- varying float vA;
59
- void main(){
60
- vec4 base = instanceMatrix * vec4(0.0, 0.0, 0.0, 1.0);
61
- float y = mod(base.y - uTime * 17.0, 26.0) - 13.0;
62
- vec3 wp = vec3(base.x + position.x + y * 0.10, y + position.y, base.z + position.z);
63
- vA = 1.0 - smoothstep(10.0, 13.5, abs(y));
64
- gl_Position = projectionMatrix * modelViewMatrix * vec4(wp, 1.0);
65
- }`;
66
- const rainFrag = `
67
- precision highp float;
68
- uniform float uOpacity;
69
- varying float vA;
70
- void main(){ gl_FragColor = vec4(0.78, 0.86, 0.90, vA * uOpacity); }`;
71
-
72
- const WEATHER = {
73
- clear: { cloud: 0.22, fog: 0.0019, rain: 0, light: 1.0, exposure: 1.08, sat: 1.0 },
74
- mist: { cloud: 0.58, fog: 0.0038, rain: 0, light: 0.82, exposure: 1.02, sat: 0.92 },
75
- rain: { cloud: 0.92, fog: 0.0052, rain: 1, light: 0.62, exposure: 0.94, sat: 0.80 },
76
- };
77
-
78
- export function createSky(scene, renderer, M) {
79
- const state = {
80
- hour: WORLD.sunDefaultHour,
81
- weather: 'clear',
82
- skyTop: new THREE.Color(0x4a78a6),
83
- skyHorizon: new THREE.Color(0xd4cdb4),
84
- sunDir: new THREE.Vector3(0.6, 0.6, 0.5).normalize(),
85
- sunColor: new THREE.Color(0xffe0b0),
86
- fogColor: new THREE.Color(0xb9c2ba),
87
- fogDensity: 0.0019,
88
- rain: 0,
89
- cloud: 0.22,
90
- };
91
-
92
- /* 天穹 */
93
- const skyUniforms = {
94
- uTop: { value: state.skyTop },
95
- uHorizon: { value: state.skyHorizon },
96
- uSunDir: { value: state.sunDir },
97
- uSunColor: { value: state.sunColor },
98
- uCloud: { value: state.cloud },
99
- uTime: { value: 0 },
100
- uRain: { value: 0 },
101
- uSunAlt: { value: 0.6 },
102
- };
103
- const dome = new THREE.Mesh(
104
- new THREE.SphereGeometry(1400, 40, 24),
105
- new THREE.ShaderMaterial({
106
- uniforms: skyUniforms, vertexShader: skyVert, fragmentShader: skyFrag,
107
- side: THREE.BackSide, depthWrite: false, fog: false,
108
- })
109
- );
110
- dome.name = '天穹'; dome.frustumCulled = false;
111
- scene.add(dome);
112
-
113
- /* 光照 */
114
- const sun = new THREE.DirectionalLight(0xffe0b0, 2.3);
115
- sun.castShadow = true;
116
- sun.shadow.mapSize.set(4096, 4096);
117
- const sc = sun.shadow.camera;
118
- sc.left = -180; sc.right = 180; sc.top = 165; sc.bottom = -165; sc.near = 1; sc.far = 900;
119
- sun.shadow.bias = -0.00035;
120
- sun.shadow.normalBias = 0.024;
121
- sun.shadow.radius = 2.2;
122
- sun.target.position.set(0, 0, -8);
123
- scene.add(sun, sun.target);
124
- const hemi = new THREE.HemisphereLight(0x91aec6, 0x77805e, 0.86);
125
- scene.add(hemi);
126
- const ambient = new THREE.AmbientLight(0xbfc8c4, 0.26);
127
- scene.add(ambient);
128
- const fill = new THREE.DirectionalLight(0xa8c2d8, 0.34);
129
- fill.position.set(90, 60, 120);
130
- scene.add(fill);
131
-
132
- scene.fog = new THREE.FogExp2(state.fogColor.getHex(), state.fogDensity);
133
-
134
- /* 雨丝:InstancedMesh + 顶点动画,整体跟随相机 */
135
- let rain = null;
136
- function buildRain(count) {
137
- if (rain) { scene.remove(rain); rain.geometry.dispose(); rain.material.dispose(); }
138
- const geo = new THREE.BoxGeometry(0.012, 0.82, 0.012);
139
- const mat = new THREE.ShaderMaterial({
140
- uniforms: { uTime: { value: 0 }, uOpacity: { value: 0.42 } },
141
- vertexShader: rainVert, fragmentShader: rainFrag,
142
- transparent: true, depthWrite: false, side: THREE.DoubleSide,
143
- });
144
- rain = new THREE.InstancedMesh(geo, mat, count);
145
- rain.name = '细雨'; rain.frustumCulled = false; rain.visible = false;
146
- const rnd = mulberry32(1357), m = new THREE.Matrix4();
147
- for (let i = 0; i < count; i++) {
148
- m.makeTranslation((rnd() - 0.5) * 76, rnd() * 26, (rnd() - 0.5) * 76);
149
- rain.setMatrixAt(i, m);
150
- }
151
- rain.instanceMatrix.needsUpdate = true;
152
- rain.userData.mat = mat;
153
- scene.add(rain);
154
- }
155
- buildRain(QUALITY.high.rain);
156
-
157
- /* 时辰与天气 */
158
- const tmpTop = new THREE.Color(), tmpHz = new THREE.Color(), tmpSun = new THREE.Color(), tmpFog = new THREE.Color();
159
- function setHour(h) {
160
- state.hour = clamp(h, 5.5, 19.5);
161
- const t = (state.hour - 5.5) / 14;
162
- const alt = 55 * Math.pow(Math.max(0.02, Math.sin(t * Math.PI)), 1.7) * Math.PI / 180;
163
- const az = (t - 0.5) * Math.PI; // -π/2 东 → 0 南 → π/2 西
164
- state.sunDir.set(Math.sin(az) * Math.cos(alt), Math.sin(alt), Math.cos(az) * Math.cos(alt)).normalize();
165
- skyUniforms.uSunAlt.value = Math.sin(alt);
166
- const day = clamp(Math.sin(t * Math.PI) * 1.4, 0, 1);
167
- const golden = 1 - clamp((alt - 0.18) / 0.52, 0, 1); // 低角度暖光权重
168
- const dusk = 1 - day;
169
-
170
- // 天空色:日间冷蓝、黄金时刻暖、暮色紫橙
171
- tmpTop.set(0x3f6fa3).lerp(new THREE.Color(0x2a3a62), dusk * 0.78);
172
- tmpHz.set(0xc9d4cf).lerp(new THREE.Color(0xe9c79c), golden * 0.72);
173
- tmpHz.lerp(new THREE.Color(0xc98768), dusk * 0.55);
174
- tmpSun.set(0xfff4dc).lerp(new THREE.Color(0xffb878), golden * 0.82);
175
- tmpSun.lerp(new THREE.Color(0xff9a68), dusk * 0.55);
176
-
177
- const w = WEATHER[state.weather];
178
- if (state.weather === 'rain') {
179
- tmpTop.lerp(new THREE.Color(0x596a72), 0.78);
180
- tmpHz.lerp(new THREE.Color(0x9ba7a6), 0.78);
181
- tmpSun.lerp(new THREE.Color(0xc9d2d0), 0.72);
182
- } else if (state.weather === 'mist') {
183
- tmpTop.lerp(new THREE.Color(0x7190a4), 0.48);
184
- tmpHz.lerp(new THREE.Color(0xc9cec4), 0.52);
185
- }
186
- state.skyTop.copy(tmpTop); state.skyHorizon.copy(tmpHz); state.sunColor.copy(tmpSun);
187
- tmpFog.copy(tmpHz).lerp(tmpTop, 0.34);
188
- if (state.weather === 'rain') tmpFog.lerp(new THREE.Color(0x9aa6a6), 0.55);
189
- state.fogColor.copy(tmpFog);
190
- state.fogDensity = w.fog;
191
- scene.fog.color.copy(state.fogColor);
192
- scene.fog.density = state.fogDensity;
193
-
194
- sun.color.copy(state.sunColor);
195
- sun.intensity = (0.42 + day * 2.05) * w.light;
196
- sun.position.copy(state.sunDir).multiplyScalar(340);
197
- hemi.color.copy(tmpTop).lerp(new THREE.Color(0xffffff), 0.32);
198
- hemi.groundColor.set(0x6e7658);
199
- hemi.intensity = (0.48 + day * 0.46) * (state.weather === 'rain' ? 0.82 : 1);
200
- ambient.intensity = 0.20 + dusk * 0.16;
201
- fill.intensity = 0.24 + (1 - day) * 0.16;
202
- renderer.toneMappingExposure = w.exposure * (0.92 + day * 0.10);
203
-
204
- // 暮色点亮廊下灯笼
205
- M.lantern.emissiveIntensity = 0.12 + dusk * 2.1 + (state.weather === 'rain' ? 0.5 : 0);
206
- renderer.shadowMap.needsUpdate = true;
207
- return state;
208
- }
209
- function setWeather(w) {
210
- if (!WEATHER[w]) return state;
211
- state.weather = w;
212
- const cfg = WEATHER[w];
213
- state.cloud = cfg.cloud; state.rain = cfg.rain;
214
- skyUniforms.uCloud.value = cfg.cloud;
215
- skyUniforms.uRain.value = cfg.rain;
216
- if (rain) { rain.visible = cfg.rain > 0; rain.userData.mat.uniforms.uOpacity.value = 0.42; }
217
- setHour(state.hour);
218
- return state;
219
- }
220
- function setQuality(q) {
221
- sun.shadow.mapSize.set(q.shadow, q.shadow);
222
- if (sun.shadow.map) { sun.shadow.map.dispose(); sun.shadow.map = null; }
223
- if (rain) {
224
- rain.count = Math.min(rain.instanceMatrix.count, Math.round(q.rain));
225
- }
226
- renderer.shadowMap.needsUpdate = true;
227
- }
228
-
229
- return {
230
- dome, sun, hemi, state, rain,
231
- setHour, setWeather, setQuality,
232
- getState: () => state,
233
- update(t, camera) {
234
- skyUniforms.uTime.value = t;
235
- dome.position.copy(camera.position);
236
- if (rain && rain.visible) {
237
- rain.position.set(camera.position.x, 10, camera.position.z);
238
- rain.userData.mat.uniforms.uTime.value = t;
239
- }
240
- },
241
- };
242
- }