agentscape3d-engine 0.0.0-stage → 1.0.0-beta.3

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 (457) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -2
  3. package/cli.mjs +53 -0
  4. package/dist/ArticulationVerifier-BfGxXY8V.js +337 -0
  5. package/dist/ArticulationVerifier-BfGxXY8V.js.map +1 -0
  6. package/dist/AssetCompiler-BLj09iu1.js +2424 -0
  7. package/dist/AssetCompiler-BLj09iu1.js.map +1 -0
  8. package/dist/AssetModule-DME-XaFS.js +2637 -0
  9. package/dist/AssetModule-DME-XaFS.js.map +1 -0
  10. package/dist/AssetRecipe-g8dZBhgJ.js +298 -0
  11. package/dist/AssetRecipe-g8dZBhgJ.js.map +1 -0
  12. package/dist/BrowserCodeWorker.js +53856 -0
  13. package/dist/BrowserCodeWorker.js.map +1 -0
  14. package/dist/CarryCapability-CXwHU5ay.js +104 -0
  15. package/dist/CarryCapability-CXwHU5ay.js.map +1 -0
  16. package/dist/KinematicHypothesisScreen-C3TKiuYR.js +241 -0
  17. package/dist/KinematicHypothesisScreen-C3TKiuYR.js.map +1 -0
  18. package/dist/ObjectTransform-BlQUNK7c.js +61 -0
  19. package/dist/ObjectTransform-BlQUNK7c.js.map +1 -0
  20. package/dist/RapierPhysicsBackend-B2wQe_Vl.js +3259 -0
  21. package/dist/RapierPhysicsBackend-B2wQe_Vl.js.map +1 -0
  22. package/dist/RenderingSystem-WIr1ZuGu.js +1042 -0
  23. package/dist/RenderingSystem-WIr1ZuGu.js.map +1 -0
  24. package/dist/ScenePresentation-LsYiDxbm.js +152 -0
  25. package/dist/ScenePresentation-LsYiDxbm.js.map +1 -0
  26. package/dist/SceneProject-K7HH1s8o.js +2687 -0
  27. package/dist/SceneProject-K7HH1s8o.js.map +1 -0
  28. package/dist/SceneSerializer-zOzbX4jZ.js +932 -0
  29. package/dist/SceneSerializer-zOzbX4jZ.js.map +1 -0
  30. package/dist/SimulationProfile-DSYZbBLQ.js +165 -0
  31. package/dist/SimulationProfile-DSYZbBLQ.js.map +1 -0
  32. package/dist/StylePack-DcRa_kU0.js +88 -0
  33. package/dist/StylePack-DcRa_kU0.js.map +1 -0
  34. package/dist/WorldArchive-BiFGLt--.js +451 -0
  35. package/dist/WorldArchive-BiFGLt--.js.map +1 -0
  36. package/dist/WorldCommands-Debj7V4L.js +2207 -0
  37. package/dist/WorldCommands-Debj7V4L.js.map +1 -0
  38. package/dist/WorldIO-Ch8QBfKY.js +151 -0
  39. package/dist/WorldIO-Ch8QBfKY.js.map +1 -0
  40. package/dist/admission-CVEvsrdz.js +121 -0
  41. package/dist/admission-CVEvsrdz.js.map +1 -0
  42. package/dist/blankWorld-B0MW6g7q.js +75 -0
  43. package/dist/blankWorld-B0MW6g7q.js.map +1 -0
  44. package/dist/core.d.ts +68 -0
  45. package/dist/core.js +209 -0
  46. package/dist/core.js.map +1 -0
  47. package/dist/disposeObject3D-DIMzy0FA.js +128 -0
  48. package/dist/disposeObject3D-DIMzy0FA.js.map +1 -0
  49. package/dist/environments-HOe3sJXH.js +567 -0
  50. package/dist/environments-HOe3sJXH.js.map +1 -0
  51. package/dist/gltfIO-BzVKLyaL.js +339 -0
  52. package/dist/gltfIO-BzVKLyaL.js.map +1 -0
  53. package/dist/grandUrbanBlock-DRndRZjF.js +515 -0
  54. package/dist/grandUrbanBlock-DRndRZjF.js.map +1 -0
  55. package/dist/index.d.ts +345 -0
  56. package/dist/index.js +16952 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/magicCabin-CfBZjx2Q.js +11019 -0
  59. package/dist/magicCabin-CfBZjx2Q.js.map +1 -0
  60. package/dist/manifests-D0LwbJ36.js +866 -0
  61. package/dist/manifests-D0LwbJ36.js.map +1 -0
  62. package/dist/mcp.d.ts +2 -0
  63. package/dist/mcp.js +1 -0
  64. package/dist/monumentHall-awZiGtda.js +403 -0
  65. package/dist/monumentHall-awZiGtda.js.map +1 -0
  66. package/dist/node.d.ts +16 -0
  67. package/dist/node.js +26 -0
  68. package/dist/parts-DrEcfJRl.js +37 -0
  69. package/dist/parts-DrEcfJRl.js.map +1 -0
  70. package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
  71. package/dist/ruinedCourtyard-DuF7NmUU.js +696 -0
  72. package/dist/ruinedCourtyard-DuF7NmUU.js.map +1 -0
  73. package/dist/runtime/application/AgentTools.js +28 -0
  74. package/dist/runtime/application/README.md +14 -0
  75. package/dist/runtime/application/agent/ProgressiveAgentTools.js +92 -0
  76. package/dist/runtime/application/agent/StudioMcpAllowlist.js +10 -0
  77. package/dist/runtime/application/agent/StudioProjectTools.js +18 -0
  78. package/dist/runtime/application/agent/TaskEvidence.js +199 -0
  79. package/dist/runtime/application/buildTaskObservation.js +117 -0
  80. package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +50 -0
  81. package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +35 -0
  82. package/dist/runtime/application/code-execution/BrowserCodeWorker.js +17 -0
  83. package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +82 -0
  84. package/dist/runtime/application/createSession.js +66 -0
  85. package/dist/runtime/application/createWorldAuthoringContext.js +400 -0
  86. package/dist/runtime/application/generation/GenerationOrchestrator.js +630 -0
  87. package/dist/runtime/application/generation/GenerationRuntime.js +215 -0
  88. package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +289 -0
  89. package/dist/runtime/application/native-scene/CodeProject.js +215 -0
  90. package/dist/runtime/application/native-scene/CodeProjectModules.js +143 -0
  91. package/dist/runtime/application/native-scene/ExampleWorldCatalog.js +35 -0
  92. package/dist/runtime/application/native-scene/NativeArticulation.js +53 -0
  93. package/dist/runtime/application/native-scene/NativeEditableRegistry.js +150 -0
  94. package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +85 -0
  95. package/dist/runtime/application/native-scene/NativeLightingInspection.js +33 -0
  96. package/dist/runtime/application/native-scene/NativeMaterialInspection.js +52 -0
  97. package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +127 -0
  98. package/dist/runtime/application/native-scene/NativePhysicsGeometry.js +64 -0
  99. package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +51 -0
  100. package/dist/runtime/application/native-scene/NativeSceneHost.js +406 -0
  101. package/dist/runtime/application/native-scene/NativeSceneInspection.js +203 -0
  102. package/dist/runtime/application/native-scene/NativeSceneOverlay.js +116 -0
  103. package/dist/runtime/application/native-scene/NativeSceneQuery.js +123 -0
  104. package/dist/runtime/application/native-scene/NativeSceneReview.js +132 -0
  105. package/dist/runtime/application/native-scene/NativeThreeModule.js +16 -0
  106. package/dist/runtime/application/native-scene/SceneObserver.js +97 -0
  107. package/dist/runtime/application/native-scene/VisualCapturePolicy.js +4 -0
  108. package/dist/runtime/application/object-forge/SceneObjectForge.js +263 -0
  109. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +59 -0
  110. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +22 -0
  111. package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +40 -0
  112. package/dist/runtime/application/scene/CapabilityResolver.js +90 -0
  113. package/dist/runtime/application/scene/NativeEditableContracts.js +18 -0
  114. package/dist/runtime/application/scene/RequestWindow.js +54 -0
  115. package/dist/runtime/application/scene/SceneAgentTools.js +21 -0
  116. package/dist/runtime/application/scene/SceneContracts.js +49 -0
  117. package/dist/runtime/application/scene/SceneEditService.js +154 -0
  118. package/dist/runtime/application/scene/SceneFacade.js +356 -0
  119. package/dist/runtime/application/scene/SceneInteractionAdapters.js +41 -0
  120. package/dist/runtime/application/scene/SceneJobController.js +320 -0
  121. package/dist/runtime/application/scene/SceneLifecycle.js +57 -0
  122. package/dist/runtime/application/scene/ScenePackage.js +173 -0
  123. package/dist/runtime/application/scene/ScenePersistence.js +50 -0
  124. package/dist/runtime/application/scene/SceneProject.js +95 -0
  125. package/dist/runtime/application/scene/SceneSkillNames.js +5 -0
  126. package/dist/runtime/application/scene/StarterScene.js +56 -0
  127. package/dist/runtime/application/scene/WorldArchive.js +89 -0
  128. package/dist/runtime/application/scene/WorldDirectory.js +20 -0
  129. package/dist/runtime/application/scene/WorldDocument.js +76 -0
  130. package/dist/runtime/application/scene/WorldIO.js +103 -0
  131. package/dist/runtime/application/scene/WorldStorage.js +155 -0
  132. package/dist/runtime/application/skills/SkillRegistry.js +193 -0
  133. package/dist/runtime/application/skills/packs/acceptanceSkills.js +32 -0
  134. package/dist/runtime/application/skills/packs/affordanceSkills.js +36 -0
  135. package/dist/runtime/application/skills/packs/assetSkills.js +46 -0
  136. package/dist/runtime/application/skills/packs/authoringSkills.js +16 -0
  137. package/dist/runtime/application/skills/packs/batchSkills.js +22 -0
  138. package/dist/runtime/application/skills/packs/codeSkills.js +106 -0
  139. package/dist/runtime/application/skills/packs/generationSkills.js +45 -0
  140. package/dist/runtime/application/skills/packs/interactionSkills.js +46 -0
  141. package/dist/runtime/application/skills/packs/recoverySkills.js +80 -0
  142. package/dist/runtime/application/skills/packs/sceneSkills.js +24 -0
  143. package/dist/runtime/application/skills/packs/spatialSkills.js +35 -0
  144. package/dist/runtime/application/skills/packs/verificationSkills.js +14 -0
  145. package/dist/runtime/application/skills/packs/worldSkills.js +45 -0
  146. package/dist/runtime/application/skills/registerCoreSkills.js +31 -0
  147. package/dist/runtime/application/skills/skillPrimitives.js +4 -0
  148. package/dist/runtime/application/tasks/CabinetCupTask.js +76 -0
  149. package/dist/runtime/application/tasks.jsonl +67 -0
  150. package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +42 -0
  151. package/dist/runtime/application/world-authoring/AuthoringDiff.js +149 -0
  152. package/dist/runtime/application/world-authoring/AuthoringDocument.js +825 -0
  153. package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +109 -0
  154. package/dist/runtime/application/world-authoring/AuthoringIdentity.js +17 -0
  155. package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +29 -0
  156. package/dist/runtime/application/world-authoring/AuthoringPatch.js +118 -0
  157. package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +334 -0
  158. package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +126 -0
  159. package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +144 -0
  160. package/dist/runtime/application/world-authoring/HeadlessImageExport.js +92 -0
  161. package/dist/runtime/application/world-authoring/ModelRef.js +62 -0
  162. package/dist/runtime/application/world-authoring/SceneGLBExport.js +88 -0
  163. package/dist/runtime/apps/mcp-server/AUTHORING.md +71 -0
  164. package/dist/runtime/apps/mcp-server/AgentMcpCompat.js +68 -0
  165. package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +1 -0
  166. package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +30 -0
  167. package/dist/runtime/apps/mcp-server/BuildEnvironment.js +17 -0
  168. package/dist/runtime/apps/mcp-server/CodeExecutor.js +71 -0
  169. package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +42 -0
  170. package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +66 -0
  171. package/dist/runtime/apps/mcp-server/FileAssetRepository.js +159 -0
  172. package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +8 -0
  173. package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +47 -0
  174. package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +157 -0
  175. package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +6 -0
  176. package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +116 -0
  177. package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +60 -0
  178. package/dist/runtime/apps/mcp-server/README.md +269 -0
  179. package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +1 -0
  180. package/dist/runtime/apps/mcp-server/SandboxBundle.js +13 -0
  181. package/dist/runtime/apps/mcp-server/SessionManager.js +148 -0
  182. package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +75 -0
  183. package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +246 -0
  184. package/dist/runtime/apps/mcp-server/StudioProjectToolContracts.js +58 -0
  185. package/dist/runtime/apps/mcp-server/TransferHttp.js +47 -0
  186. package/dist/runtime/apps/mcp-server/TransferLimits.js +6 -0
  187. package/dist/runtime/apps/mcp-server/TransferStore.js +134 -0
  188. package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +16 -0
  189. package/dist/runtime/apps/mcp-server/VALIDATION.md +45 -0
  190. package/dist/runtime/apps/mcp-server/acceptance-evidence.json +332 -0
  191. package/dist/runtime/apps/mcp-server/errorDiagnostics.js +32 -0
  192. package/dist/runtime/apps/mcp-server/examples/code-house.js +24 -0
  193. package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +85 -0
  194. package/dist/runtime/apps/mcp-server/main.mjs +82 -0
  195. package/dist/runtime/apps/mcp-server/registerTools.js +274 -0
  196. package/dist/runtime/apps/mcp-server/sandbox/run.mjs +23 -0
  197. package/dist/runtime/apps/mcp-server/security.js +23 -0
  198. package/dist/runtime/apps/mcp-server/tasks.jsonl +9 -0
  199. package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +157 -0
  200. package/dist/runtime/apps/server/README.md +7 -0
  201. package/dist/runtime/apps/server/WorldRepository.js +338 -0
  202. package/dist/runtime/apps/server/WorldRepositoryHttp.js +96 -0
  203. package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +278 -0
  204. package/dist/runtime/apps/server/tasks.jsonl +10 -0
  205. package/dist/runtime/apps/shared/node/WorldDiskStorage.js +62 -0
  206. package/dist/runtime/foundation/EventBus.js +26 -0
  207. package/dist/runtime/foundation/JsonGateway.js +47 -0
  208. package/dist/runtime/foundation/PngRgba.js +99 -0
  209. package/dist/runtime/foundation/PolicyEngine.js +21 -0
  210. package/dist/runtime/foundation/README.md +7 -0
  211. package/dist/runtime/foundation/TraceRecorder.js +76 -0
  212. package/dist/runtime/foundation/errors.js +8 -0
  213. package/dist/runtime/foundation/simulation/SimulationProfile.js +143 -0
  214. package/dist/runtime/foundation/version.js +2 -0
  215. package/dist/runtime/modules/agent/README.md +11 -0
  216. package/dist/runtime/modules/agent/ToolCallingAgent.js +19 -0
  217. package/dist/runtime/modules/agent/bootstrapWorld.js +10 -0
  218. package/dist/runtime/modules/agent/buildRecoveryProposals.js +533 -0
  219. package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +128 -0
  220. package/dist/runtime/modules/agent/execution/AgentRunResults.js +55 -0
  221. package/dist/runtime/modules/agent/execution/AgentRunSession.js +393 -0
  222. package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +40 -0
  223. package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +19 -0
  224. package/dist/runtime/modules/agent/prompt/index.js +52 -0
  225. package/dist/runtime/modules/agent/tasks.jsonl +94 -0
  226. package/dist/runtime/modules/artifact/ArtifactContentGate.js +144 -0
  227. package/dist/runtime/modules/artifact/ArtifactDescriptor.js +280 -0
  228. package/dist/runtime/modules/artifact/ArtifactImporter.js +185 -0
  229. package/dist/runtime/modules/artifact/ArtifactModule.js +111 -0
  230. package/dist/runtime/modules/artifact/ArtifactRegistry.js +197 -0
  231. package/dist/runtime/modules/artifact/IncrementalSha256.js +129 -0
  232. package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +115 -0
  233. package/dist/runtime/modules/artifact/README.md +7 -0
  234. package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +67 -0
  235. package/dist/runtime/modules/artifact/tasks.jsonl +31 -0
  236. package/dist/runtime/modules/asset/AssetModule.js +416 -0
  237. package/dist/runtime/modules/asset/README.md +67 -0
  238. package/dist/runtime/modules/asset/loading/AssetLoader.js +157 -0
  239. package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +61 -0
  240. package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +95 -0
  241. package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +33 -0
  242. package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +103 -0
  243. package/dist/runtime/modules/asset/model/AssetInputContracts.js +139 -0
  244. package/dist/runtime/modules/asset/model/AssetRef.js +12 -0
  245. package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +172 -0
  246. package/dist/runtime/modules/asset/model/ProceduralTextureContract.js +24 -0
  247. package/dist/runtime/modules/asset/model/admission.js +117 -0
  248. package/dist/runtime/modules/asset/model/errors.js +6 -0
  249. package/dist/runtime/modules/asset/model/parts.js +27 -0
  250. package/dist/runtime/modules/asset/model/resourceBudget.js +10 -0
  251. package/dist/runtime/modules/asset/model/schema.js +150 -0
  252. package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +78 -0
  253. package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +84 -0
  254. package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +86 -0
  255. package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +81 -0
  256. package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +272 -0
  257. package/dist/runtime/modules/asset/production/AssetRecipe.js +91 -0
  258. package/dist/runtime/modules/asset/production/ProceduralTexture.js +85 -0
  259. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +45 -0
  260. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +590 -0
  261. package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +173 -0
  262. package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +124 -0
  263. package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +56 -0
  264. package/dist/runtime/modules/asset/production/compiler/gltfIO.js +6 -0
  265. package/dist/runtime/modules/asset/production/compiler/partGeometry.js +74 -0
  266. package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +63 -0
  267. package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +48 -0
  268. package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +16 -0
  269. package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +30 -0
  270. package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +75 -0
  271. package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +20 -0
  272. package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +34 -0
  273. package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +32 -0
  274. package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +116 -0
  275. package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +84 -0
  276. package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +63 -0
  277. package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +16 -0
  278. package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +23 -0
  279. package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +50 -0
  280. package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +60 -0
  281. package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +93 -0
  282. package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +32 -0
  283. package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +55 -0
  284. package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +203 -0
  285. package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +43 -0
  286. package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +33 -0
  287. package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +60 -0
  288. package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +23 -0
  289. package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +198 -0
  290. package/dist/runtime/modules/asset/registry/AssetCatalog.js +72 -0
  291. package/dist/runtime/modules/asset/registry/AssetRegistry.js +51 -0
  292. package/dist/runtime/modules/asset/registry/manifests/index.js +173 -0
  293. package/dist/runtime/modules/asset/tasks.jsonl +87 -0
  294. package/dist/runtime/modules/generation/README.md +9 -0
  295. package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +45 -0
  296. package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +169 -0
  297. package/dist/runtime/modules/generation/connector/ConnectorClient.js +192 -0
  298. package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +167 -0
  299. package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +179 -0
  300. package/dist/runtime/modules/generation/connector/ConnectorSession.js +202 -0
  301. package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +239 -0
  302. package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +99 -0
  303. package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +91 -0
  304. package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +50 -0
  305. package/dist/runtime/modules/generation/providers/ProviderRegistry.js +304 -0
  306. package/dist/runtime/modules/generation/tasks.jsonl +35 -0
  307. package/dist/runtime/modules/navigation/NavigationBackend.js +17 -0
  308. package/dist/runtime/modules/navigation/RecastNavigationBackend.js +263 -0
  309. package/dist/runtime/modules/physics/JoltPhysicsBackend.js +850 -0
  310. package/dist/runtime/modules/physics/PhysicsApiSurface.js +660 -0
  311. package/dist/runtime/modules/physics/PhysicsBackend.js +88 -0
  312. package/dist/runtime/modules/physics/RapierPhysicsBackend.js +414 -0
  313. package/dist/runtime/modules/rendering/README.md +7 -0
  314. package/dist/runtime/modules/rendering/RendererProbe.js +153 -0
  315. package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +140 -0
  316. package/dist/runtime/modules/rendering/captureStill.js +54 -0
  317. package/dist/runtime/modules/rendering/createRenderer.js +76 -0
  318. package/dist/runtime/modules/rendering/disposeObject3D.js +37 -0
  319. package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +74 -0
  320. package/dist/runtime/modules/rendering/spatial/ThreeBvhRuntime.js +107 -0
  321. package/dist/runtime/modules/rendering/style/StylePack.js +34 -0
  322. package/dist/runtime/modules/rendering/style/StyleSystem.js +173 -0
  323. package/dist/runtime/modules/rendering/tasks.jsonl +7 -0
  324. package/dist/runtime/modules/world/README.md +13 -0
  325. package/dist/runtime/modules/world/build/WorldBuilder.js +170 -0
  326. package/dist/runtime/modules/world/compiler/PipelineEngine.js +32 -0
  327. package/dist/runtime/modules/world/compiler/WorldAdmission.js +43 -0
  328. package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +68 -0
  329. package/dist/runtime/modules/world/compiler/WorldCompilation.js +157 -0
  330. package/dist/runtime/modules/world/compiler/WorldComposer.js +201 -0
  331. package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +76 -0
  332. package/dist/runtime/modules/world/compiler/WorldRecompiler.js +356 -0
  333. package/dist/runtime/modules/world/compiler/WorldRetry.js +75 -0
  334. package/dist/runtime/modules/world/compiler/createWorldPipeline.js +379 -0
  335. package/dist/runtime/modules/world/content/blankWorld.js +35 -0
  336. package/dist/runtime/modules/world/content/environments.js +84 -0
  337. package/dist/runtime/modules/world/content/grandUrbanBlock.js +189 -0
  338. package/dist/runtime/modules/world/content/magic-cabin/README.md +28 -0
  339. package/dist/runtime/modules/world/content/magic-cabin/affordances.js +64 -0
  340. package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +7078 -0
  341. package/dist/runtime/modules/world/content/magic-cabin/lighting.js +26 -0
  342. package/dist/runtime/modules/world/content/magic-cabin/materials.js +20 -0
  343. package/dist/runtime/modules/world/content/magicCabin.js +190 -0
  344. package/dist/runtime/modules/world/content/monumentHall.js +154 -0
  345. package/dist/runtime/modules/world/content/ruinedCourtyard.js +196 -0
  346. package/dist/runtime/modules/world/content/suzhouGarden/README.md +141 -0
  347. package/dist/runtime/modules/world/content/suzhouGarden/index.js +137 -0
  348. package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +491 -0
  349. package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +670 -0
  350. package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +578 -0
  351. package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +127 -0
  352. package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +642 -0
  353. package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +650 -0
  354. package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +280 -0
  355. package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +242 -0
  356. package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +215 -0
  357. package/dist/runtime/modules/world/content/woodlandWorkshop.js +192 -0
  358. package/dist/runtime/modules/world/content/yuanmingyuan/README.md +36 -0
  359. package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +351 -0
  360. package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +490 -0
  361. package/dist/runtime/modules/world/content/yuanmingyuan/core.js +505 -0
  362. package/dist/runtime/modules/world/content/yuanmingyuan/index.js +101 -0
  363. package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +435 -0
  364. package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +169 -0
  365. package/dist/runtime/modules/world/content/yuanmingyuan/water.js +245 -0
  366. package/dist/runtime/modules/world/errors.js +9 -0
  367. package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +50 -0
  368. package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +297 -0
  369. package/dist/runtime/modules/world/runtime/CommandHistory.js +111 -0
  370. package/dist/runtime/modules/world/runtime/EntityCapabilityRegistry.js +165 -0
  371. package/dist/runtime/modules/world/runtime/NativeNavigationGeometry.js +84 -0
  372. package/dist/runtime/modules/world/runtime/NativePhysicsSnapshot.js +245 -0
  373. package/dist/runtime/modules/world/runtime/ObjectStore.js +31 -0
  374. package/dist/runtime/modules/world/runtime/ObjectTransform.js +62 -0
  375. package/dist/runtime/modules/world/runtime/ObservedEntity.js +37 -0
  376. package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +240 -0
  377. package/dist/runtime/modules/world/runtime/SceneExtensions.js +36 -0
  378. package/dist/runtime/modules/world/runtime/ScenePresentation.js +101 -0
  379. package/dist/runtime/modules/world/runtime/SceneSerializer.js +281 -0
  380. package/dist/runtime/modules/world/runtime/WorldAuthority.js +41 -0
  381. package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +14 -0
  382. package/dist/runtime/modules/world/runtime/WorldCommands.js +503 -0
  383. package/dist/runtime/modules/world/runtime/WorldObservation.js +71 -0
  384. package/dist/runtime/modules/world/runtime/WorldQueries.js +340 -0
  385. package/dist/runtime/modules/world/runtime/WorldRecovery.js +78 -0
  386. package/dist/runtime/modules/world/runtime/WorldRuntime.js +806 -0
  387. package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +110 -0
  388. package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +130 -0
  389. package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +79 -0
  390. package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +195 -0
  391. package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +70 -0
  392. package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +115 -0
  393. package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +390 -0
  394. package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +214 -0
  395. package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +65 -0
  396. package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +244 -0
  397. package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +147 -0
  398. package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +57 -0
  399. package/dist/runtime/modules/world/runtime/interaction/ManipulationActions.js +7 -0
  400. package/dist/runtime/modules/world/runtime/interaction/NativePhysicalTarget.js +31 -0
  401. package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +123 -0
  402. package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +134 -0
  403. package/dist/runtime/modules/world/runtime/semantic/NativePhysicsState.js +89 -0
  404. package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +129 -0
  405. package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +89 -0
  406. package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +104 -0
  407. package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +269 -0
  408. package/dist/runtime/modules/world/runtime/simulation/WorldTimeline.js +110 -0
  409. package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +56 -0
  410. package/dist/runtime/modules/world/runtime/spatial/VisualMeshBounds.js +41 -0
  411. package/dist/runtime/modules/world/runtime/systems/AudioSystem.js +306 -0
  412. package/dist/runtime/modules/world/runtime/systems/Instrument.js +39 -0
  413. package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +806 -0
  414. package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +281 -0
  415. package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +561 -0
  416. package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +1752 -0
  417. package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +527 -0
  418. package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +402 -0
  419. package/dist/runtime/modules/world/spec/WorldIR.js +165 -0
  420. package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +86 -0
  421. package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +51 -0
  422. package/dist/runtime/modules/world/spec/WorldRevision.js +231 -0
  423. package/dist/runtime/modules/world/spec/WorldSpec.js +86 -0
  424. package/dist/runtime/modules/world/tasks.jsonl +530 -0
  425. package/dist/runtime/modules/world/verification/ArticulationVerifier.js +254 -0
  426. package/dist/runtime/modules/world/verification/Finding.js +105 -0
  427. package/dist/runtime/modules/world/verification/InteractionEvidence.js +73 -0
  428. package/dist/runtime/modules/world/verification/RepairEngine.js +49 -0
  429. package/dist/runtime/modules/world/verification/VisualLayoutAcceptance.js +58 -0
  430. package/dist/runtime/modules/world/verification/WorldAcceptance.js +176 -0
  431. package/dist/runtime/modules/world/verification/WorldValidator.js +67 -0
  432. package/dist/runtime/package-lock.json +16071 -0
  433. package/dist/runtime/package.json +106 -0
  434. package/dist/runtime/public/assets/cabinet.glb +0 -0
  435. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
  436. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
  437. package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
  438. package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
  439. package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
  440. package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
  441. package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
  442. package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
  443. package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
  444. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
  445. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
  446. package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
  447. package/dist/schema-DT7K9NjP.js +165 -0
  448. package/dist/schema-DT7K9NjP.js.map +1 -0
  449. package/dist/suzhouGarden-Y3hny8j6.js +6150 -0
  450. package/dist/suzhouGarden-Y3hny8j6.js.map +1 -0
  451. package/dist/version-CHc-i8ch.js +5 -0
  452. package/dist/version-CHc-i8ch.js.map +1 -0
  453. package/dist/woodlandWorkshop-DsScU-cx.js +483 -0
  454. package/dist/woodlandWorkshop-DsScU-cx.js.map +1 -0
  455. package/dist/yuanmingyuan-DsFnPzzR.js +4955 -0
  456. package/dist/yuanmingyuan-DsFnPzzR.js.map +1 -0
  457. package/package.json +75 -4
@@ -0,0 +1,280 @@
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
+ }
@@ -0,0 +1,242 @@
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
+ }