@3driseai/3drise-viewer 0.1.6 → 0.1.8

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 (277) hide show
  1. package/dist/components/Clouds.d.ts.map +1 -1
  2. package/dist/components/Clouds.js +0 -1
  3. package/dist/components/CloudsGenerator.d.ts +32 -0
  4. package/dist/components/CloudsGenerator.d.ts.map +1 -0
  5. package/dist/components/CloudsGenerator.js +58 -0
  6. package/dist/components/CustomPrimitive.js +1 -1
  7. package/dist/components/EnvironmentManager.d.ts +47 -5
  8. package/dist/components/EnvironmentManager.d.ts.map +1 -1
  9. package/dist/components/EnvironmentManager.js +35 -66
  10. package/dist/components/GeometryShape.d.ts.map +1 -1
  11. package/dist/components/GeometryShape.js +19 -3
  12. package/dist/components/HdrEnvironment.d.ts +20 -0
  13. package/dist/components/HdrEnvironment.d.ts.map +1 -0
  14. package/dist/components/HdrEnvironment.js +44 -0
  15. package/dist/components/LandscapeBuilder.d.ts +23 -0
  16. package/dist/components/LandscapeBuilder.d.ts.map +1 -0
  17. package/dist/components/LandscapeBuilder.js +25 -0
  18. package/dist/components/LandscapeObject.d.ts +24 -0
  19. package/dist/components/LandscapeObject.d.ts.map +1 -0
  20. package/dist/components/LandscapeObject.js +27 -0
  21. package/dist/components/ObjectNode.d.ts.map +1 -1
  22. package/dist/components/ObjectNode.js +11 -9
  23. package/dist/components/OceanBuilder.d.ts +35 -0
  24. package/dist/components/OceanBuilder.d.ts.map +1 -0
  25. package/dist/components/OceanBuilder.js +53 -0
  26. package/dist/components/ParticlesR3f.d.ts.map +1 -1
  27. package/dist/components/ParticlesR3f.js +63 -12
  28. package/dist/components/PointCloud.d.ts.map +1 -1
  29. package/dist/components/PointCloud.js +50 -10
  30. package/dist/components/SceneBuilder.d.ts.map +1 -1
  31. package/dist/components/SkySystem.d.ts +27 -6
  32. package/dist/components/SkySystem.d.ts.map +1 -1
  33. package/dist/components/SkySystem.js +6 -5
  34. package/dist/components/SunLight.d.ts.map +1 -1
  35. package/dist/components/SunLight.js +4 -1
  36. package/dist/components/TerrainBuilder.d.ts +30 -0
  37. package/dist/components/TerrainBuilder.d.ts.map +1 -0
  38. package/dist/components/TerrainBuilder.js +44 -0
  39. package/dist/components/index.d.ts +17 -1
  40. package/dist/components/index.d.ts.map +1 -1
  41. package/dist/components/index.js +10 -0
  42. package/dist/components/landscape/LandscapeMesh.d.ts +18 -0
  43. package/dist/components/landscape/LandscapeMesh.d.ts.map +1 -0
  44. package/dist/components/landscape/LandscapeMesh.js +278 -0
  45. package/dist/components/landscape/index.d.ts +3 -0
  46. package/dist/components/landscape/index.d.ts.map +1 -0
  47. package/dist/components/landscape/index.js +1 -0
  48. package/dist/components/landscape/types.d.ts +13 -0
  49. package/dist/components/landscape/types.d.ts.map +1 -0
  50. package/dist/components/landscape/types.js +1 -0
  51. package/dist/components/terrain/Canyon.d.ts +23 -0
  52. package/dist/components/terrain/Canyon.d.ts.map +1 -0
  53. package/dist/components/terrain/Canyon.js +29 -0
  54. package/dist/components/terrain/Dunes.d.ts +22 -0
  55. package/dist/components/terrain/Dunes.d.ts.map +1 -0
  56. package/dist/components/terrain/Dunes.js +25 -0
  57. package/dist/components/terrain/Hills.d.ts +17 -0
  58. package/dist/components/terrain/Hills.d.ts.map +1 -0
  59. package/dist/components/terrain/Hills.js +20 -0
  60. package/dist/components/terrain/Mountains.d.ts +19 -0
  61. package/dist/components/terrain/Mountains.d.ts.map +1 -0
  62. package/dist/components/terrain/Mountains.js +22 -0
  63. package/dist/components/terrain/TerrainSurface.d.ts +22 -0
  64. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -0
  65. package/dist/components/terrain/TerrainSurface.js +94 -0
  66. package/dist/components/terrain/index.d.ts +7 -0
  67. package/dist/components/terrain/index.d.ts.map +1 -0
  68. package/dist/components/terrain/index.js +7 -0
  69. package/dist/components/terrain/types.d.ts +17 -0
  70. package/dist/components/terrain/types.d.ts.map +1 -0
  71. package/dist/components/terrain/types.js +1 -0
  72. package/dist/components/volumetricClouds/Cirrus.d.ts +14 -0
  73. package/dist/components/volumetricClouds/Cirrus.d.ts.map +1 -0
  74. package/dist/components/volumetricClouds/Cirrus.js +13 -0
  75. package/dist/components/volumetricClouds/Cumulonimbus.d.ts +17 -0
  76. package/dist/components/volumetricClouds/Cumulonimbus.d.ts.map +1 -0
  77. package/dist/components/volumetricClouds/Cumulonimbus.js +20 -0
  78. package/dist/components/volumetricClouds/Cumulus.d.ts +14 -0
  79. package/dist/components/volumetricClouds/Cumulus.d.ts.map +1 -0
  80. package/dist/components/volumetricClouds/Cumulus.js +17 -0
  81. package/dist/components/volumetricClouds/Stratocumulus.d.ts +12 -0
  82. package/dist/components/volumetricClouds/Stratocumulus.d.ts.map +1 -0
  83. package/dist/components/volumetricClouds/Stratocumulus.js +16 -0
  84. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +42 -0
  85. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -0
  86. package/dist/components/volumetricClouds/VolumetricCloudsPass.js +298 -0
  87. package/dist/components/volumetricClouds/index.d.ts +8 -0
  88. package/dist/components/volumetricClouds/index.d.ts.map +1 -0
  89. package/dist/components/volumetricClouds/index.js +7 -0
  90. package/dist/components/volumetricClouds/types.d.ts +17 -0
  91. package/dist/components/volumetricClouds/types.d.ts.map +1 -0
  92. package/dist/components/volumetricClouds/types.js +1 -0
  93. package/dist/components/water/Host.d.ts +12 -0
  94. package/dist/components/water/Host.d.ts.map +1 -0
  95. package/dist/components/water/Host.js +12 -0
  96. package/dist/components/water/Lake.d.ts +18 -0
  97. package/dist/components/water/Lake.d.ts.map +1 -0
  98. package/dist/components/water/Lake.js +21 -0
  99. package/dist/components/water/OceanSurface.d.ts +27 -0
  100. package/dist/components/water/OceanSurface.d.ts.map +1 -0
  101. package/dist/components/water/OceanSurface.js +60 -0
  102. package/dist/components/water/Sea.d.ts +18 -0
  103. package/dist/components/water/Sea.d.ts.map +1 -0
  104. package/dist/components/water/Sea.js +17 -0
  105. package/dist/components/water/Shore.d.ts +16 -0
  106. package/dist/components/water/Shore.d.ts.map +1 -0
  107. package/dist/components/water/Shore.js +15 -0
  108. package/dist/components/water/Storm.d.ts +14 -0
  109. package/dist/components/water/Storm.d.ts.map +1 -0
  110. package/dist/components/water/Storm.js +13 -0
  111. package/dist/components/water/WaterBody.d.ts +31 -0
  112. package/dist/components/water/WaterBody.d.ts.map +1 -0
  113. package/dist/components/water/WaterBody.js +76 -0
  114. package/dist/components/water/index.d.ts +9 -0
  115. package/dist/components/water/index.d.ts.map +1 -0
  116. package/dist/components/water/index.js +11 -0
  117. package/dist/components/water/types.d.ts +20 -0
  118. package/dist/components/water/types.d.ts.map +1 -0
  119. package/dist/components/water/types.js +1 -0
  120. package/dist/constants.d.ts +1 -0
  121. package/dist/constants.d.ts.map +1 -1
  122. package/dist/constants.js +15 -0
  123. package/dist/hooks/index.d.ts +24 -1
  124. package/dist/hooks/index.d.ts.map +1 -1
  125. package/dist/hooks/index.js +12 -0
  126. package/dist/hooks/useClipmap.d.ts +71 -0
  127. package/dist/hooks/useClipmap.d.ts.map +1 -0
  128. package/dist/hooks/useClipmap.js +81 -0
  129. package/dist/hooks/useCloudLive.d.ts +29 -0
  130. package/dist/hooks/useCloudLive.d.ts.map +1 -0
  131. package/dist/hooks/useCloudLive.js +43 -0
  132. package/dist/hooks/useCloudNoise.d.ts +28 -0
  133. package/dist/hooks/useCloudNoise.d.ts.map +1 -0
  134. package/dist/hooks/useCloudNoise.js +128 -0
  135. package/dist/hooks/useCloudSun.d.ts +49 -0
  136. package/dist/hooks/useCloudSun.d.ts.map +1 -0
  137. package/dist/hooks/useCloudSun.js +84 -0
  138. package/dist/hooks/useCubeCamera.d.ts +27 -9
  139. package/dist/hooks/useCubeCamera.d.ts.map +1 -1
  140. package/dist/hooks/useCubeCamera.js +28 -70
  141. package/dist/hooks/useEnvironmentProbe.d.ts +32 -0
  142. package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -0
  143. package/dist/hooks/useEnvironmentProbe.js +35 -0
  144. package/dist/hooks/useFrameRenderer.d.ts +15 -0
  145. package/dist/hooks/useFrameRenderer.d.ts.map +1 -0
  146. package/dist/hooks/useFrameRenderer.js +23 -0
  147. package/dist/hooks/useLandscapeLive.d.ts +29 -0
  148. package/dist/hooks/useLandscapeLive.d.ts.map +1 -0
  149. package/dist/hooks/useLandscapeLive.js +41 -0
  150. package/dist/hooks/useLandscapeMaps.d.ts +32 -0
  151. package/dist/hooks/useLandscapeMaps.d.ts.map +1 -0
  152. package/dist/hooks/useLandscapeMaps.js +138 -0
  153. package/dist/hooks/useMaterialApplication.d.ts.map +1 -1
  154. package/dist/hooks/useMaterialApplication.js +2 -3
  155. package/dist/hooks/useMaterialOptions.d.ts +2 -2
  156. package/dist/hooks/useMaterialOptions.d.ts.map +1 -1
  157. package/dist/hooks/useMaterialOptions.js +13 -31
  158. package/dist/hooks/useObjectEdges.d.ts.map +1 -1
  159. package/dist/hooks/useObjectEdges.js +3 -49
  160. package/dist/hooks/useOceanLive.d.ts +29 -0
  161. package/dist/hooks/useOceanLive.d.ts.map +1 -0
  162. package/dist/hooks/useOceanLive.js +38 -0
  163. package/dist/hooks/useOceanMaterial.d.ts +39 -0
  164. package/dist/hooks/useOceanMaterial.d.ts.map +1 -0
  165. package/dist/hooks/useOceanMaterial.js +65 -0
  166. package/dist/hooks/useTerrainClipmap.d.ts +12 -0
  167. package/dist/hooks/useTerrainClipmap.d.ts.map +1 -0
  168. package/dist/hooks/useTerrainClipmap.js +10 -0
  169. package/dist/hooks/useTerrainLive.d.ts +34 -0
  170. package/dist/hooks/useTerrainLive.d.ts.map +1 -0
  171. package/dist/hooks/useTerrainLive.js +45 -0
  172. package/dist/index.d.ts +26 -0
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +16 -0
  175. package/dist/presets/landscapePresets.d.ts +60 -0
  176. package/dist/presets/landscapePresets.d.ts.map +1 -0
  177. package/dist/presets/landscapePresets.js +194 -0
  178. package/dist/presets/landscapeTypes.d.ts +195 -0
  179. package/dist/presets/landscapeTypes.d.ts.map +1 -0
  180. package/dist/presets/landscapeTypes.js +315 -0
  181. package/dist/presets/oceanSurfacePresets.d.ts +33 -0
  182. package/dist/presets/oceanSurfacePresets.d.ts.map +1 -0
  183. package/dist/presets/oceanSurfacePresets.js +245 -0
  184. package/dist/presets/terrainPresets.d.ts +28 -0
  185. package/dist/presets/terrainPresets.d.ts.map +1 -0
  186. package/dist/presets/terrainPresets.js +293 -0
  187. package/dist/presets/volumetricCloudPresets.d.ts +38 -0
  188. package/dist/presets/volumetricCloudPresets.d.ts.map +1 -0
  189. package/dist/presets/volumetricCloudPresets.js +480 -0
  190. package/dist/shaders/clouds/CirrusMaterial.d.ts +84 -0
  191. package/dist/shaders/clouds/CirrusMaterial.d.ts.map +1 -0
  192. package/dist/shaders/clouds/CirrusMaterial.js +167 -0
  193. package/dist/shaders/clouds/CloudCompositeMaterial.d.ts +20 -0
  194. package/dist/shaders/clouds/CloudCompositeMaterial.d.ts.map +1 -0
  195. package/dist/shaders/clouds/CloudCompositeMaterial.js +82 -0
  196. package/dist/shaders/clouds/CloudResolveMaterial.d.ts +22 -0
  197. package/dist/shaders/clouds/CloudResolveMaterial.d.ts.map +1 -0
  198. package/dist/shaders/clouds/CloudResolveMaterial.js +77 -0
  199. package/dist/shaders/clouds/CloudVolumeMaterial.d.ts +143 -0
  200. package/dist/shaders/clouds/CloudVolumeMaterial.d.ts.map +1 -0
  201. package/dist/shaders/clouds/CloudVolumeMaterial.js +249 -0
  202. package/dist/shaders/clouds/SkyBackgroundMaterial.d.ts +21 -0
  203. package/dist/shaders/clouds/SkyBackgroundMaterial.d.ts.map +1 -0
  204. package/dist/shaders/clouds/SkyBackgroundMaterial.js +42 -0
  205. package/dist/shaders/glsl/cloudCore.glsl.d.ts +24 -0
  206. package/dist/shaders/glsl/cloudCore.glsl.d.ts.map +1 -0
  207. package/dist/shaders/glsl/cloudCore.glsl.js +348 -0
  208. package/dist/shaders/glsl/landscapeCore.glsl.d.ts +49 -0
  209. package/dist/shaders/glsl/landscapeCore.glsl.d.ts.map +1 -0
  210. package/dist/shaders/glsl/landscapeCore.glsl.js +518 -0
  211. package/dist/shaders/glsl/noiseBake.glsl.d.ts +30 -0
  212. package/dist/shaders/glsl/noiseBake.glsl.d.ts.map +1 -0
  213. package/dist/shaders/glsl/noiseBake.glsl.js +164 -0
  214. package/dist/shaders/glsl/oceanCore.glsl.d.ts +52 -0
  215. package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -0
  216. package/dist/shaders/glsl/oceanCore.glsl.js +421 -0
  217. package/dist/shaders/glsl/terrainCore.glsl.d.ts +78 -0
  218. package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -0
  219. package/dist/shaders/glsl/terrainCore.glsl.js +625 -0
  220. package/dist/shaders/landscape/LandscapeMaterial.d.ts +73 -0
  221. package/dist/shaders/landscape/LandscapeMaterial.d.ts.map +1 -0
  222. package/dist/shaders/landscape/LandscapeMaterial.js +136 -0
  223. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +57 -0
  224. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -0
  225. package/dist/shaders/ocean/OceanSurfaceMaterial.js +268 -0
  226. package/dist/shaders/terrain/TerrainMaterial.d.ts +80 -0
  227. package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -0
  228. package/dist/shaders/terrain/TerrainMaterial.js +291 -0
  229. package/dist/types/cloudConfigs.d.ts +244 -0
  230. package/dist/types/cloudConfigs.d.ts.map +1 -0
  231. package/dist/types/cloudConfigs.js +282 -0
  232. package/dist/types/index.d.ts +8 -0
  233. package/dist/types/index.d.ts.map +1 -1
  234. package/dist/types/index.js +4 -1
  235. package/dist/types/landscapeConfigs.d.ts +218 -0
  236. package/dist/types/landscapeConfigs.d.ts.map +1 -0
  237. package/dist/types/landscapeConfigs.js +256 -0
  238. package/dist/types/oceanConfigs.d.ts +290 -0
  239. package/dist/types/oceanConfigs.d.ts.map +1 -0
  240. package/dist/types/oceanConfigs.js +380 -0
  241. package/dist/types/terrainConfigs.d.ts +251 -0
  242. package/dist/types/terrainConfigs.d.ts.map +1 -0
  243. package/dist/types/terrainConfigs.js +292 -0
  244. package/dist/utils/cloudUniforms.d.ts +14 -0
  245. package/dist/utils/cloudUniforms.d.ts.map +1 -0
  246. package/dist/utils/cloudUniforms.js +122 -0
  247. package/dist/utils/frameRenderer.d.ts +33 -0
  248. package/dist/utils/frameRenderer.d.ts.map +1 -0
  249. package/dist/utils/frameRenderer.js +24 -0
  250. package/dist/utils/handleCloudsAnimations.d.ts +16 -0
  251. package/dist/utils/handleCloudsAnimations.d.ts.map +1 -0
  252. package/dist/utils/handleCloudsAnimations.js +64 -0
  253. package/dist/utils/landscapeGeometry.d.ts +61 -0
  254. package/dist/utils/landscapeGeometry.d.ts.map +1 -0
  255. package/dist/utils/landscapeGeometry.js +126 -0
  256. package/dist/utils/landscapeHeight.d.ts +44 -0
  257. package/dist/utils/landscapeHeight.d.ts.map +1 -0
  258. package/dist/utils/landscapeHeight.js +65 -0
  259. package/dist/utils/landscapeTextures.d.ts +94 -0
  260. package/dist/utils/landscapeTextures.d.ts.map +1 -0
  261. package/dist/utils/landscapeTextures.js +290 -0
  262. package/dist/utils/landscapeUniforms.d.ts +20 -0
  263. package/dist/utils/landscapeUniforms.d.ts.map +1 -0
  264. package/dist/utils/landscapeUniforms.js +61 -0
  265. package/dist/utils/oceanUniforms.d.ts +47 -0
  266. package/dist/utils/oceanUniforms.d.ts.map +1 -0
  267. package/dist/utils/oceanUniforms.js +216 -0
  268. package/dist/utils/pointsMaterialOwnership.d.ts +9 -0
  269. package/dist/utils/pointsMaterialOwnership.d.ts.map +1 -0
  270. package/dist/utils/pointsMaterialOwnership.js +14 -0
  271. package/dist/utils/rtin.d.ts +63 -0
  272. package/dist/utils/rtin.d.ts.map +1 -0
  273. package/dist/utils/rtin.js +202 -0
  274. package/dist/utils/terrainUniforms.d.ts +14 -0
  275. package/dist/utils/terrainUniforms.d.ts.map +1 -0
  276. package/dist/utils/terrainUniforms.js +196 -0
  277. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmFD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsLjC,CAAC;AACF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmFD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqLjC,CAAC;AACF,eAAe,MAAM,CAAC"}
@@ -185,7 +185,6 @@ const Clouds = ({ settings, timeSettings = defaultTimeSettings, onObjectReady, o
185
185
  return;
186
186
  const now = Date.now();
187
187
  const pointer = state.pointer;
188
- // ── PER-DOMAIN ANIMATIONS ────────────────────────────────────────────────
189
188
  const mouseMove = settings.mouseMove;
190
189
  // const isPerDomain = mm && ('transform' in mm || 'material' in mm || 'edges' in mm || 'light' in mm || 'clouds' in mm);
191
190
  // transform: position / rotation / scale
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import type { SkySettings, TimeSettings } from '@3driseai/3drise-core';
3
+ import type { ObjectReadyProps } from '../types/objectReady';
4
+ import type { VolumetricCloudsSettings } from '../types/cloudConfigs';
5
+ export interface CloudsGeneratorProps extends ObjectReadyProps {
6
+ /** Accepts a partial or older-shaped blob: a published scene loads whatever was
7
+ * saved the day it was authored, and every block is merged over its defaults. */
8
+ settings?: Partial<VolumetricCloudsSettings> | null;
9
+ skySettings?: SkySettings;
10
+ timeSettings?: TimeSettings;
11
+ /** Matches SkySystem's sunIntensity, so clouds brighten with the rest of the scene. */
12
+ sunIntensity?: number;
13
+ }
14
+ /**
15
+ * Picks the cloud model for the scene's sky.
16
+ *
17
+ * A sky is a deck plus an optional ice layer, not one of four things — cirrus
18
+ * coexists with every other type in nature and in the renderer. So the deck's type
19
+ * selects the component, and cirrus rides along with whichever one is chosen. With
20
+ * the deck off, the cirrus-only branch runs a three-sample ice pass and skips the
21
+ * volumetric march entirely.
22
+ *
23
+ * Whichever branch is taken mounts exactly one render pass, which is the constraint
24
+ * that matters: the pass owns the render loop.
25
+ *
26
+ * Each block is memoised against its own source object, not against `settings`, so
27
+ * editing cirrus does not hand the deck a new config and restart its temporal
28
+ * accumulation.
29
+ */
30
+ declare const CloudsGenerator: React.FC<CloudsGeneratorProps>;
31
+ export default CloudsGenerator;
32
+ //# sourceMappingURL=CloudsGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloudsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/CloudsGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAOtE,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D;sFACkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4CnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { CLOUD_DECK_DEFAULTS, normalizeCirrus, normalizeCloudDeck, normalizeCloudQuality } from '../types/cloudConfigs.js';
4
+ import Cumulus from './volumetricClouds/Cumulus.js';
5
+ import Stratocumulus from './volumetricClouds/Stratocumulus.js';
6
+ import Cumulonimbus from './volumetricClouds/Cumulonimbus.js';
7
+ import Cirrus from './volumetricClouds/Cirrus.js';
8
+ /**
9
+ * Picks the cloud model for the scene's sky.
10
+ *
11
+ * A sky is a deck plus an optional ice layer, not one of four things — cirrus
12
+ * coexists with every other type in nature and in the renderer. So the deck's type
13
+ * selects the component, and cirrus rides along with whichever one is chosen. With
14
+ * the deck off, the cirrus-only branch runs a three-sample ice pass and skips the
15
+ * volumetric march entirely.
16
+ *
17
+ * Whichever branch is taken mounts exactly one render pass, which is the constraint
18
+ * that matters: the pass owns the render loop.
19
+ *
20
+ * Each block is memoised against its own source object, not against `settings`, so
21
+ * editing cirrus does not hand the deck a new config and restart its temporal
22
+ * accumulation.
23
+ */
24
+ const CloudsGenerator = ({ settings, skySettings, timeSettings, sunIntensity, onObjectReady, onObjectDispose, }) => {
25
+ const deck = useMemo(() => normalizeCloudDeck(settings?.config), [settings?.config]);
26
+ const cirrus = useMemo(() => normalizeCirrus(settings?.cirrus), [settings?.cirrus]);
27
+ const quality = useMemo(() => normalizeCloudQuality(settings?.quality), [settings?.quality]);
28
+ const deckOn = !!deck?.enabled;
29
+ const cirrusOn = !!cirrus?.enabled;
30
+ // The cirrus-only branch ignores the deck entirely (it passes deck={null} to the
31
+ // pass), but the shared prop shape still wants a real config rather than a
32
+ // non-null assertion over something that is genuinely absent.
33
+ const deckOrDefault = deck ?? { ...CLOUD_DECK_DEFAULTS.stratocumulus, enabled: false };
34
+ if (!deckOn && !cirrusOn)
35
+ return null;
36
+ const shared = {
37
+ deck: deckOrDefault,
38
+ cirrus: cirrusOn ? cirrus : null,
39
+ quality,
40
+ skySettings,
41
+ timeSettings,
42
+ sunIntensity,
43
+ animations: settings?.animations,
44
+ mouseMove: settings?.mouseMove,
45
+ id: settings?.id,
46
+ onObjectReady,
47
+ onObjectDispose,
48
+ };
49
+ if (!deckOn)
50
+ return _jsx(Cirrus, { ...shared });
51
+ switch (deckOrDefault.deckType) {
52
+ case 'cumulus': return _jsx(Cumulus, { ...shared });
53
+ case 'cumulonimbus': return _jsx(Cumulonimbus, { ...shared });
54
+ case 'stratocumulus':
55
+ default: return _jsx(Stratocumulus, { ...shared });
56
+ }
57
+ };
58
+ export default CloudsGenerator;
@@ -76,7 +76,7 @@ const CustomPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, h
76
76
  // mode = 'outline';
77
77
  // }
78
78
  if (createdObject.type === 'mesh')
79
- return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, onObjectReady: (_object, ref) => onObjectReady && onObjectReady(createdObject, ref), onObjectDispose: (_object, ref) => onObjectDispose && onObjectDispose(createdObject, ref), modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 } }) }, createdObject.id);
79
+ return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, onObjectReady: (_object, ref) => onObjectReady && onObjectReady(createdObject, ref), onObjectDispose: (_object, ref) => onObjectDispose && onObjectDispose(createdObject, ref), modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 }, children: useDreiMaterials && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }) }, createdObject.id);
80
80
  if (!resolvedObject) {
81
81
  return null;
82
82
  }
@@ -1,9 +1,51 @@
1
- import { type SkySystemProps } from './SkySystem';
2
- import type { EnvironmentConfig } from '@3driseai/3drise-core';
3
- export interface EnvironmentManagerProps extends SkySystemProps {
4
- environment?: EnvironmentConfig;
1
+ import React from 'react';
2
+ import { Vector3 } from 'three';
3
+ import { type SkySystemRef, type SkySystemProps } from './SkySystem';
4
+ import type { EnvironmentConfig, FogSettings, HdrSettings, SkySettings, TimeSettings } from '@3driseai/3drise-core';
5
+ import type { VolumetricCloudsSettings } from '../types/cloudConfigs';
6
+ import type { ProceduralTerrainSettings } from '../types/terrainConfigs';
7
+ import type { ObjectReadyProps } from '../types/objectReady';
8
+ /**
9
+ * The whole environment in one component: HDR background, image-based lighting,
10
+ * sky, sun, fog, clouds and terrain.
11
+ *
12
+ * This is the *composed* entry point, for SceneBuilder and for anyone embedding a
13
+ * published scene, where the settings arrive as one saved blob and nothing
14
+ * re-renders unless the project changes.
15
+ *
16
+ * A host with fine-grained reactive state — the editor — should compose the same
17
+ * pieces itself, one store subscription per slice, so a fog change cannot
18
+ * re-render the sun. Every piece here is exported for exactly that:
19
+ * HdrEnvironment, useEnvironmentProbe, SkySystem, SceneFog, CloudsGenerator,
20
+ * TerrainBuilder. Both paths run the same components; only the subscription
21
+ * granularity differs, and that is the only thing that should ever differ.
22
+ */
23
+ /** core's EnvironmentConfig still types `clouds` as the retired CloudsSettings.
24
+ * Narrowed here rather than in core, which cannot reference the viewer's cloud
25
+ * types — they live next to the shader that consumes them. */
26
+ export type ViewerEnvironmentConfig = Omit<EnvironmentConfig, 'clouds'> & {
27
+ clouds?: VolumetricCloudsSettings;
28
+ /** core's EnvironmentConfig has no terrain field at all, and its
29
+ * `TerrainSettings` is the retired flat shape. Declared here for the same
30
+ * reason `clouds` is narrowed here: the config type lives next to the shader
31
+ * that consumes it, and core cannot reference the viewer. */
32
+ terrain?: ProceduralTerrainSettings;
33
+ };
34
+ export interface EnvironmentManagerProps extends ObjectReadyProps {
35
+ timeSettings: TimeSettings;
36
+ /** Saved-project shape. Any discrete prop below overrides the matching field. */
37
+ environment?: ViewerEnvironmentConfig;
38
+ hdrSettings?: HdrSettings;
39
+ skySettings?: SkySettings;
40
+ cloudsSettings?: VolumetricCloudsSettings;
41
+ terrainSettings?: ProceduralTerrainSettings;
42
+ fogSettings?: FogSettings;
5
43
  cubeCameraResolution?: number;
44
+ skyboxScale?: number;
45
+ playerPosition?: Vector3;
46
+ onTimeOfDayChange?: SkySystemProps['onTimeOfDayChange'];
47
+ onTimeUpdate?: SkySystemProps['onTimeUpdate'];
6
48
  }
7
- declare const EnvironmentManager: any;
49
+ declare const EnvironmentManager: React.ForwardRefExoticComponent<EnvironmentManagerProps & React.RefAttributes<SkySystemRef>>;
8
50
  export default EnvironmentManager;
9
51
  //# sourceMappingURL=EnvironmentManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"AAIA,OAAkB,EAAqB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAIhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,WAAW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BAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAoBD,QAAA,MAAM,kBAAkB,8FAwEtB,CAAC;AAGH,eAAe,kBAAkB,CAAC"}
@@ -1,74 +1,43 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, forwardRef } from 'react';
3
- import { Environment } from '@react-three/drei';
4
- import { useThree } from '@react-three/fiber';
2
+ import { forwardRef } from 'react';
5
3
  import { Vector3 } from 'three';
6
4
  import SkySystem from './SkySystem.js';
7
- import { useCubeCamera } from '../hooks/useCubeCamera.js';
8
- import HdrPlaylistRenderer from './HdrPlaylistRenderer.js';
9
- import { getTransitionSettings } from '@3driseai/3drise-core';
10
- const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512, timeSettings, onTimeOfDayChange, onTimeUpdate, onObjectReady, onObjectDispose, }, ref) => {
11
- const { scene } = useThree();
12
- const defaultHdr = {
13
- visible: false,
14
- name: null,
15
- settings: {
16
- groundRadius: 200,
17
- groundHeight: 10,
18
- groundScale: 100,
19
- blur: 0,
20
- backgroundBlurriness: 0,
21
- backgroundIntensity: 1,
22
- backgroundRotation: 0,
23
- environmentIntensity: 1,
24
- environmentRotation: 0,
25
- },
26
- };
27
- const hdr = environment?.hdr ?? defaultHdr;
28
- const backgroundName = hdr.visible ? hdr.name : null;
29
- const urls = hdr.urls;
30
- const playlistActive = !!urls && urls.length > 1;
31
- const singleUrl = urls && urls.length === 1 ? urls[0] : undefined;
32
- const hdrActive = !!(backgroundName || singleUrl || playlistActive);
33
- const sky = environment?.sky;
34
- const sunSystemVisible = sky?.sunSystem?.visible;
35
- const sunSize = sky?.sunSystem?.sunSize;
36
- const moonSize = sky?.sunSystem?.moonSize;
37
- const skyboxScale = 100000;
38
- const sunIntensity = sky?.sunSystem?.intensity;
39
- const castShadow = sky?.sunSystem?.castShadow;
40
- const shadowMapSize = sky?.sunSystem?.shadowMapSize;
41
- const playerPosition = new Vector3(0, 0, 0);
42
- const starsSettings = environment?.stars;
43
- const cloudsSettings = environment?.clouds;
44
- const cloudsMaterialSettings = environment?.clouds?.materialSettings;
45
- const skyControllerSettings = sky && !sky.sunSystem.visible ? sky : undefined;
46
- const rainSettings = environment?.rain;
47
- const fogSettings = environment?.fog;
48
- useCubeCamera({
49
- hdrSettings: hdr,
50
- skyVisible: true,
51
- sunSystemVisible: sunSystemVisible ?? false,
52
- timeSettings,
5
+ import HdrEnvironment, { isHdrActive } from './HdrEnvironment.js';
6
+ import { useEnvironmentProbe } from '../hooks/useEnvironmentProbe.js';
7
+ import TerrainBuilder from './TerrainBuilder.js';
8
+ const DEFAULT_HDR = {
9
+ visible: false,
10
+ name: null,
11
+ settings: {
12
+ groundRadius: 200,
13
+ groundHeight: 10,
14
+ groundScale: 100,
15
+ blur: 0,
16
+ backgroundBlurriness: 0,
17
+ backgroundIntensity: 1,
18
+ backgroundRotation: 0,
19
+ environmentIntensity: 1,
20
+ environmentRotation: 0,
21
+ },
22
+ };
23
+ const ORIGIN = new Vector3(0, 0, 0);
24
+ const EnvironmentManager = forwardRef(({ timeSettings, environment, hdrSettings, skySettings, cloudsSettings, terrainSettings, fogSettings, cubeCameraResolution = 512, skyboxScale = 100000, playerPosition = ORIGIN, onTimeOfDayChange, onTimeUpdate, onObjectReady, onObjectDispose, }, ref) => {
25
+ const hdr = hdrSettings ?? environment?.hdr ?? DEFAULT_HDR;
26
+ const sky = skySettings ?? environment?.sky;
27
+ const clouds = cloudsSettings ?? environment?.clouds;
28
+ const terrain = terrainSettings ?? environment?.terrain;
29
+ const fog = fogSettings ?? environment?.fog;
30
+ const sunSystemVisible = !!sky?.sunSystem?.visible;
31
+ // Previously hardcoded true, which kept a cube camera alive — and re-captured
32
+ // its six faces — for scenes that have no sky at all.
33
+ const skyActive = !!sky?.visible || sunSystemVisible;
34
+ useEnvironmentProbe({
35
+ hdrActive: isHdrActive(hdr),
36
+ skyActive,
37
+ autoAnimate: !!timeSettings.autoAnimate,
53
38
  resolution: cubeCameraResolution,
54
39
  });
55
- // While the playlist is active, drei <Environment> unmounts; HdrPlaylistRenderer
56
- // owns scene.environment + scene.background for the duration of the transitions.
57
- const environmentComponent = useMemo(() => {
58
- if (playlistActive)
59
- return null;
60
- if (!singleUrl && !backgroundName)
61
- return null;
62
- const sourceProps = singleUrl
63
- ? { files: singleUrl }
64
- : { preset: backgroundName };
65
- return (_jsx(Environment, { ...sourceProps, background: true, scene: scene, backgroundBlurriness: hdr.settings.backgroundBlurriness ?? 0, backgroundIntensity: hdr.settings.backgroundIntensity ?? 1, backgroundRotation: [0, hdr.settings.backgroundRotation ?? Math.PI / 2, 0], environmentIntensity: hdr.settings.environmentIntensity ?? 1, environmentRotation: [0, hdr.settings.environmentRotation ?? Math.PI / 2, 0], blur: hdr.settings.blur ?? 0, ground: {
66
- radius: hdr.settings.groundRadius,
67
- height: hdr.settings.groundHeight,
68
- scale: hdr.settings.groundScale,
69
- } }));
70
- }, [playlistActive, singleUrl, backgroundName, hdr.settings, scene]);
71
- return (_jsxs(_Fragment, { children: [environmentComponent, playlistActive && urls && (_jsx(HdrPlaylistRenderer, { urls: urls, transition: getTransitionSettings(hdr), onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })), _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }));
40
+ return (_jsxs(_Fragment, { children: [_jsx(HdrEnvironment, { hdr: hdr, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(TerrainBuilder, { settings: terrain, skySettings: sky, timeSettings: timeSettings, sunIntensity: sky?.sunSystem?.intensity ?? 1, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sky?.sunSystem?.sunSize, moonSize: sky?.sunSystem?.moonSize, skyboxScale: skyboxScale, sunIntensity: sky?.sunSystem?.intensity ?? 1, castShadow: sky?.sunSystem?.castShadow, shadowMapSize: sky?.sunSystem?.shadowMapSize, playerPosition: playerPosition, cloudsSettings: clouds, skyControllerSettings: sky, fogSettings: fog, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }));
72
41
  });
73
42
  EnvironmentManager.displayName = 'EnvironmentManager';
74
43
  export default EnvironmentManager;
@@ -1 +1 @@
1
- {"version":3,"file":"GeometryShape.d.ts","sourceRoot":"","sources":["../../src/components/GeometryShape.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACjH,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnC,KAAK,QAAQ,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB,GAAG;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jectReady } from '../hooks/useObjectReady.js';
4
4
  import { EdgesGeometry, WireframeGeometry, Mesh, MeshBasicMaterial, Raycaster, Vector3, DoubleSide, } from 'three';
5
- import { Line } from '@react-three/drei';
5
+ import { buildSegmentQuadGeometry } from '@3driseai/3drise-core';
6
6
  import { shapeGenerators } from '../utils/shapes.js';
7
7
  import PointCloud from './PointCloud.js';
8
+ /**
9
+ * World-space half-thickness of a line ribbon at `lineWidth: 1`. Line modes are
10
+ * built as quad meshes rather than line primitives so that materials apply to
11
+ * them — see buildSegmentQuadGeometry — which means width is a world unit here,
12
+ * not a screen-space pixel count. Matches the edges builder's default.
13
+ */
14
+ const LINE_THICKNESS_UNIT = 0.008;
8
15
  const defaultModeConfig = {
9
16
  mode: 'solid',
10
17
  count: 1000,
@@ -312,13 +319,22 @@ export function GeometryMesh({ config, materialSettings, animations, modeConfig
312
319
  const geometry = useShapeGeometry(config);
313
320
  const safeModeConfig = normalizeModeConfig(modeConfig);
314
321
  const data = useModeData(geometry, safeModeConfig);
322
+ // Line modes are ribbons of quads, not line primitives, so the material
323
+ // system reaches them the same way it reaches edges. Built before the
324
+ // branches below because hooks cannot run conditionally.
325
+ const lineSegments = data.kind === 'lines' ? data.points : data.kind === 'plexus' ? data.segments : null;
326
+ const lineThickness = (safeModeConfig.lineWidth ?? 1) * LINE_THICKNESS_UNIT;
327
+ const lineGeometry = useMemo(() => (lineSegments && lineSegments.length
328
+ ? buildSegmentQuadGeometry(lineSegments, lineThickness)
329
+ : null), [lineSegments, lineThickness]);
330
+ useEffect(() => () => { lineGeometry?.dispose(); }, [lineGeometry]);
315
331
  // if (data.kind === 'points') return <PointCloud positions={data.positions} color={color} size={modeConfig.mode === 'vertices' ? 0.035 : 0.02} />;
316
332
  if (data.kind === 'points')
317
333
  return _jsx(PointCloud, { positions: data.positions, animations: animations, materialSettings: materialSettings, onObjectReady: reportReady, onObjectDispose: reportDispose });
318
334
  if (data.kind === 'lines')
319
- return data.points.length ? _jsx(Line, { ref: rootRef, points: data.points, segments: true, color: color, lineWidth: safeModeConfig.lineWidth }) : null;
335
+ return lineGeometry ? (_jsx("mesh", { ref: rootRef, geometry: lineGeometry, children: children ?? _jsx("meshBasicMaterial", { color: color, side: DoubleSide }) })) : null;
320
336
  if (data.kind === 'plexus')
321
- return (_jsxs("group", { ref: rootRef, children: [_jsx(PointCloud, { positions: data.positions, animations: animations, materialSettings: materialSettings }), data.segments.length > 0 && _jsx(Line, { points: data.segments, segments: true, color: color, lineWidth: safeModeConfig.lineWidth, transparent: true, opacity: 0.45 })] }));
337
+ return (_jsxs("group", { ref: rootRef, children: [_jsx(PointCloud, { positions: data.positions, animations: animations, materialSettings: materialSettings }), lineGeometry && (_jsx("mesh", { geometry: lineGeometry, children: children ?? _jsx("meshBasicMaterial", { color: color, side: DoubleSide, transparent: true, opacity: 0.45 }) }))] }));
322
338
  return (_jsx("mesh", { ref: rootRef, geometry: geometry, children: children ?? _jsx("meshPhongMaterial", { color: color, side: DoubleSide }) }));
323
339
  }
324
340
  export function FitGroup({ geometry, radius = 1.7, children }) {
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { HdrSettings } from '@3driseai/3drise-core';
3
+ import type { ObjectReadyProps } from '../types/objectReady';
4
+ /**
5
+ * The HDR background and the image-based lighting that comes with it.
6
+ *
7
+ * Split out of EnvironmentManager so the editor's HDR connector and a published
8
+ * scene render the identical thing from the identical settings object. One
9
+ * `<Environment>`, one set of prop defaults, one place to change them.
10
+ */
11
+ /** A background is active when something is actually going to be drawn: a named
12
+ * drei preset, a single URL, or a playlist. `visible` alone is not enough — it
13
+ * can be true with nothing selected. */
14
+ export declare function isHdrActive(hdr: HdrSettings): boolean;
15
+ export interface HdrEnvironmentProps extends ObjectReadyProps {
16
+ hdr: HdrSettings;
17
+ }
18
+ declare const HdrEnvironment: React.FC<HdrEnvironmentProps>;
19
+ export default HdrEnvironment;
20
+ //# sourceMappingURL=HdrEnvironment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HdrEnvironment.d.ts","sourceRoot":"","sources":["../../src/components/HdrEnvironment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;GAMG;AAEH;;yCAEyC;AACzC,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAIrD;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IACzD,GAAG,EAAE,WAAW,CAAC;CACpB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgDjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { Environment } from '@react-three/drei';
4
+ import { useThree } from '@react-three/fiber';
5
+ import { getTransitionSettings } from '@3driseai/3drise-core';
6
+ import HdrPlaylistRenderer from './HdrPlaylistRenderer.js';
7
+ /**
8
+ * The HDR background and the image-based lighting that comes with it.
9
+ *
10
+ * Split out of EnvironmentManager so the editor's HDR connector and a published
11
+ * scene render the identical thing from the identical settings object. One
12
+ * `<Environment>`, one set of prop defaults, one place to change them.
13
+ */
14
+ /** A background is active when something is actually going to be drawn: a named
15
+ * drei preset, a single URL, or a playlist. `visible` alone is not enough — it
16
+ * can be true with nothing selected. */
17
+ export function isHdrActive(hdr) {
18
+ const name = hdr.visible ? hdr.name : null;
19
+ const urls = hdr.urls;
20
+ return !!(name || (urls && urls.length >= 1));
21
+ }
22
+ const HdrEnvironment = ({ hdr, onObjectReady, onObjectDispose }) => {
23
+ const { scene } = useThree();
24
+ const backgroundName = hdr.visible ? hdr.name : null;
25
+ const urls = hdr.urls;
26
+ const playlistActive = !!urls && urls.length > 1;
27
+ const singleUrl = urls && urls.length === 1 ? urls[0] : undefined;
28
+ const active = !!(backgroundName || singleUrl || playlistActive);
29
+ // While the playlist runs, drei's <Environment> unmounts: HdrPlaylistRenderer
30
+ // owns scene.environment and scene.background for the duration of the
31
+ // transitions, and two owners means one of them loses.
32
+ const environmentComponent = useMemo(() => {
33
+ if (playlistActive || !active)
34
+ return null;
35
+ const sourceProps = singleUrl ? { files: singleUrl } : { preset: backgroundName };
36
+ return (_jsx(Environment, { ...sourceProps, background: true, scene: scene, backgroundBlurriness: hdr.settings.backgroundBlurriness ?? 0, backgroundIntensity: hdr.settings.backgroundIntensity ?? 1, backgroundRotation: [0, hdr.settings.backgroundRotation ?? Math.PI / 2, 0], environmentIntensity: hdr.settings.environmentIntensity ?? 1, environmentRotation: [0, hdr.settings.environmentRotation ?? Math.PI / 2, 0], blur: hdr.settings.blur ?? 0, ground: {
37
+ radius: hdr.settings.groundRadius,
38
+ height: hdr.settings.groundHeight,
39
+ scale: hdr.settings.groundScale,
40
+ } }));
41
+ }, [playlistActive, active, singleUrl, backgroundName, hdr.settings, scene]);
42
+ return (_jsxs(_Fragment, { children: [environmentComponent, playlistActive && urls && (_jsx(HdrPlaylistRenderer, { urls: urls, transition: getTransitionSettings(hdr), onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }))] }));
43
+ };
44
+ export default HdrEnvironment;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { ObjectReadyProps } from '../types/objectReady';
3
+ import type { LandscapeSettings } from '../types/landscapeConfigs';
4
+ export interface LandscapeBuilderProps extends ObjectReadyProps {
5
+ /** Accepts a partial or older-shaped blob. A blob with no `heightMap`
6
+ * normalises to nothing — a landscape without one is not a landscape, and
7
+ * inventing a default would put ground in a scene that never had any. */
8
+ settings?: Partial<LandscapeSettings> | null;
9
+ }
10
+ /**
11
+ * The world ground.
12
+ *
13
+ * The counterpart to `TerrainBuilder` and deliberately independent of it: a
14
+ * scene may have procedural terrain, an authored landscape, both or neither.
15
+ * They are different objects with different config and nothing shared, which is
16
+ * why there is no `groundType` switch anywhere.
17
+ *
18
+ * Each block is normalised against its own source, so editing quality cannot
19
+ * invalidate the config and re-run RTIN.
20
+ */
21
+ declare const LandscapeBuilder: React.FC<LandscapeBuilderProps>;
22
+ export default LandscapeBuilder;
23
+ //# sourceMappingURL=LandscapeBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LandscapeBuilder.d.ts","sourceRoot":"","sources":["../../src/components/LandscapeBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAIlE,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D;;8EAE0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAA;CAC/C;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAqBrD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { normalizeLandscape, normalizeLandscapeQuality } from '../types/landscapeConfigs.js';
4
+ import LandscapeMesh from './landscape/LandscapeMesh.js';
5
+ /**
6
+ * The world ground.
7
+ *
8
+ * The counterpart to `TerrainBuilder` and deliberately independent of it: a
9
+ * scene may have procedural terrain, an authored landscape, both or neither.
10
+ * They are different objects with different config and nothing shared, which is
11
+ * why there is no `groundType` switch anywhere.
12
+ *
13
+ * Each block is normalised against its own source, so editing quality cannot
14
+ * invalidate the config and re-run RTIN.
15
+ */
16
+ const LandscapeBuilder = ({ settings, onObjectReady, onObjectDispose, }) => {
17
+ const config = useMemo(() => normalizeLandscape(settings?.config), [settings?.config]);
18
+ const quality = useMemo(() => normalizeLandscapeQuality(settings?.quality), [settings?.quality]);
19
+ if (!config?.enabled)
20
+ return null;
21
+ if (!config.heightMap || config.surfaces.length === 0)
22
+ return null;
23
+ return (_jsx(LandscapeMesh, { id: settings?.id ?? '3drise-landscape', config: config, quality: quality, applyTransform: true, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }));
24
+ };
25
+ export default LandscapeBuilder;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import type { ObjectReadyProps } from '../types/objectReady';
3
+ import type { LandscapeSettings } from '../types/landscapeConfigs';
4
+ export interface LandscapeObjectProps extends ObjectReadyProps {
5
+ settings: Partial<LandscapeSettings> & {
6
+ id?: string;
7
+ };
8
+ }
9
+ /**
10
+ * A placed landscape — a floating island, a diorama, a game tile, a table-top
11
+ * relief.
12
+ *
13
+ * Mounted through `ObjectNode`'s renderers map, so it is an ordinary
14
+ * `CreatedObject` and gets the transform gizmo, keyframe animation, mouse-move
15
+ * interactions, parenting and click actions with no work here. That is the whole
16
+ * argument for it being an object rather than a second environment entry.
17
+ *
18
+ * `applyTransform` is false: the wrapper owns position, rotation and scale, and
19
+ * the config's own `origin` / `rotationY` are ground-host fields that would
20
+ * fight it.
21
+ */
22
+ declare const LandscapeObject: React.FC<LandscapeObjectProps>;
23
+ export default LandscapeObject;
24
+ //# sourceMappingURL=LandscapeObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LandscapeObject.d.ts","sourceRoot":"","sources":["../../src/components/LandscapeObject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAIlE,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACzD;AAED;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqBnD,CAAA;AAED,eAAe,eAAe,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { normalizeLandscape, normalizeLandscapeQuality } from '../types/landscapeConfigs.js';
4
+ import LandscapeMesh from './landscape/LandscapeMesh.js';
5
+ /**
6
+ * A placed landscape — a floating island, a diorama, a game tile, a table-top
7
+ * relief.
8
+ *
9
+ * Mounted through `ObjectNode`'s renderers map, so it is an ordinary
10
+ * `CreatedObject` and gets the transform gizmo, keyframe animation, mouse-move
11
+ * interactions, parenting and click actions with no work here. That is the whole
12
+ * argument for it being an object rather than a second environment entry.
13
+ *
14
+ * `applyTransform` is false: the wrapper owns position, rotation and scale, and
15
+ * the config's own `origin` / `rotationY` are ground-host fields that would
16
+ * fight it.
17
+ */
18
+ const LandscapeObject = ({ settings, onObjectReady, onObjectDispose, }) => {
19
+ const config = useMemo(() => normalizeLandscape(settings?.config), [settings?.config]);
20
+ const quality = useMemo(() => normalizeLandscapeQuality(settings?.quality), [settings?.quality]);
21
+ if (!config?.enabled)
22
+ return null;
23
+ if (!config.heightMap || config.surfaces.length === 0)
24
+ return null;
25
+ return (_jsx(LandscapeMesh, { id: settings.id ?? 'landscape-object', config: config, quality: quality, applyTransform: false, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }));
26
+ };
27
+ export default LandscapeObject;
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAe,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,KAAK,eAAe,GAAG,gBAAgB,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AA0BF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyGzC,CAAC;AACF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAe,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,eAAe,GAAG,gBAAgB,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AAgBF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmHzC,CAAC;AACF,eAAe,UAAU,CAAC"}
@@ -13,15 +13,9 @@ import LightObject from "./LightObject.js";
13
13
  import EnvironmentObject from "./EnvironmentObject.js";
14
14
  import Galaxy from "./Galaxy.js";
15
15
  import GridGenerator from "./GridsGenerator.js";
16
- const SELF_MANAGED_MATERIAL = new Set([
17
- 'effect',
18
- // 'gallery',
19
- 'earth',
20
- 'space',
21
- 'shootingStars',
22
- 'grid',
23
- // 'moon'
24
- ]);
16
+ import OceanBuilder from "./OceanBuilder.js";
17
+ import LandscapeObject from "./LandscapeObject.js";
18
+ import { SELF_MANAGED_MATERIAL } from "../constants.js";
25
19
  // const EffectsLayer: React.FC<{ effects: CreatedObjectSettings['effects'] }> = ({ effects }) =>
26
20
  // effects?.length ? (
27
21
  // <>
@@ -85,6 +79,14 @@ const ObjectNode = ({ node, onObjectReady, onObjectDispose, handleObjectClick })
85
79
  grid: (obj, onObjectReady) => (
86
80
  // <GridHelper {...(obj.config as GridConfig)} side={2} />
87
81
  _jsx(GridGenerator, { config: obj.config, ...relabel(obj) })),
82
+ // A placed body of water — the object host. The world ocean is mounted by
83
+ // the environment instead, so this branch only ever sees a pool, a pond or
84
+ // a canal; OceanBuilder decides which from config.host either way.
85
+ ocean: (obj, onObjectReady) => (_jsx(OceanBuilder, { settings: obj, ...relabel(obj) }, obj.id)),
86
+ // A placed landscape — the object host. The world ground is mounted by
87
+ // LandscapeConnector instead; this one is a diorama, a floating island or
88
+ // a game tile, and gets its transform from the CreatedObject wrapper.
89
+ landscape: (obj, onObjectReady) => (_jsx(LandscapeObject, { settings: obj, ...relabel(obj) }, obj.id)),
88
90
  effect: (obj) => (_jsx(EffectsGenerator, { settings: {
89
91
  config: obj.config,
90
92
  }, ...relabel(obj) }, obj.id)),
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import type { SkySettings, TimeSettings } from '@3driseai/3drise-core';
3
+ import type { ObjectReadyProps } from '../types/objectReady';
4
+ import type { OceanWaterSettings } from '../types/oceanConfigs';
5
+ export interface OceanBuilderProps extends ObjectReadyProps {
6
+ /** Accepts a partial or older-shaped blob — including core's retired
7
+ * `OceanSettings`, the flat plane with a water material picked out of the
8
+ * registry. That one is MAPPED rather than dropped: see below. */
9
+ settings?: Partial<OceanWaterSettings> | null;
10
+ skySettings?: SkySettings;
11
+ timeSettings?: TimeSettings;
12
+ /** Matches SkySystem's sunIntensity, so water brightens with the scene. */
13
+ sunIntensity?: number;
14
+ }
15
+ /**
16
+ * Picks the water body for the scene.
17
+ *
18
+ * The counterpart to `CloudsGenerator` and `TerrainBuilder`, and deliberately the
19
+ * same shape: switch on the model field, mount exactly one renderer, normalise
20
+ * each block against its own source so editing one cannot invalidate the other.
21
+ *
22
+ * ## One place it differs from the terrain, on purpose
23
+ *
24
+ * `normalizeTerrain` returns null for a blob in the retired shape, because a
25
+ * project saved before terrain existed never had ground and defaulting one in
26
+ * would give it a landscape it was never authored with. The ocean is the
27
+ * opposite case: the old ocean is a visible plane with a water material, so a
28
+ * project saved before this system very possibly HAD water, and returning null
29
+ * would delete it. A legacy blob is therefore mapped — its material variant onto
30
+ * the nearest type, its plane size onto the host, its Y onto the sea level. See
31
+ * `normalizeOcean`.
32
+ */
33
+ declare const OceanBuilder: React.FC<OceanBuilderProps>;
34
+ export default OceanBuilder;
35
+ //# sourceMappingURL=OceanBuilder.d.ts.map