@3driseai/3drise-viewer 0.1.27 → 0.1.29
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.
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
- package/dist/animationsV2/ClipPlayer.js +13 -9
- package/dist/animationsV2/ClipsRuntime.d.ts +44 -3
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +173 -55
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +21 -5
- package/dist/animationsV2/index.d.ts +1 -1
- package/dist/animationsV2/index.d.ts.map +1 -1
- package/dist/animationsV2/normalize.d.ts.map +1 -1
- package/dist/animationsV2/normalize.js +7 -3
- package/dist/animationsV2/sequenceUtils.d.ts +44 -6
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +58 -12
- package/dist/animationsV2/types.d.ts +22 -12
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.d.ts +35 -1
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +88 -17
- package/dist/components/AdvancedGrid.d.ts +1 -5
- package/dist/components/AdvancedGrid.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.js +6 -35
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +9 -4
- package/dist/components/ApollonianGrid.d.ts +25 -0
- package/dist/components/ApollonianGrid.d.ts.map +1 -0
- package/dist/components/ApollonianGrid.js +55 -0
- package/dist/components/ChladniGrid.d.ts +1 -1
- package/dist/components/ChladniGrid.d.ts.map +1 -1
- package/dist/components/ChladniGrid.js +6 -35
- package/dist/components/CircuitGrid.d.ts +1 -1
- package/dist/components/CircuitGrid.d.ts.map +1 -1
- package/dist/components/CircuitGrid.js +6 -34
- package/dist/components/ConformalGrid.d.ts +25 -0
- package/dist/components/ConformalGrid.d.ts.map +1 -0
- package/dist/components/ConformalGrid.js +66 -0
- package/dist/components/ContourGrid.d.ts +1 -1
- package/dist/components/ContourGrid.d.ts.map +1 -1
- package/dist/components/ContourGrid.js +6 -34
- package/dist/components/CustomPrimitive.js +1 -1
- package/dist/components/EnvironmentObject.d.ts.map +1 -1
- package/dist/components/EnvironmentObject.js +9 -7
- package/dist/components/FlowNetGrid.d.ts +1 -1
- package/dist/components/FlowNetGrid.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.js +6 -34
- package/dist/components/FractalGrid.d.ts +1 -1
- package/dist/components/FractalGrid.d.ts.map +1 -1
- package/dist/components/FractalGrid.js +6 -37
- package/dist/components/Galaxy.d.ts.map +1 -1
- package/dist/components/Galaxy.js +9 -23
- package/dist/components/GirihGrid.d.ts +1 -1
- package/dist/components/GirihGrid.d.ts.map +1 -1
- package/dist/components/GirihGrid.js +6 -35
- package/dist/components/GravWaveGrid.d.ts +1 -1
- package/dist/components/GravWaveGrid.d.ts.map +1 -1
- package/dist/components/GravWaveGrid.js +6 -35
- package/dist/components/GridsGenerator.d.ts +2 -2
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +21 -0
- package/dist/components/HexGrid.d.ts +1 -5
- package/dist/components/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid.js +6 -36
- package/dist/components/HilbertGrid.d.ts +25 -0
- package/dist/components/HilbertGrid.d.ts.map +1 -0
- package/dist/components/HilbertGrid.js +66 -0
- package/dist/components/HyperbolicGrid.d.ts +1 -1
- package/dist/components/HyperbolicGrid.d.ts.map +1 -1
- package/dist/components/HyperbolicGrid.js +6 -34
- package/dist/components/LandObject.d.ts +9 -0
- package/dist/components/LandObject.d.ts.map +1 -0
- package/dist/components/LandObject.js +15 -0
- package/dist/components/LensingGrid.d.ts +25 -0
- package/dist/components/LensingGrid.d.ts.map +1 -0
- package/dist/components/LensingGrid.js +55 -0
- package/dist/components/LightsManager.d.ts.map +1 -1
- package/dist/components/LightsManager.js +8 -0
- package/dist/components/ModelBoundary.d.ts +2 -0
- package/dist/components/ModelBoundary.d.ts.map +1 -1
- package/dist/components/ModelBoundary.js +3 -0
- package/dist/components/ModelPrimitive.d.ts.map +1 -1
- package/dist/components/ModelPrimitive.js +6 -0
- package/dist/components/MoireGrid.d.ts +1 -1
- package/dist/components/MoireGrid.d.ts.map +1 -1
- package/dist/components/MoireGrid.js +6 -35
- package/dist/components/MoonDisc.d.ts +11 -0
- package/dist/components/MoonDisc.d.ts.map +1 -0
- package/dist/components/MoonDisc.js +128 -0
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +15 -4
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +7 -5
- package/dist/components/OceanBuilder.d.ts.map +1 -1
- package/dist/components/OceanBuilder.js +2 -0
- package/dist/components/ParastichyGrid.d.ts +25 -0
- package/dist/components/ParastichyGrid.d.ts.map +1 -0
- package/dist/components/ParastichyGrid.js +55 -0
- package/dist/components/PhyllotaxisGrid.d.ts +25 -0
- package/dist/components/PhyllotaxisGrid.d.ts.map +1 -0
- package/dist/components/PhyllotaxisGrid.js +66 -0
- package/dist/components/ProjectLoader.d.ts +5 -3
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +6 -3
- package/dist/components/QuasiGrid.d.ts +1 -1
- package/dist/components/QuasiGrid.d.ts.map +1 -1
- package/dist/components/QuasiGrid.js +6 -33
- package/dist/components/RadarGrid.d.ts +1 -1
- package/dist/components/RadarGrid.d.ts.map +1 -1
- package/dist/components/RadarGrid.js +6 -34
- package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
- package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
- package/dist/components/ReactionDiffusionGrid.js +6 -35
- package/dist/components/SceneBuilder.d.ts +25 -3
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +68 -38
- package/dist/components/SkyController.d.ts +25 -1
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +189 -130
- package/dist/components/SkyMesh.d.ts.map +1 -1
- package/dist/components/SkyMesh.js +26 -1
- package/dist/components/SkyStars.d.ts +11 -0
- package/dist/components/SkyStars.d.ts.map +1 -0
- package/dist/components/SkyStars.js +187 -0
- package/dist/components/SkySystem.d.ts +3 -3
- package/dist/components/SkySystem.d.ts.map +1 -1
- package/dist/components/SkySystem.js +8 -2
- package/dist/components/Sun.d.ts +15 -1
- package/dist/components/Sun.d.ts.map +1 -1
- package/dist/components/Sun.js +64 -3
- package/dist/components/SunLight.d.ts +6 -1
- package/dist/components/SunLight.d.ts.map +1 -1
- package/dist/components/SunLight.js +96 -44
- package/dist/components/TerrainBuilder.d.ts.map +1 -1
- package/dist/components/TerrainBuilder.js +2 -0
- package/dist/components/TextGenerator.d.ts +9 -0
- package/dist/components/TextGenerator.d.ts.map +1 -0
- package/dist/components/TextGenerator.js +29 -0
- package/dist/components/TruchetGrid.d.ts +25 -0
- package/dist/components/TruchetGrid.d.ts.map +1 -0
- package/dist/components/TruchetGrid.js +55 -0
- package/dist/components/VoronoiGrid.d.ts +1 -1
- package/dist/components/VoronoiGrid.d.ts.map +1 -1
- package/dist/components/VoronoiGrid.js +6 -33
- package/dist/components/WallpaperGrid.d.ts +1 -1
- package/dist/components/WallpaperGrid.d.ts.map +1 -1
- package/dist/components/WallpaperGrid.js +6 -35
- package/dist/components/environment/Rain.d.ts +15 -0
- package/dist/components/environment/Rain.d.ts.map +1 -0
- package/dist/components/environment/Rain.js +110 -0
- package/dist/components/environment/Rainbow.d.ts +20 -0
- package/dist/components/environment/Rainbow.d.ts.map +1 -0
- package/dist/components/environment/Rainbow.js +974 -0
- package/dist/components/environment/Sandstorm.d.ts +20 -0
- package/dist/components/environment/Sandstorm.d.ts.map +1 -0
- package/dist/components/environment/Sandstorm.js +776 -0
- package/dist/components/environment/Snow.d.ts +20 -0
- package/dist/components/environment/Snow.d.ts.map +1 -0
- package/dist/components/environment/Snow.js +609 -0
- package/dist/components/environment/Thunderstorm.d.ts +20 -0
- package/dist/components/environment/Thunderstorm.d.ts.map +1 -0
- package/dist/components/environment/Thunderstorm.js +731 -0
- package/dist/components/environment/Tornado.d.ts +20 -0
- package/dist/components/environment/Tornado.d.ts.map +1 -0
- package/dist/components/environment/Tornado.js +762 -0
- package/dist/components/environment/index.d.ts +13 -0
- package/dist/components/environment/index.d.ts.map +1 -0
- package/dist/components/environment/index.js +7 -0
- package/dist/components/index.d.ts +24 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +15 -6
- package/dist/components/land/LandPatch.d.ts +15 -0
- package/dist/components/land/LandPatch.d.ts.map +1 -0
- package/dist/components/land/LandPatch.js +170 -0
- package/dist/components/land/index.d.ts +3 -0
- package/dist/components/land/index.d.ts.map +1 -0
- package/dist/components/land/index.js +1 -0
- package/dist/components/space/Earth.d.ts +16 -0
- package/dist/components/space/Earth.d.ts.map +1 -0
- package/dist/components/space/Earth.js +75 -0
- package/dist/components/space/ShootingStar.d.ts +21 -0
- package/dist/components/space/ShootingStar.d.ts.map +1 -0
- package/dist/components/space/ShootingStar.js +101 -0
- package/dist/components/space/ShootingStars.d.ts +16 -0
- package/dist/components/space/ShootingStars.d.ts.map +1 -0
- package/dist/components/space/ShootingStars.js +71 -0
- package/dist/components/space/SolarSystem.d.ts +16 -0
- package/dist/components/space/SolarSystem.d.ts.map +1 -0
- package/dist/components/space/SolarSystem.js +141 -0
- package/dist/components/space/Stars.d.ts +20 -0
- package/dist/components/space/Stars.d.ts.map +1 -0
- package/dist/components/space/Stars.js +160 -0
- package/dist/components/space/index.d.ts +11 -0
- package/dist/components/space/index.d.ts.map +1 -0
- package/dist/components/space/index.js +8 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +27 -3
- package/dist/components/terrain/types.d.ts +5 -1
- package/dist/components/terrain/types.d.ts.map +1 -1
- package/dist/components/text/BurnAwayText.d.ts +15 -0
- package/dist/components/text/BurnAwayText.d.ts.map +1 -0
- package/dist/components/text/BurnAwayText.js +4 -0
- package/dist/components/text/ChalkboardText.d.ts +15 -0
- package/dist/components/text/ChalkboardText.d.ts.map +1 -0
- package/dist/components/text/ChalkboardText.js +4 -0
- package/dist/components/text/ConstellationText.d.ts +15 -0
- package/dist/components/text/ConstellationText.d.ts.map +1 -0
- package/dist/components/text/ConstellationText.js +4 -0
- package/dist/components/text/EmbroideryText.d.ts +15 -0
- package/dist/components/text/EmbroideryText.d.ts.map +1 -0
- package/dist/components/text/EmbroideryText.js +4 -0
- package/dist/components/text/FourierSketchText.d.ts +15 -0
- package/dist/components/text/FourierSketchText.d.ts.map +1 -0
- package/dist/components/text/FourierSketchText.js +4 -0
- package/dist/components/text/FrostGrowthText.d.ts +15 -0
- package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
- package/dist/components/text/FrostGrowthText.js +4 -0
- package/dist/components/text/HandwritingText.d.ts +15 -0
- package/dist/components/text/HandwritingText.d.ts.map +1 -0
- package/dist/components/text/HandwritingText.js +4 -0
- package/dist/components/text/InkBleedText.d.ts +15 -0
- package/dist/components/text/InkBleedText.d.ts.map +1 -0
- package/dist/components/text/InkBleedText.js +4 -0
- package/dist/components/text/LightPaintingText.d.ts +15 -0
- package/dist/components/text/LightPaintingText.d.ts.map +1 -0
- package/dist/components/text/LightPaintingText.js +4 -0
- package/dist/components/text/LiquidMetalText.d.ts +15 -0
- package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
- package/dist/components/text/LiquidMetalText.js +4 -0
- package/dist/components/text/NeonTubeText.d.ts +15 -0
- package/dist/components/text/NeonTubeText.d.ts.map +1 -0
- package/dist/components/text/NeonTubeText.js +4 -0
- package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
- package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
- package/dist/components/text/PlasmaDischargeText.js +4 -0
- package/dist/components/text/TextObjectView.d.ts +12 -0
- package/dist/components/text/TextObjectView.d.ts.map +1 -0
- package/dist/components/text/TextObjectView.js +11 -0
- package/dist/components/text/engine/fieldkit.d.ts +24 -0
- package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
- package/dist/components/text/engine/fieldkit.js +201 -0
- package/dist/components/text/engine/glyphs.d.ts +19 -0
- package/dist/components/text/engine/glyphs.d.ts.map +1 -0
- package/dist/components/text/engine/glyphs.js +269 -0
- package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
- package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
- package/dist/components/text/engine/looks/burnAway.js +593 -0
- package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
- package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
- package/dist/components/text/engine/looks/chalkboard.js +426 -0
- package/dist/components/text/engine/looks/constellation.d.ts +111 -0
- package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
- package/dist/components/text/engine/looks/constellation.js +496 -0
- package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
- package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
- package/dist/components/text/engine/looks/embroidery.js +645 -0
- package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
- package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
- package/dist/components/text/engine/looks/frostGrowth.js +727 -0
- package/dist/components/text/engine/looks/index.d.ts +2 -0
- package/dist/components/text/engine/looks/index.d.ts.map +1 -0
- package/dist/components/text/engine/looks/index.js +48 -0
- package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
- package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
- package/dist/components/text/engine/looks/inkBleed.js +590 -0
- package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
- package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
- package/dist/components/text/engine/looks/lightPainting.js +567 -0
- package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
- package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
- package/dist/components/text/engine/looks/liquidMetal.js +655 -0
- package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
- package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
- package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
- package/dist/components/text/engine/methods.d.ts +19 -0
- package/dist/components/text/engine/methods.d.ts.map +1 -0
- package/dist/components/text/engine/methods.js +126 -0
- package/dist/components/text/engine/playback.d.ts +40 -0
- package/dist/components/text/engine/playback.d.ts.map +1 -0
- package/dist/components/text/engine/playback.js +114 -0
- package/dist/components/text/engine/ribbon.d.ts +58 -0
- package/dist/components/text/engine/ribbon.d.ts.map +1 -0
- package/dist/components/text/engine/ribbon.js +250 -0
- package/dist/components/text/engine/variants.d.ts +159 -0
- package/dist/components/text/engine/variants.d.ts.map +1 -0
- package/dist/components/text/engine/variants.js +378 -0
- package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
- package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
- package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
- package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
- package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
- package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/caveat.outline.js +4 -0
- package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
- package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/caveat.strokes.js +4 -0
- package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
- package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/courgette.outline.js +4 -0
- package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
- package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/courgette.strokes.js +4 -0
- package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/dancing-script.outline.js +4 -0
- package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
- package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
- package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
- package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
- package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
- package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
- package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/handlee.outline.js +4 -0
- package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
- package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/handlee.strokes.js +4 -0
- package/dist/components/text/fonts/index.d.ts +5 -0
- package/dist/components/text/fonts/index.d.ts.map +1 -0
- package/dist/components/text/fonts/index.js +44 -0
- package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
- package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/indie-flower.outline.js +4 -0
- package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
- package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
- package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
- package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/kalam.outline.js +4 -0
- package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
- package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/kalam.strokes.js +4 -0
- package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
- package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
- package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
- package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/mynerve.outline.js +4 -0
- package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
- package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/mynerve.strokes.js +4 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
- package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
- package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/pacifico.outline.js +4 -0
- package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
- package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/pacifico.strokes.js +4 -0
- package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
- package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
- package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
- package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
- package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
- package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/poppins.outline.js +4 -0
- package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
- package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/poppins.strokes.js +4 -0
- package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
- package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/satisfy.outline.js +4 -0
- package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
- package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/satisfy.strokes.js +4 -0
- package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
- package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/sriracha.outline.js +4 -0
- package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
- package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/sriracha.strokes.js +4 -0
- package/dist/components/text/index.d.ts +27 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +13 -0
- package/dist/components/text/useTextObject.d.ts +21 -0
- package/dist/components/text/useTextObject.d.ts.map +1 -0
- package/dist/components/text/useTextObject.js +118 -0
- package/dist/components/water/OceanSurface.d.ts.map +1 -1
- package/dist/components/water/OceanSurface.js +3 -1
- package/dist/components/water/WaterBody.d.ts.map +1 -1
- package/dist/components/water/WaterBody.js +3 -1
- package/dist/components/water/types.d.ts +5 -1
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +5 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useCloudSun.d.ts +9 -4
- package/dist/hooks/useCloudSun.d.ts.map +1 -1
- package/dist/hooks/useCloudSun.js +17 -7
- package/dist/hooks/useConfigLive.d.ts +3 -2
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.js +4 -10
- package/dist/hooks/useEnvironmentProbe.d.ts +3 -22
- package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -1
- package/dist/hooks/useEnvironmentProbe.js +47 -8
- package/dist/hooks/useGridSurface.d.ts +3 -10
- package/dist/hooks/useGridSurface.d.ts.map +1 -1
- package/dist/hooks/useGridSurface.js +5 -31
- package/dist/hooks/useInteraction.d.ts.map +1 -1
- package/dist/hooks/useInteraction.js +19 -72
- package/dist/hooks/useLightConfig.d.ts +2 -1
- package/dist/hooks/useLightConfig.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.d.ts +6 -2
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +37 -2
- package/dist/hooks/useSkyLive.d.ts +23 -0
- package/dist/hooks/useSkyLive.d.ts.map +1 -0
- package/dist/hooks/useSkyLive.js +30 -0
- package/dist/hooks/useSkyUniforms.d.ts.map +1 -1
- package/dist/hooks/useSkyUniforms.js +2 -10
- package/dist/hooks/useTerrainLive.d.ts +3 -1
- package/dist/hooks/useTerrainLive.d.ts.map +1 -1
- package/dist/hooks/useTerrainTextures.d.ts +38 -0
- package/dist/hooks/useTerrainTextures.d.ts.map +1 -0
- package/dist/hooks/useTerrainTextures.js +149 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/operations/catalogue/blastOff.d.ts +3 -0
- package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
- package/dist/operations/catalogue/blastOff.js +118 -0
- package/dist/operations/catalogue/bounce.d.ts +3 -0
- package/dist/operations/catalogue/bounce.d.ts.map +1 -0
- package/dist/operations/catalogue/bounce.js +34 -0
- package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
- package/dist/operations/catalogue/curlSmoke.js +3 -1
- package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
- package/dist/operations/catalogue/dissolve.js +2 -1
- package/dist/operations/catalogue/driftUp.d.ts +3 -0
- package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
- package/dist/operations/catalogue/driftUp.js +57 -0
- package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
- package/dist/operations/catalogue/emberAsh.js +2 -1
- package/dist/operations/catalogue/flip.d.ts.map +1 -1
- package/dist/operations/catalogue/flip.js +19 -9
- package/dist/operations/catalogue/float.d.ts +3 -0
- package/dist/operations/catalogue/float.d.ts.map +1 -0
- package/dist/operations/catalogue/float.js +39 -0
- package/dist/operations/catalogue/flyBy.d.ts +3 -0
- package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
- package/dist/operations/catalogue/flyBy.js +79 -0
- package/dist/operations/catalogue/frost.d.ts.map +1 -1
- package/dist/operations/catalogue/frost.js +10 -3
- package/dist/operations/catalogue/grow.d.ts +3 -0
- package/dist/operations/catalogue/grow.d.ts.map +1 -0
- package/dist/operations/catalogue/grow.js +19 -0
- package/dist/operations/catalogue/hologram.d.ts.map +1 -1
- package/dist/operations/catalogue/hologram.js +11 -5
- package/dist/operations/catalogue/jelly.d.ts.map +1 -1
- package/dist/operations/catalogue/jelly.js +18 -8
- package/dist/operations/catalogue/knockAway.d.ts +3 -0
- package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
- package/dist/operations/catalogue/knockAway.js +74 -0
- package/dist/operations/catalogue/leafFall.d.ts +3 -0
- package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
- package/dist/operations/catalogue/leafFall.js +74 -0
- package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
- package/dist/operations/catalogue/lidarScan.js +4 -1
- package/dist/operations/catalogue/metalize.d.ts.map +1 -1
- package/dist/operations/catalogue/metalize.js +8 -2
- package/dist/operations/catalogue/motionTrail.d.ts +6 -0
- package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
- package/dist/operations/catalogue/motionTrail.js +221 -0
- package/dist/operations/catalogue/petrify.d.ts.map +1 -1
- package/dist/operations/catalogue/petrify.js +9 -3
- package/dist/operations/catalogue/physicalExit.d.ts +55 -0
- package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalExit.js +165 -0
- package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
- package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalHeld.js +78 -0
- package/dist/operations/catalogue/physicalMix.d.ts +45 -0
- package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalMix.js +144 -0
- package/dist/operations/catalogue/pop.d.ts +3 -0
- package/dist/operations/catalogue/pop.d.ts.map +1 -0
- package/dist/operations/catalogue/pop.js +44 -0
- package/dist/operations/catalogue/print3d.d.ts.map +1 -1
- package/dist/operations/catalogue/print3d.js +5 -1
- package/dist/operations/catalogue/pulse.d.ts +3 -0
- package/dist/operations/catalogue/pulse.d.ts.map +1 -0
- package/dist/operations/catalogue/pulse.js +29 -0
- package/dist/operations/catalogue/restPose.d.ts +5 -7
- package/dist/operations/catalogue/restPose.d.ts.map +1 -1
- package/dist/operations/catalogue/restPose.js +18 -48
- package/dist/operations/catalogue/rotate.d.ts +3 -0
- package/dist/operations/catalogue/rotate.d.ts.map +1 -0
- package/dist/operations/catalogue/rotate.js +49 -0
- package/dist/operations/catalogue/shake.d.ts +3 -0
- package/dist/operations/catalogue/shake.d.ts.map +1 -0
- package/dist/operations/catalogue/shake.js +31 -0
- package/dist/operations/catalogue/shatter.d.ts.map +1 -1
- package/dist/operations/catalogue/shatter.js +5 -1
- package/dist/operations/catalogue/slam.d.ts +3 -0
- package/dist/operations/catalogue/slam.d.ts.map +1 -0
- package/dist/operations/catalogue/slam.js +89 -0
- package/dist/operations/catalogue/slingshot.d.ts +3 -0
- package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
- package/dist/operations/catalogue/slingshot.js +88 -0
- package/dist/operations/catalogue/spin.d.ts.map +1 -1
- package/dist/operations/catalogue/spin.js +24 -13
- package/dist/operations/catalogue/sway.d.ts +3 -0
- package/dist/operations/catalogue/sway.d.ts.map +1 -0
- package/dist/operations/catalogue/sway.js +23 -0
- package/dist/operations/catalogue/swirl.d.ts.map +1 -1
- package/dist/operations/catalogue/swirl.js +6 -5
- package/dist/operations/catalogue/trailCore.d.ts +89 -0
- package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
- package/dist/operations/catalogue/trailCore.js +190 -0
- package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
- package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
- package/dist/operations/catalogue/trailGhosts.js +179 -0
- package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
- package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStampStyles.js +479 -0
- package/dist/operations/catalogue/trailStamps.d.ts +57 -0
- package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStamps.js +349 -0
- package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
- package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStreaks.js +147 -0
- package/dist/operations/catalogue/transitionField.d.ts +30 -0
- package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
- package/dist/operations/catalogue/transitionField.js +21 -0
- package/dist/operations/catalogue/turnAway.d.ts +3 -0
- package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
- package/dist/operations/catalogue/turnAway.js +54 -0
- package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
- package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
- package/dist/operations/catalogue/vortexDrain.js +68 -0
- package/dist/operations/catalogue/warp.d.ts +3 -0
- package/dist/operations/catalogue/warp.d.ts.map +1 -0
- package/dist/operations/catalogue/warp.js +73 -0
- package/dist/operations/catalogue/whoosh.d.ts +3 -0
- package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
- package/dist/operations/catalogue/whoosh.js +84 -0
- package/dist/operations/catalogue/wobble.d.ts +3 -0
- package/dist/operations/catalogue/wobble.d.ts.map +1 -0
- package/dist/operations/catalogue/wobble.js +23 -0
- package/dist/operations/clipPreview.d.ts +3 -0
- package/dist/operations/clipPreview.d.ts.map +1 -0
- package/dist/operations/clipPreview.js +20 -0
- package/dist/operations/groupFanout.d.ts +96 -0
- package/dist/operations/groupFanout.d.ts.map +1 -0
- package/dist/operations/groupFanout.js +365 -0
- package/dist/operations/groups.d.ts +20 -0
- package/dist/operations/groups.d.ts.map +1 -0
- package/dist/operations/groups.js +66 -0
- package/dist/operations/index.d.ts +5 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +5 -2
- package/dist/operations/objectEffects.d.ts +161 -6
- package/dist/operations/objectEffects.d.ts.map +1 -1
- package/dist/operations/objectEffects.js +1091 -17
- package/dist/operations/registry.d.ts.map +1 -1
- package/dist/operations/registry.js +24 -2
- package/dist/operations/runtime.d.ts +57 -2
- package/dist/operations/runtime.d.ts.map +1 -1
- package/dist/operations/runtime.js +161 -18
- package/dist/operations/types.d.ts +60 -3
- package/dist/operations/types.d.ts.map +1 -1
- package/dist/operations/types.js +5 -1
- package/dist/operations/useObjectEffectLayers.d.ts +2 -2
- package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
- package/dist/operations/useObjectEffectLayers.js +31 -10
- package/dist/operations/usePresentedVisibility.d.ts +10 -0
- package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
- package/dist/operations/usePresentedVisibility.js +53 -0
- package/dist/presets/terrainBiomes.d.ts +67 -0
- package/dist/presets/terrainBiomes.d.ts.map +1 -0
- package/dist/presets/terrainBiomes.js +294 -0
- package/dist/presets/terrainPresets.d.ts +6 -0
- package/dist/presets/terrainPresets.d.ts.map +1 -1
- package/dist/presets/terrainPresets.js +26 -38
- package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
- package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
- package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
- package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
- package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
- package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
- package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
- package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
- package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
- package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
- package/dist/shaders/terrain/TerrainMaterial.js +107 -8
- package/dist/triggers/engine.d.ts +44 -0
- package/dist/triggers/engine.d.ts.map +1 -0
- package/dist/triggers/engine.js +165 -0
- package/dist/triggers/hosts/actions.d.ts +8 -0
- package/dist/triggers/hosts/actions.d.ts.map +1 -0
- package/dist/triggers/hosts/actions.js +22 -0
- package/dist/triggers/hosts/interactions.d.ts +6 -0
- package/dist/triggers/hosts/interactions.d.ts.map +1 -0
- package/dist/triggers/hosts/interactions.js +4 -0
- package/dist/triggers/hosts/timelineCues.d.ts +2 -0
- package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
- package/dist/triggers/hosts/timelineCues.js +22 -0
- package/dist/triggers/index.d.ts +13 -0
- package/dist/triggers/index.d.ts.map +1 -0
- package/dist/triggers/index.js +9 -0
- package/dist/triggers/kinds/action.d.ts +2 -0
- package/dist/triggers/kinds/action.d.ts.map +1 -0
- package/dist/triggers/kinds/action.js +31 -0
- package/dist/triggers/kinds/animations.d.ts +2 -0
- package/dist/triggers/kinds/animations.d.ts.map +1 -0
- package/dist/triggers/kinds/animations.js +75 -0
- package/dist/triggers/kinds/effects.d.ts +2 -0
- package/dist/triggers/kinds/effects.d.ts.map +1 -0
- package/dist/triggers/kinds/effects.js +27 -0
- package/dist/triggers/kinds/index.d.ts +4 -0
- package/dist/triggers/kinds/index.d.ts.map +1 -0
- package/dist/triggers/kinds/index.js +4 -0
- package/dist/triggers/log.d.ts +21 -0
- package/dist/triggers/log.d.ts.map +1 -0
- package/dist/triggers/log.js +43 -0
- package/dist/triggers/readiness.d.ts +40 -0
- package/dist/triggers/readiness.d.ts.map +1 -0
- package/dist/triggers/readiness.js +158 -0
- package/dist/triggers/registry.d.ts +41 -0
- package/dist/triggers/registry.d.ts.map +1 -0
- package/dist/triggers/registry.js +7 -0
- package/dist/types/gridConfigs.d.ts +117 -19
- package/dist/types/gridConfigs.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/UiAnchorUpdater.d.ts +10 -0
- package/dist/ui/UiAnchorUpdater.d.ts.map +1 -0
- package/dist/ui/UiAnchorUpdater.js +111 -0
- package/dist/ui/UiLayers.d.ts +20 -0
- package/dist/ui/UiLayers.d.ts.map +1 -0
- package/dist/ui/UiLayers.js +57 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/uiAnchors.d.ts +21 -0
- package/dist/ui/uiAnchors.d.ts.map +1 -0
- package/dist/ui/uiAnchors.js +22 -0
- package/dist/ui/uiBaseStyles.d.ts +2 -0
- package/dist/ui/uiBaseStyles.d.ts.map +1 -0
- package/dist/ui/uiBaseStyles.js +100 -0
- package/dist/ui/uiBinder.d.ts +30 -0
- package/dist/ui/uiBinder.d.ts.map +1 -0
- package/dist/ui/uiBinder.js +344 -0
- package/dist/utils/configAnimations.d.ts.map +1 -1
- package/dist/utils/configAnimations.js +5 -1
- package/dist/utils/gridConfig.d.ts +1 -1
- package/dist/utils/gridConfig.d.ts.map +1 -1
- package/dist/utils/gridConfig.js +1 -1
- package/dist/utils/landPatch.d.ts +33 -0
- package/dist/utils/landPatch.d.ts.map +1 -0
- package/dist/utils/landPatch.js +114 -0
- package/dist/utils/renderedSky.d.ts +32 -0
- package/dist/utils/renderedSky.d.ts.map +1 -0
- package/dist/utils/renderedSky.js +57 -0
- package/dist/utils/skyMoon.d.ts +35 -0
- package/dist/utils/skyMoon.d.ts.map +1 -0
- package/dist/utils/skyMoon.js +41 -0
- package/dist/utils/terrainHeight.d.ts +4 -0
- package/dist/utils/terrainHeight.d.ts.map +1 -0
- package/dist/utils/terrainHeight.js +150 -0
- package/dist/utils/terrainTextureResolver.d.ts +18 -0
- package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
- package/dist/utils/terrainTextureResolver.js +17 -0
- package/dist/utils/terrainUniforms.d.ts +17 -0
- package/dist/utils/terrainUniforms.d.ts.map +1 -1
- package/dist/utils/terrainUniforms.js +84 -0
- package/dist/utils/textureArrays.d.ts +29 -0
- package/dist/utils/textureArrays.d.ts.map +1 -0
- package/dist/utils/textureArrays.js +140 -0
- package/package.json +2 -2
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { nightAmount, skySystemManager, normalizeSkyStars } from '@3driseai/3drise-core';
|
|
6
|
+
import { useCloudSun } from '../hooks/useCloudSun.js';
|
|
7
|
+
/**
|
|
8
|
+
* The night sky's stars, built into the sky for either renderer.
|
|
9
|
+
*
|
|
10
|
+
* A star dome centred on the camera just inside the far plane (the sky is drawn
|
|
11
|
+
* at the far plane, so stars sit in front of it and terrain occludes them).
|
|
12
|
+
* Brightness follows a magnitude-like distribution — a few bright stars, many
|
|
13
|
+
* faint ones — with a slight colour temperature spread and a gentle twinkle.
|
|
14
|
+
*
|
|
15
|
+
* With the clock on they appear with the night (nightAmount: by the SUN'S HEIGHT,
|
|
16
|
+
* the same phase keys as the atmosphere), fade toward the horizon where real air
|
|
17
|
+
* extinguishes them, and turn about the celestial pole with the clock: rising in
|
|
18
|
+
* the same quarter the sun rises, setting where it sets. With the clock off they
|
|
19
|
+
* are a stand-alone layer: on whenever `stars.visible` is, at full strength.
|
|
20
|
+
*/
|
|
21
|
+
/** Height of the celestial pole above the horizon = observer latitude. */
|
|
22
|
+
const LATITUDE_DEG = 40;
|
|
23
|
+
/** North is opposite the noon sun. The noon sun is toward +X in core's
|
|
24
|
+
* convention, so the pole leans toward −X. */
|
|
25
|
+
const POLE = new THREE.Vector3(-Math.cos(THREE.MathUtils.degToRad(LATITUDE_DEG)), Math.sin(THREE.MathUtils.degToRad(LATITUDE_DEG)), 0).normalize();
|
|
26
|
+
/** Sidereal day, hours: the sky turns once in this much clock time. */
|
|
27
|
+
const SIDEREAL_HOURS = 23.934;
|
|
28
|
+
const vertexShader = /* glsl */ `
|
|
29
|
+
attribute float aMag;
|
|
30
|
+
attribute float aPhase;
|
|
31
|
+
attribute vec3 aTint;
|
|
32
|
+
uniform float uTime;
|
|
33
|
+
uniform float uNight;
|
|
34
|
+
uniform float uPixelRatio;
|
|
35
|
+
uniform float uBrightness;
|
|
36
|
+
uniform float uSize;
|
|
37
|
+
uniform float uTwinkle;
|
|
38
|
+
uniform float uWarmth;
|
|
39
|
+
varying vec3 vColor;
|
|
40
|
+
varying float vAlpha;
|
|
41
|
+
void main() {
|
|
42
|
+
vec4 world = modelMatrix * vec4(position, 1.0);
|
|
43
|
+
// direction from the camera: stars live on a camera-centred dome
|
|
44
|
+
vec3 dir = normalize(world.xyz - cameraPosition);
|
|
45
|
+
float horizon = smoothstep(-0.02, 0.18, dir.y); // extinction near the horizon
|
|
46
|
+
// twinkle depth: 0 = steady, 1 = the full 36% flicker
|
|
47
|
+
float twinkle = 1.0 - 0.36 * uTwinkle * (0.5 + 0.5 * sin(uTime * (1.3 + aPhase * 2.1) + aPhase * 37.0));
|
|
48
|
+
float b = aMag * twinkle * horizon * uNight * uBrightness;
|
|
49
|
+
// aTint holds the full-temperature colour; uWarmth blends it toward white
|
|
50
|
+
vColor = mix(vec3(1.0), aTint, uWarmth);
|
|
51
|
+
vAlpha = b;
|
|
52
|
+
gl_PointSize = (1.0 + 2.6 * aMag) * uPixelRatio * uSize;
|
|
53
|
+
gl_Position = projectionMatrix * viewMatrix * world;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
const fragmentShader = /* glsl */ `
|
|
57
|
+
varying vec3 vColor;
|
|
58
|
+
varying float vAlpha;
|
|
59
|
+
void main() {
|
|
60
|
+
vec2 d = gl_PointCoord * 2.0 - 1.0;
|
|
61
|
+
float r2 = dot(d, d);
|
|
62
|
+
if (r2 > 1.0 || vAlpha < 0.003) discard;
|
|
63
|
+
float core = exp(-r2 * 4.0);
|
|
64
|
+
gl_FragColor = vec4(vColor * core * vAlpha, 1.0);
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
/** Great-circle normal of the Milky Way band: tilted ~60° from the celestial pole
|
|
68
|
+
* (the real galactic plane is ~63° off), so the band arches across the sky
|
|
69
|
+
* rather than circling the pole. */
|
|
70
|
+
const BAND_NORMAL = new THREE.Vector3(0.5, 0.55, 0.67).normalize();
|
|
71
|
+
const BAND_U = new THREE.Vector3().crossVectors(BAND_NORMAL, new THREE.Vector3(0, 1, 0)).normalize();
|
|
72
|
+
const BAND_V = new THREE.Vector3().crossVectors(BAND_NORMAL, BAND_U).normalize();
|
|
73
|
+
/** Box–Muller normal deviate. */
|
|
74
|
+
const gauss = () => Math.sqrt(-2 * Math.log(1 - Math.random())) * Math.cos(Math.random() * Math.PI * 2);
|
|
75
|
+
/**
|
|
76
|
+
* Builds the dome. `milkyWay` (0..1) moves that fraction (× 0.7) of the stars into a
|
|
77
|
+
* dense band of faint stars along a great circle, with a wider, sparser halo — the
|
|
78
|
+
* unresolved glow reads as the band even though every point is still a star. The
|
|
79
|
+
* full colour-temperature tint is baked per star; the shader scales it by warmth.
|
|
80
|
+
*/
|
|
81
|
+
function buildStars(count, milkyWay) {
|
|
82
|
+
const pos = new Float32Array(count * 3);
|
|
83
|
+
const mag = new Float32Array(count);
|
|
84
|
+
const phase = new Float32Array(count);
|
|
85
|
+
const tint = new Float32Array(count * 3);
|
|
86
|
+
const inBand = Math.round(count * 0.7 * THREE.MathUtils.clamp(milkyWay, 0, 1));
|
|
87
|
+
const p = new THREE.Vector3();
|
|
88
|
+
for (let i = 0; i < count; i++) {
|
|
89
|
+
if (i < inBand) {
|
|
90
|
+
// along the band: uniform angle; across it: gaussian, 60% in a tight core, 40% in a halo
|
|
91
|
+
const a = Math.random() * Math.PI * 2;
|
|
92
|
+
const sigma = Math.random() < 0.6 ? 0.07 : 0.22;
|
|
93
|
+
const lat = THREE.MathUtils.clamp(gauss() * sigma, -1.2, 1.2);
|
|
94
|
+
p.copy(BAND_U).multiplyScalar(Math.cos(a) * Math.cos(lat))
|
|
95
|
+
.addScaledVector(BAND_V, Math.sin(a) * Math.cos(lat))
|
|
96
|
+
.addScaledVector(BAND_NORMAL, Math.sin(lat));
|
|
97
|
+
// the band is dust: many faint stars, rarely a bright one
|
|
98
|
+
mag[i] = 0.06 + 0.3 * Math.pow(Math.random(), 3);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// uniform on the sphere
|
|
102
|
+
const u = Math.random() * 2 - 1;
|
|
103
|
+
const th = Math.random() * Math.PI * 2;
|
|
104
|
+
const sr = Math.sqrt(1 - u * u);
|
|
105
|
+
p.set(sr * Math.cos(th), u, sr * Math.sin(th));
|
|
106
|
+
// many faint, few bright
|
|
107
|
+
mag[i] = 0.12 + 0.88 * Math.pow(Math.random(), 6);
|
|
108
|
+
}
|
|
109
|
+
pos[i * 3] = p.x;
|
|
110
|
+
pos[i * 3 + 1] = p.y;
|
|
111
|
+
pos[i * 3 + 2] = p.z;
|
|
112
|
+
phase[i] = Math.random();
|
|
113
|
+
const t = Math.random();
|
|
114
|
+
// full temperature spread (warmth 1): blue giants, orange dwarfs, the rest near white
|
|
115
|
+
const c = t < 0.12 ? [0.62, 0.74, 1.0] : t < 0.25 ? [1.0, 0.8, 0.55] : [1.0, 0.97, 0.92];
|
|
116
|
+
tint.set(c, i * 3);
|
|
117
|
+
}
|
|
118
|
+
const g = new THREE.BufferGeometry();
|
|
119
|
+
g.setAttribute('position', new THREE.BufferAttribute(pos, 3));
|
|
120
|
+
g.setAttribute('aMag', new THREE.BufferAttribute(mag, 1));
|
|
121
|
+
g.setAttribute('aPhase', new THREE.BufferAttribute(phase, 1));
|
|
122
|
+
g.setAttribute('aTint', new THREE.BufferAttribute(tint, 3));
|
|
123
|
+
return g;
|
|
124
|
+
}
|
|
125
|
+
const SkyStars = ({ timeSettings, skySettings, stars }) => {
|
|
126
|
+
const pointsRef = useRef(null);
|
|
127
|
+
const { update } = useCloudSun({ skySettings, timeSettings });
|
|
128
|
+
const { count, milkyWay, brightness, size, twinkle, warmth } = normalizeSkyStars(stars);
|
|
129
|
+
// Structural: a new dome only when count or the band changes.
|
|
130
|
+
const geometry = useMemo(() => buildStars(count, milkyWay), [count, milkyWay]);
|
|
131
|
+
const material = useMemo(() => new THREE.ShaderMaterial({
|
|
132
|
+
uniforms: {
|
|
133
|
+
uTime: { value: 0 },
|
|
134
|
+
uNight: { value: 0 },
|
|
135
|
+
uPixelRatio: { value: 1 },
|
|
136
|
+
uBrightness: { value: 1 },
|
|
137
|
+
uSize: { value: 1 },
|
|
138
|
+
uTwinkle: { value: 0.5 },
|
|
139
|
+
uWarmth: { value: 0.5 },
|
|
140
|
+
},
|
|
141
|
+
vertexShader,
|
|
142
|
+
fragmentShader,
|
|
143
|
+
transparent: true,
|
|
144
|
+
depthWrite: false,
|
|
145
|
+
depthTest: true,
|
|
146
|
+
blending: THREE.AdditiveBlending,
|
|
147
|
+
fog: false,
|
|
148
|
+
toneMapped: false,
|
|
149
|
+
}), []);
|
|
150
|
+
useEffect(() => () => geometry.dispose(), [geometry]);
|
|
151
|
+
useEffect(() => () => material.dispose(), [material]);
|
|
152
|
+
const spin = useMemo(() => new THREE.Quaternion(), []);
|
|
153
|
+
useFrame(({ camera, gl, clock }) => {
|
|
154
|
+
const points = pointsRef.current;
|
|
155
|
+
if (!points)
|
|
156
|
+
return;
|
|
157
|
+
// With the clock on, the stars belong to the day cycle: they come out as the sun
|
|
158
|
+
// sets (nightAmount). With the clock off they stand alone — the user adds them
|
|
159
|
+
// whenever they want, at full strength, whatever the sun's elevation.
|
|
160
|
+
let night = 1;
|
|
161
|
+
if (timeSettings?.enabled) {
|
|
162
|
+
const sunDir = update().direction;
|
|
163
|
+
const sunElevation = THREE.MathUtils.radToDeg(Math.asin(THREE.MathUtils.clamp(sunDir.y, -1, 1)));
|
|
164
|
+
night = nightAmount(sunElevation);
|
|
165
|
+
}
|
|
166
|
+
if (night <= 0.001) {
|
|
167
|
+
points.visible = false;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
points.visible = true;
|
|
171
|
+
const far = camera.far ?? 1000;
|
|
172
|
+
points.position.copy(camera.position);
|
|
173
|
+
points.scale.setScalar(far * 0.85);
|
|
174
|
+
// Turn with the clock about the pole, same sense as the sun (rises −Z, sets +Z).
|
|
175
|
+
const hours = timeSettings?.enabled ? skySystemManager.getTimeInHours() : 0;
|
|
176
|
+
points.quaternion.copy(spin.setFromAxisAngle(POLE, -(hours / SIDEREAL_HOURS) * Math.PI * 2));
|
|
177
|
+
material.uniforms.uTime.value = clock.elapsedTime;
|
|
178
|
+
material.uniforms.uNight.value = night;
|
|
179
|
+
material.uniforms.uPixelRatio.value = gl.getPixelRatio();
|
|
180
|
+
material.uniforms.uBrightness.value = brightness;
|
|
181
|
+
material.uniforms.uSize.value = size;
|
|
182
|
+
material.uniforms.uTwinkle.value = twinkle;
|
|
183
|
+
material.uniforms.uWarmth.value = warmth;
|
|
184
|
+
});
|
|
185
|
+
return _jsx("points", { ref: pointsRef, geometry: geometry, material: material, frustumCulled: false, renderOrder: -2 });
|
|
186
|
+
};
|
|
187
|
+
export default SkyStars;
|
|
@@ -26,9 +26,9 @@ export interface SkySystemRef {
|
|
|
26
26
|
export interface SkySystemProps extends ObjectReadyProps {
|
|
27
27
|
timeSettings: TimeSettings;
|
|
28
28
|
visible?: boolean;
|
|
29
|
-
/** True mounts the
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
/** True mounts the sun rig background (skybox + lensflare); false mounts the
|
|
30
|
+
* analytic Preetham sky instead. The key light (SunLight) is the same in both
|
|
31
|
+
* and is mounted whenever either sky is active. */
|
|
32
32
|
sunSystemVisible?: boolean;
|
|
33
33
|
sunSize?: number;
|
|
34
34
|
moonSize?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkySystem.d.ts","sourceRoot":"","sources":["../../src/components/SkySystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SkySystem.d.ts","sourceRoot":"","sources":["../../src/components/SkySystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAStE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;wDAEoD;IACpD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B;;;uBAGmB;IACnB,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,qBAAqB,CAAC,EAAE,WAAW,CAAC;IACpC;wDACoD;IACpD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;;;;;;;gFAU4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,SAAS,qFAmLb,CAAC;AAGH,eAAe,SAAS,CAAC"}
|
|
@@ -4,9 +4,10 @@ import { useEffect, useLayoutEffect, useMemo, useRef, forwardRef, useImperativeH
|
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
5
|
import { skySystemManager } from '@3driseai/3drise-core';
|
|
6
6
|
import Skybox from './Skybox.js';
|
|
7
|
-
import Lensflare from './Lensflare.js';
|
|
8
7
|
import SunLight from './SunLight.js';
|
|
8
|
+
import MoonDisc from './MoonDisc.js';
|
|
9
9
|
import SkyController from './SkyController.js';
|
|
10
|
+
import SkyStars from './SkyStars.js';
|
|
10
11
|
import SceneFog from './SceneFog.js';
|
|
11
12
|
import CloudsGenerator from './CloudsGenerator.js';
|
|
12
13
|
const SkySystem = forwardRef(({ timeSettings, visible = true, sunSystemVisible = false, sunSize = 1, moonSize = 1, skyboxScale = 100000, sunIntensity = 1, castShadow = true, shadowMapSize = 2048, playerPosition, cloudsSettings, skyControllerSettings, fogSettings, onTimeOfDayChange, onTimeUpdate, driveTime = true, onObjectReady, onObjectDispose, }, ref) => {
|
|
@@ -81,7 +82,12 @@ const SkySystem = forwardRef(({ timeSettings, visible = true, sunSystemVisible =
|
|
|
81
82
|
});
|
|
82
83
|
if (!visible)
|
|
83
84
|
return null;
|
|
84
|
-
|
|
85
|
+
// The key light exists whenever there is a sky to own the sun — either
|
|
86
|
+
// renderer. It is the scene's only sun while mounted (LightsManager's sun
|
|
87
|
+
// stands down), and it reads the same resolved sun as clouds, water and
|
|
88
|
+
// terrain.
|
|
89
|
+
const skyActive = !!skyControllerSettings?.visible || sunSystemVisible;
|
|
90
|
+
return (_jsxs("group", { ref: rootRef, children: [skyControllerSettings && !sunSystemVisible && (_jsx(SkyController, { settings: skyControllerSettings, timeSettings: timeSettings, scale: skyboxScale, ...ready })), sunSystemVisible && (_jsx(_Fragment, { children: _jsx(Skybox, { visible: true, scale: skyboxScale, sunSize: sunSize, moonSize: moonSize, timeSettings: timeSettings, ...ready }) })), skyActive && (_jsx(SunLight, { visible: true, timeSettings: timeSettings, skySettings: skyControllerSettings, targetPosition: playerPosition, intensity: sunIntensity, moonIntensity: skyControllerSettings?.sunSystem?.moonIntensity ?? 1, castShadow: castShadow, shadowMapSize: shadowMapSize, ...ready })), (skyActive ? skyControllerSettings?.stars?.visible !== false : skyControllerSettings?.stars?.visible === true) && (_jsx(SkyStars, { timeSettings: timeSettings, skySettings: skyControllerSettings, stars: skyControllerSettings?.stars })), skyActive && (_jsx(MoonDisc, { timeSettings: timeSettings, skySettings: skyControllerSettings, size: moonSize })), fogSettings && _jsx(SceneFog, { fog: fogSettings }), cloudsSettings && (_jsx(CloudsGenerator, { settings: cloudsSettings, skySettings: skyControllerSettings, timeSettings: timeSettings, sunIntensity: sunIntensity, ...ready }))] }));
|
|
85
91
|
});
|
|
86
92
|
SkySystem.displayName = 'SkySystem';
|
|
87
93
|
export default SkySystem;
|
package/dist/components/Sun.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
2
|
+
import * as THREE from 'three';
|
|
1
3
|
import type { ObjectReadyProps } from '../types/objectReady';
|
|
4
|
+
/** Live tint / brightness for the sun, written by its owner's push point (SolarSystem). */
|
|
5
|
+
export interface SunControl {
|
|
6
|
+
/** Tint relative to REFERENCE_TINT: the reference keeps the sun's own palette. */
|
|
7
|
+
color: THREE.Color;
|
|
8
|
+
/** Brightness relative to REFERENCE_INTENSITY. */
|
|
9
|
+
intensity: number;
|
|
10
|
+
}
|
|
11
|
+
/** The SolarSystem defaults: at these values the sun looks exactly as it was designed. */
|
|
12
|
+
export declare const SUN_REFERENCE_TINT: THREE.Color;
|
|
13
|
+
export declare const SUN_REFERENCE_INTENSITY = 3;
|
|
2
14
|
type SunProps = ObjectReadyProps & {
|
|
3
15
|
/** Radius of the sun core. Default 1. */
|
|
4
16
|
radius?: number;
|
|
@@ -10,7 +22,9 @@ type SunProps = ObjectReadyProps & {
|
|
|
10
22
|
coronaUniforms?: Record<string, any>;
|
|
11
23
|
/** Uniform overrides for SunFlareMaterial. */
|
|
12
24
|
flareUniforms?: Record<string, any>;
|
|
25
|
+
/** Read every frame: tints the surface ramp, the corona and the light, and scales their brightness. */
|
|
26
|
+
control?: MutableRefObject<SunControl>;
|
|
13
27
|
};
|
|
14
|
-
export default function Sun({ radius, coronaScale, coreUniforms, coronaUniforms, flareUniforms, onObjectReady, onObjectDispose, }: SunProps): import("react").JSX.Element;
|
|
28
|
+
export default function Sun({ radius, coronaScale, coreUniforms, coronaUniforms, flareUniforms, control, onObjectReady, onObjectDispose, }: SunProps): import("react").JSX.Element;
|
|
15
29
|
export {};
|
|
16
30
|
//# sourceMappingURL=Sun.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sun.d.ts","sourceRoot":"","sources":["../../src/components/Sun.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sun.d.ts","sourceRoot":"","sources":["../../src/components/Sun.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,2FAA2F;AAC3F,MAAM,WAAW,UAAU;IACvB,kFAAkF;IAClF,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,aAA6B,CAAC;AAC7D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,KAAK,QAAQ,GAAG,gBAAgB,GAAG;IAC/B,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,uGAAuG;IACvG,OAAO,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;CAC1C,CAAC;AAeF,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,MAAU,EAAE,WAAkB,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,GAAG,EAAE,QAAQ,+BA6C9J"}
|
package/dist/components/Sun.js
CHANGED
|
@@ -1,11 +1,72 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
3
5
|
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
4
|
-
// import { ReactNode } from "react";
|
|
5
6
|
import SunCore from "./SunCore.js";
|
|
6
7
|
import Corona from "./effects/Corona.js";
|
|
7
|
-
|
|
8
|
+
/** The SolarSystem defaults: at these values the sun looks exactly as it was designed. */
|
|
9
|
+
export const SUN_REFERENCE_TINT = new THREE.Color('#ffd27a');
|
|
10
|
+
export const SUN_REFERENCE_INTENSITY = 3;
|
|
11
|
+
const LAVA_COLORS = ['u_color1', 'u_color2', 'u_color3', 'u_color4', 'u_color5', 'u_rimColor'];
|
|
12
|
+
const CORONA_COLORS = ['u_innerColor', 'u_outerColor'];
|
|
13
|
+
const LIGHT_COLOR = '#ffa544';
|
|
14
|
+
const LIGHT_INTENSITY = 6;
|
|
15
|
+
export default function Sun({ radius = 1, coronaScale = 1.25, coreUniforms, coronaUniforms, flareUniforms, control, onObjectReady, onObjectDispose, }) {
|
|
8
16
|
const rootRef = useRef(null);
|
|
17
|
+
const lightRef = useRef(null);
|
|
18
|
+
const cache = useRef(null);
|
|
19
|
+
const ratio = useRef(new THREE.Vector3());
|
|
9
20
|
useObjectReady(rootRef, { radius, coronaScale }, onObjectReady, onObjectDispose);
|
|
10
|
-
|
|
21
|
+
useFrame(() => {
|
|
22
|
+
if (!control || !rootRef.current)
|
|
23
|
+
return;
|
|
24
|
+
if (!cache.current) {
|
|
25
|
+
const c = { lava: null, corona: null, light: lightRef.current, base: {} };
|
|
26
|
+
rootRef.current.traverse((o) => {
|
|
27
|
+
const u = o.material?.uniforms;
|
|
28
|
+
if (!u)
|
|
29
|
+
return;
|
|
30
|
+
if (u.u_color1 && !c.lava)
|
|
31
|
+
c.lava = o.material;
|
|
32
|
+
else if (u.u_innerColor && !c.corona)
|
|
33
|
+
c.corona = o.material;
|
|
34
|
+
});
|
|
35
|
+
if (!c.lava || !c.corona || !c.light)
|
|
36
|
+
return;
|
|
37
|
+
// Own the vectors before writing into them: shaderMaterial defaults may be shared between instances.
|
|
38
|
+
for (const k of LAVA_COLORS) {
|
|
39
|
+
const u = c.lava.uniforms[k];
|
|
40
|
+
c.base[k] = u.value.clone();
|
|
41
|
+
u.value = u.value.clone();
|
|
42
|
+
}
|
|
43
|
+
for (const k of CORONA_COLORS) {
|
|
44
|
+
const u = c.corona.uniforms[k];
|
|
45
|
+
c.base[k] = u.value.clone();
|
|
46
|
+
u.value = u.value.clone();
|
|
47
|
+
}
|
|
48
|
+
c.base.u_brightness = c.lava.uniforms.u_brightness.value;
|
|
49
|
+
c.base.u_intensity = c.corona.uniforms.u_intensity?.value ?? 1;
|
|
50
|
+
cache.current = c;
|
|
51
|
+
}
|
|
52
|
+
const c = cache.current;
|
|
53
|
+
const { color, intensity } = control.current;
|
|
54
|
+
// Per-channel ratio to the reference tint (clamped): the designed palette at the reference.
|
|
55
|
+
ratio.current.set(Math.min(4, color.r / SUN_REFERENCE_TINT.r), Math.min(4, color.g / SUN_REFERENCE_TINT.g), Math.min(4, color.b / SUN_REFERENCE_TINT.b));
|
|
56
|
+
const gain = Math.max(0, intensity / SUN_REFERENCE_INTENSITY);
|
|
57
|
+
for (const k of LAVA_COLORS)
|
|
58
|
+
c.lava.uniforms[k].value.copy(c.base[k]).multiply(ratio.current);
|
|
59
|
+
for (const k of CORONA_COLORS)
|
|
60
|
+
c.corona.uniforms[k].value.copy(c.base[k]).multiply(ratio.current);
|
|
61
|
+
c.lava.uniforms.u_brightness.value = c.base.u_brightness * gain;
|
|
62
|
+
if (c.corona.uniforms.u_intensity)
|
|
63
|
+
c.corona.uniforms.u_intensity.value = c.base.u_intensity * gain;
|
|
64
|
+
const light = c.light;
|
|
65
|
+
light.color.set(LIGHT_COLOR);
|
|
66
|
+
light.color.r *= ratio.current.x;
|
|
67
|
+
light.color.g *= ratio.current.y;
|
|
68
|
+
light.color.b *= ratio.current.z;
|
|
69
|
+
light.intensity = LIGHT_INTENSITY * gain;
|
|
70
|
+
});
|
|
71
|
+
return (_jsxs("group", { ref: rootRef, children: [_jsx(SunCore, { radius: radius, uniforms: coreUniforms }), _jsx(Corona, { radius: radius, shellScale: coronaScale, uniforms: coronaUniforms }), _jsx("pointLight", { ref: lightRef, color: LIGHT_COLOR, intensity: LIGHT_INTENSITY, distance: 60, decay: 1.6 })] }));
|
|
11
72
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { ObjectReadyProps } from '../types/objectReady';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
3
|
import React from "react";
|
|
4
|
-
import type { TimeSettings } from "@3driseai/3drise-core";
|
|
4
|
+
import type { SkySettings, TimeSettings } from "@3driseai/3drise-core";
|
|
5
5
|
export interface SunLightProps extends ObjectReadyProps {
|
|
6
6
|
visible?: boolean;
|
|
7
7
|
timeSettings: TimeSettings;
|
|
8
|
+
/** The sky this sun belongs to — the static sun when time of day is off and
|
|
9
|
+
* no Preetham sky is publishing what it drew. */
|
|
10
|
+
skySettings?: SkySettings;
|
|
8
11
|
targetPosition?: THREE.Vector3;
|
|
9
12
|
shadowDistance?: number;
|
|
10
13
|
intensity?: number;
|
|
14
|
+
/** Multiplier on moonlight. */
|
|
15
|
+
moonIntensity?: number;
|
|
11
16
|
castShadow?: boolean;
|
|
12
17
|
shadowMapSize?: number;
|
|
13
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SunLight.d.ts","sourceRoot":"","sources":["../../src/components/SunLight.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SunLight.d.ts","sourceRoot":"","sources":["../../src/components/SunLight.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAKvE,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B;sDACkD;IAClD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAiED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0DrC,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,59 +1,111 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { useFrame, useThree } from '@react-three/fiber';
|
|
6
|
+
import { useCloudSun, computeCloudSun } from '../hooks/useCloudSun.js';
|
|
7
|
+
import { claimSceneSun } from '../utils/renderedSky.js';
|
|
8
|
+
import { resolveMoon, moonlightFactor, MOON_LIGHT_COLOR } from '../utils/skyMoon.js';
|
|
9
|
+
/**
|
|
10
|
+
* The scene's key light while a sky is active — the ONE sun.
|
|
11
|
+
*
|
|
12
|
+
* Direction comes from useCloudSun, the same resolver the clouds, the water and
|
|
13
|
+
* the terrain use: what the sky drew this frame, else the day-cycle clock, else
|
|
14
|
+
* the stored sun. So the disc, the light and every sky-lit surface agree.
|
|
15
|
+
*
|
|
16
|
+
* Colour is the direct beam through a clear atmosphere (Kasten-Young air mass,
|
|
17
|
+
* the cloud model's own computeCloudSun), white-balanced to the overhead sun:
|
|
18
|
+
* white at noon, warm through the afternoon, deep orange and dim at the horizon,
|
|
19
|
+
* with no colour tables or hour constants. The atmosphere for the beam is fixed
|
|
20
|
+
* to clear air on purpose: Preetham's turbidity/rayleigh are artistic sky knobs
|
|
21
|
+
* (the time curve pushes rayleigh to 3.5 at sunset) and fed into a physical beam
|
|
22
|
+
* they black the scene out at exactly the hour it should glow.
|
|
23
|
+
*
|
|
24
|
+
* Below the horizon it hands over to the moon: one light, so one set of
|
|
25
|
+
* shadows. Through twilight (sun −1° … −8°) moonlight fades in; its strength
|
|
26
|
+
* follows the lit fraction of the moon (full bright, new none) and the moon's
|
|
27
|
+
* own height. Cool tint, weaker and softer shadows. Neither up → light off.
|
|
28
|
+
*
|
|
29
|
+
* While mounted it claims the scene's sun, so LightsManager's general-purpose
|
|
30
|
+
* sun stands down (see claimSceneSun).
|
|
31
|
+
*/
|
|
32
|
+
/** Light intensity for the overhead sun at `intensity` 1. π because three's
|
|
33
|
+
* physically-correct lights divide diffuse by π: at π a white surface facing
|
|
34
|
+
* the overhead sun renders at its own albedo. Tuning knob. */
|
|
35
|
+
const KEY_BASE_INTENSITY = Math.PI;
|
|
36
|
+
/** Elevation, in degrees, over which the light fades in: the disc is fully
|
|
37
|
+
* set at −1° (half-diameter plus refraction) and the beam is unoccluded by 4°. */
|
|
38
|
+
const FADE_START = -1;
|
|
39
|
+
const FADE_END = 4;
|
|
40
|
+
/** Moonlight at full moon, overhead, `moonIntensity` 1. Real moonlight is
|
|
41
|
+
* ~1/400 000 of the sun; this is compressed until exposure handles night.
|
|
42
|
+
* Tuning knob. */
|
|
43
|
+
const MOON_BASE_INTENSITY = 0.3;
|
|
44
|
+
const SUN_SHADOW_INTENSITY = 1;
|
|
45
|
+
const MOON_SHADOW_INTENSITY = 0.6;
|
|
46
|
+
const smooth01 = (edge0, edge1, x) => {
|
|
47
|
+
const t = THREE.MathUtils.clamp((x - edge0) / (edge1 - edge0), 0, 1);
|
|
48
|
+
return t * t * (3 - 2 * t);
|
|
10
49
|
};
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
50
|
+
const elevationOf = (dir) => THREE.MathUtils.radToDeg(Math.asin(THREE.MathUtils.clamp(dir.y, -1, 1)));
|
|
51
|
+
const CLEAR_AIR = { turbidity: 2, rayleigh: 1, mieCoefficient: 0.005 };
|
|
52
|
+
const newSunState = () => ({
|
|
53
|
+
direction: new THREE.Vector3(),
|
|
54
|
+
color: new THREE.Color(),
|
|
55
|
+
skyAmbient: new THREE.Color(),
|
|
56
|
+
groundAmbient: new THREE.Color(),
|
|
57
|
+
turbidity: 0, rayleigh: 0, mieCoefficient: 0, mieG: 0,
|
|
58
|
+
});
|
|
59
|
+
/** Beam colour of the sun straight overhead — the white point. */
|
|
60
|
+
const ZENITH = computeCloudSun(new THREE.Vector3(0, 1, 0), CLEAR_AIR, newSunState()).color.clone();
|
|
16
61
|
/** Shared so the default does not hand a fresh Vector3 to the deps array on every
|
|
17
|
-
* render
|
|
62
|
+
* render. */
|
|
18
63
|
const ORIGIN = new THREE.Vector3(0, 0, 0);
|
|
19
|
-
const SunLight = ({ visible = true, timeSettings, targetPosition = ORIGIN, shadowDistance = 300, intensity: intensityMultiplier = 1, castShadow = true, shadowMapSize = 2048, onObjectReady, onObjectDispose, }) => {
|
|
64
|
+
const SunLight = ({ visible = true, timeSettings, skySettings, targetPosition = ORIGIN, shadowDistance = 300, intensity: intensityMultiplier = 1, moonIntensity = 1, castShadow = true, shadowMapSize = 2048, onObjectReady, onObjectDispose, }) => {
|
|
20
65
|
const lightRef = useRef(null);
|
|
21
66
|
useObjectReady(lightRef, { visible, timeSettings, intensity: intensityMultiplier, castShadow, shadowMapSize }, onObjectReady, onObjectDispose);
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
67
|
+
const scene = useThree(s => s.scene);
|
|
68
|
+
const { update } = useCloudSun({ skySettings, timeSettings });
|
|
69
|
+
const beam = useRef(newSunState());
|
|
70
|
+
const moon = useRef({ direction: new THREE.Vector3(), illumination: 0 });
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (!visible)
|
|
73
|
+
return;
|
|
74
|
+
return claimSceneSun(scene);
|
|
75
|
+
}, [scene, visible]);
|
|
76
|
+
useFrame(() => {
|
|
77
|
+
const light = lightRef.current;
|
|
78
|
+
if (!light)
|
|
79
|
+
return;
|
|
80
|
+
const sunDir = update().direction;
|
|
81
|
+
const sunElevation = elevationOf(sunDir);
|
|
82
|
+
const sunFade = smooth01(FADE_START, FADE_END, sunElevation);
|
|
83
|
+
let dir;
|
|
84
|
+
if (sunFade > 0) {
|
|
85
|
+
dir = sunDir;
|
|
86
|
+
const c = computeCloudSun(sunDir, CLEAR_AIR, beam.current).color;
|
|
87
|
+
light.color.setRGB(Math.min(1, c.r / ZENITH.r), Math.min(1, c.g / ZENITH.g), Math.min(1, c.b / ZENITH.b));
|
|
88
|
+
light.intensity = KEY_BASE_INTENSITY * intensityMultiplier * sunFade;
|
|
89
|
+
light.shadow.intensity = SUN_SHADOW_INTENSITY;
|
|
37
90
|
}
|
|
38
91
|
else {
|
|
39
|
-
|
|
40
|
-
|
|
92
|
+
// The sun is fully set, so the hand-over is continuous: the sun's term
|
|
93
|
+
// is already 0 at −1°, which is where night starts fading in.
|
|
94
|
+
const m = resolveMoon(timeSettings, sunDir, moon.current);
|
|
95
|
+
dir = m.direction;
|
|
96
|
+
light.color.setRGB(MOON_LIGHT_COLOR.r, MOON_LIGHT_COLOR.g, MOON_LIGHT_COLOR.b);
|
|
97
|
+
light.intensity = MOON_BASE_INTENSITY * moonIntensity * moonlightFactor(sunElevation, m);
|
|
98
|
+
light.shadow.intensity = MOON_SHADOW_INTENSITY;
|
|
41
99
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
lightRef.current.position.set(targetPosition.x + sunDirection.x * shadowDistance, targetPosition.y + sunDirection.y * shadowDistance, targetPosition.z + sunDirection.z * shadowDistance);
|
|
47
|
-
lightRef.current.target.position.copy(targetPosition);
|
|
48
|
-
lightRef.current.target.updateMatrixWorld();
|
|
49
|
-
lightRef.current.intensity = intensityRef.current * intensityMultiplier;
|
|
50
|
-
lightRef.current.color.copy(colorRef.current);
|
|
100
|
+
if (light.intensity <= 1e-4) {
|
|
101
|
+
// Off, not dim: an invisible light also skips its shadow pass.
|
|
102
|
+
light.visible = false;
|
|
103
|
+
return;
|
|
51
104
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
enabled: visible,
|
|
105
|
+
light.visible = true;
|
|
106
|
+
light.position.set(targetPosition.x + dir.x * shadowDistance, targetPosition.y + dir.y * shadowDistance, targetPosition.z + dir.z * shadowDistance);
|
|
107
|
+
light.target.position.copy(targetPosition);
|
|
108
|
+
light.target.updateMatrixWorld();
|
|
57
109
|
});
|
|
58
110
|
if (!visible)
|
|
59
111
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainBuilder.d.ts","sourceRoot":"","sources":["../../src/components/TerrainBuilder.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,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAOvE,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IACzD;;mEAE+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC;IACrD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"TerrainBuilder.d.ts","sourceRoot":"","sources":["../../src/components/TerrainBuilder.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,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAOvE,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IACzD;;mEAE+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC;IACrD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiCjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
3
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
4
|
+
type TextGeneratorProps = ObjectReadyProps & {
|
|
5
|
+
createdObject: CreatedObjectSettings;
|
|
6
|
+
};
|
|
7
|
+
declare const TextGenerator: React.FC<TextGeneratorProps>;
|
|
8
|
+
export default TextGenerator;
|
|
9
|
+
//# sourceMappingURL=TextGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextGenerator.d.ts","sourceRoot":"","sources":["../../src/components/TextGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAA2C,MAAM,uBAAuB,CAAC;AAC5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,KAAK,kBAAkB,GAAG,gBAAgB,GAAG;IACzC,aAAa,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAkBF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAc/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HandwritingText, NeonTubeText, FourierSketchText, FrostGrowthText, PlasmaDischargeText, BurnAwayText, LightPaintingText, ConstellationText, InkBleedText, LiquidMetalText, EmbroideryText, ChalkboardText } from './text/index.js';
|
|
3
|
+
/** The text looks' components by config.type (the legacy bitmap / 3D text is rendered by ObjectNode, not here). */
|
|
4
|
+
const FAMILY = {
|
|
5
|
+
handwriting: HandwritingText,
|
|
6
|
+
neonTube: NeonTubeText,
|
|
7
|
+
fourierSketch: FourierSketchText,
|
|
8
|
+
frostGrowth: FrostGrowthText,
|
|
9
|
+
plasmaDischarge: PlasmaDischargeText,
|
|
10
|
+
burnAway: BurnAwayText,
|
|
11
|
+
lightPainting: LightPaintingText,
|
|
12
|
+
constellation: ConstellationText,
|
|
13
|
+
inkBleed: InkBleedText,
|
|
14
|
+
liquidMetal: LiquidMetalText,
|
|
15
|
+
embroidery: EmbroideryText,
|
|
16
|
+
chalkboard: ChalkboardText,
|
|
17
|
+
};
|
|
18
|
+
const TextGenerator = ({ createdObject, onObjectReady, onObjectDispose }) => {
|
|
19
|
+
const config = createdObject.config;
|
|
20
|
+
if (!config)
|
|
21
|
+
return null;
|
|
22
|
+
const Component = FAMILY[config.type];
|
|
23
|
+
if (!Component)
|
|
24
|
+
return null;
|
|
25
|
+
// Every look renders the same way: FAMILY is the only per-key entry. `enabled` is not a gate here: the text stays
|
|
26
|
+
// mounted and the look plays its erase animation when it goes false.
|
|
27
|
+
return _jsx(Component, { config: config, id: createdObject.id, keyframes: createdObject.animations?.text?.animations, mouseMove: createdObject.mouseMove?.text, onObjectReady: (_source, ref) => onObjectReady?.(createdObject, ref), onObjectDispose: (_source, ref) => onObjectDispose?.(createdObject, ref) });
|
|
28
|
+
};
|
|
29
|
+
export default TextGenerator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ThreeElements } from '@react-three/fiber';
|
|
2
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
3
|
+
import type { TruchetGridConfig } from '../types/gridConfigs';
|
|
4
|
+
import type { AnimationOptions, MouseMoveDomain } from '@3driseai/3drise-core';
|
|
5
|
+
export interface TruchetGridProps extends ObjectReadyProps {
|
|
6
|
+
config?: TruchetGridConfig;
|
|
7
|
+
groupProps?: ThreeElements['group'];
|
|
8
|
+
/** Scene object id: the live-edit handle is found by it. */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Keyframes on this grid's config knobs (animations.grid.animations). */
|
|
11
|
+
keyframes?: AnimationOptions[];
|
|
12
|
+
/** Pointer bindings on this grid's config knobs (mouseMove.grid). */
|
|
13
|
+
mouseMove?: MouseMoveDomain;
|
|
14
|
+
}
|
|
15
|
+
/** TruchetGridConfig defaults: the core registry entry (DEFAULT_GRIDS.truchetGrid), never a copy. */
|
|
16
|
+
export declare const defaultTruchetGridConfig: TruchetGridConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Smith quarter-circle Truchet tiles: arcs always meet arcs, so the plane fills with endless two-coloured loops. Tiles re-deal by turning a quarter turn, and comets travel the loops in one direction.
|
|
19
|
+
*
|
|
20
|
+
* The grid always lies flat: any other orientation, and any movement of the
|
|
21
|
+
* whole, is the parent object's transform. Only what happens inside it animates.
|
|
22
|
+
*/
|
|
23
|
+
export declare function TruchetGrid({ config, groupProps, id, keyframes, mouseMove, onObjectReady, onObjectDispose }: TruchetGridProps): import("react").JSX.Element;
|
|
24
|
+
export default TruchetGrid;
|
|
25
|
+
//# sourceMappingURL=TruchetGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TruchetGrid.d.ts","sourceRoot":"","sources":["../../src/components/TruchetGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACtD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACpC,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,qEAAqE;IACrE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAKD,qGAAqG;AACrG,eAAO,MAAM,wBAAwB,EAA2C,iBAAiB,CAAC;AAWlG;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAiC,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,gBAAgB,+BA4CxJ;AAED,eAAe,WAAW,CAAC"}
|