@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,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
5
|
+
import { useGridSurface } from '../hooks/useGridSurface.js';
|
|
6
|
+
import { useConfigDriver } from '../hooks/useConfigDriver.js';
|
|
7
|
+
import { withConfigDefaults } from '../utils/configAnimations.js';
|
|
8
|
+
import { applyGridConfig, GRID_STRUCTURAL } from '../utils/gridConfig.js';
|
|
9
|
+
import { TruchetGridMaterial, DEFAULT_GRIDS, GRIDS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
10
|
+
// Side-effect import registers <truchetGridMaterial> via extend().
|
|
11
|
+
void TruchetGridMaterial;
|
|
12
|
+
/** TruchetGridConfig defaults: the core registry entry (DEFAULT_GRIDS.truchetGrid), never a copy. */
|
|
13
|
+
export const defaultTruchetGridConfig = DEFAULT_GRIDS.truchetGrid;
|
|
14
|
+
/** This grid's own uniforms (u_<key>), pushed by applyGridConfig beside the shared surface knobs. */
|
|
15
|
+
const VARIANT = ['flip', 'bias', 'pulse', 'regionFill'];
|
|
16
|
+
/** No computed uniforms: every knob maps straight to its u_<key>. */
|
|
17
|
+
const DERIVE = {};
|
|
18
|
+
/** Knobs that reshape the plane or pick a mode: they change on commit, never through the live path. */
|
|
19
|
+
const STRUCTURAL = [...GRID_STRUCTURAL];
|
|
20
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what applyGridConfig pushes. */
|
|
21
|
+
const ANIMATABLE = new Set((GRIDS_ANIMATABLE.truchetGrid ?? []).map((p) => p.value));
|
|
22
|
+
/**
|
|
23
|
+
* 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.
|
|
24
|
+
*
|
|
25
|
+
* The grid always lies flat: any other orientation, and any movement of the
|
|
26
|
+
* whole, is the parent object's transform. Only what happens inside it animates.
|
|
27
|
+
*/
|
|
28
|
+
export function TruchetGrid({ config = defaultTruchetGridConfig, groupProps, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) {
|
|
29
|
+
const matRef = useRef(null);
|
|
30
|
+
const rootRef = useRef(null);
|
|
31
|
+
const meshRef = useRef(null);
|
|
32
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
33
|
+
// The committed config over this grid's defaults: every knob has a value to render
|
|
34
|
+
// and for a keyframe or pointer binding to start from.
|
|
35
|
+
const base = useMemo(() => withConfigDefaults(defaultTruchetGridConfig, config), [config]);
|
|
36
|
+
const { cellSize, size, segments, displace, reveal, revealDuration } = base;
|
|
37
|
+
const segs = segments ?? (displace > 0
|
|
38
|
+
? Math.min(256, Math.max(64, Math.ceil(size / Math.max(cellSize, 1e-4)) * 2))
|
|
39
|
+
: 1);
|
|
40
|
+
useGridSurface(matRef, meshRef, { reveal, revealDuration });
|
|
41
|
+
// One push point for every uniform the config owns: the committed config when the
|
|
42
|
+
// material mounts or the config commits, the merged one while anything overrides it.
|
|
43
|
+
const baseRef = useRef(base);
|
|
44
|
+
baseRef.current = base;
|
|
45
|
+
const setMaterial = useCallback((m) => {
|
|
46
|
+
matRef.current = m;
|
|
47
|
+
if (m)
|
|
48
|
+
applyGridConfig(m, baseRef.current, VARIANT, DERIVE);
|
|
49
|
+
}, []);
|
|
50
|
+
useLayoutEffect(() => { applyGridConfig(matRef.current, base, VARIANT, DERIVE); }, [base]);
|
|
51
|
+
const push = useCallback((merged) => applyGridConfig(matRef.current, merged, VARIANT, DERIVE), []);
|
|
52
|
+
useConfigDriver({ rootRef, id, family: 'grids', base, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
53
|
+
return (_jsx("group", { ref: rootRef, ...groupProps, children: _jsxs("mesh", { ref: meshRef, rotation: [-Math.PI / 2, 0, 0], children: [_jsx("planeGeometry", { args: [size, size, segs, segs] }), _jsx("truchetGridMaterial", { ref: setMaterial, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, side: THREE.DoubleSide }, TruchetGridMaterial.key)] }) }));
|
|
54
|
+
}
|
|
55
|
+
export default TruchetGrid;
|
|
@@ -12,7 +12,7 @@ export interface VoronoiGridProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Pointer bindings on this grid's config knobs (mouseMove.grid). */
|
|
13
13
|
mouseMove?: MouseMoveDomain;
|
|
14
14
|
}
|
|
15
|
-
/** VoronoiGridConfig
|
|
15
|
+
/** VoronoiGridConfig defaults: the core registry entry (DEFAULT_GRIDS.voronoiGrid), never a copy. */
|
|
16
16
|
export declare const defaultVoronoiGridConfig: VoronoiGridConfig;
|
|
17
17
|
export declare function VoronoiGrid({ config, groupProps, id, keyframes, mouseMove, onObjectReady, onObjectDispose }: VoronoiGridProps): import("react").JSX.Element;
|
|
18
18
|
export default VoronoiGrid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoronoiGrid.d.ts","sourceRoot":"","sources":["../../src/components/VoronoiGrid.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,
|
|
1
|
+
{"version":3,"file":"VoronoiGrid.d.ts","sourceRoot":"","sources":["../../src/components/VoronoiGrid.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;AAoBlG,wBAAgB,WAAW,CAAC,EAAE,MAAiC,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,gBAAgB,+BA6CxJ;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -6,38 +6,11 @@ import { useGridSurface } from '../hooks/useGridSurface.js';
|
|
|
6
6
|
import { useConfigDriver } from '../hooks/useConfigDriver.js';
|
|
7
7
|
import { withConfigDefaults } from '../utils/configAnimations.js';
|
|
8
8
|
import { applyGridConfig, GRID_STRUCTURAL } from '../utils/gridConfig.js';
|
|
9
|
-
import { VoronoiGridMaterial, GRIDS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
9
|
+
import { VoronoiGridMaterial, DEFAULT_GRIDS, GRIDS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
10
10
|
// Side-effect import registers <voronoiGridMaterial> via extend().
|
|
11
11
|
void VoronoiGridMaterial;
|
|
12
|
-
/** VoronoiGridConfig
|
|
13
|
-
export const defaultVoronoiGridConfig =
|
|
14
|
-
cellSize: 3,
|
|
15
|
-
size: 50,
|
|
16
|
-
segments: undefined,
|
|
17
|
-
flat: true,
|
|
18
|
-
lineMode: 1, // ripple out from the focus point
|
|
19
|
-
cellMode: 2, // twinkle
|
|
20
|
-
lineWidth: 1.4,
|
|
21
|
-
sectionSize: 4,
|
|
22
|
-
sectionWidth: 1,
|
|
23
|
-
animSpeed: 1,
|
|
24
|
-
animScale: 0.5,
|
|
25
|
-
animIntensity: 1,
|
|
26
|
-
fadeDistance: undefined,
|
|
27
|
-
fadeStrength: 0.7,
|
|
28
|
-
displace: 0,
|
|
29
|
-
jitter: 0.9,
|
|
30
|
-
drift: 0.5,
|
|
31
|
-
lineColor: '#5a339e',
|
|
32
|
-
sectionColor: '#d999ff',
|
|
33
|
-
cellColor: '#1f0d47',
|
|
34
|
-
glowColor: '#b366ff',
|
|
35
|
-
bgColor: '#05030d',
|
|
36
|
-
bgOpacity: 0,
|
|
37
|
-
followMouse: false,
|
|
38
|
-
reveal: 1,
|
|
39
|
-
revealDuration: 0,
|
|
40
|
-
};
|
|
12
|
+
/** VoronoiGridConfig defaults: the core registry entry (DEFAULT_GRIDS.voronoiGrid), never a copy. */
|
|
13
|
+
export const defaultVoronoiGridConfig = DEFAULT_GRIDS.voronoiGrid;
|
|
41
14
|
/**
|
|
42
15
|
* An irregular cellular lattice on a shader plane.
|
|
43
16
|
*
|
|
@@ -63,11 +36,11 @@ export function VoronoiGrid({ config = defaultVoronoiGridConfig, groupProps, id,
|
|
|
63
36
|
// The committed config over this grid's defaults: every knob has a value to render
|
|
64
37
|
// and for a keyframe or pointer binding to start from.
|
|
65
38
|
const base = useMemo(() => withConfigDefaults(defaultVoronoiGridConfig, config), [config]);
|
|
66
|
-
const { cellSize, size, segments,
|
|
39
|
+
const { cellSize, size, segments, displace, reveal, revealDuration } = base;
|
|
67
40
|
const segs = segments ?? (displace > 0
|
|
68
41
|
? Math.min(384, Math.max(96, Math.ceil(size / Math.max(cellSize, 1e-4)) * 6))
|
|
69
42
|
: 1);
|
|
70
|
-
useGridSurface(matRef, meshRef, {
|
|
43
|
+
useGridSurface(matRef, meshRef, { reveal, revealDuration });
|
|
71
44
|
// One push point for every uniform the config owns: the committed config when the
|
|
72
45
|
// material mounts or the config commits, the merged one while anything overrides it.
|
|
73
46
|
const baseRef = useRef(base);
|
|
@@ -80,6 +53,6 @@ export function VoronoiGrid({ config = defaultVoronoiGridConfig, groupProps, id,
|
|
|
80
53
|
useLayoutEffect(() => { applyGridConfig(matRef.current, base, VARIANT, DERIVE); }, [base]);
|
|
81
54
|
const push = useCallback((merged) => applyGridConfig(matRef.current, merged, VARIANT, DERIVE), []);
|
|
82
55
|
useConfigDriver({ rootRef, id, family: 'grids', base, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
83
|
-
return (_jsx("group", { ref: rootRef, ...groupProps, children: _jsxs("mesh", { ref: meshRef, rotation:
|
|
56
|
+
return (_jsx("group", { ref: rootRef, ...groupProps, children: _jsxs("mesh", { ref: meshRef, rotation: [-Math.PI / 2, 0, 0], children: [_jsx("planeGeometry", { args: [size, size, segs, segs] }), _jsx("voronoiGridMaterial", { ref: setMaterial, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, side: THREE.DoubleSide }, VoronoiGridMaterial.key)] }) }));
|
|
84
57
|
}
|
|
85
58
|
export default VoronoiGrid;
|
|
@@ -12,7 +12,7 @@ export interface WallpaperGridProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Pointer bindings on this grid's config knobs (mouseMove.grid). */
|
|
13
13
|
mouseMove?: MouseMoveDomain;
|
|
14
14
|
}
|
|
15
|
-
/** WallpaperGridConfig defaults
|
|
15
|
+
/** WallpaperGridConfig defaults: the core registry entry (DEFAULT_GRIDS.wallpaperGrid), never a copy. */
|
|
16
16
|
export declare const defaultWallpaperGridConfig: WallpaperGridConfig;
|
|
17
17
|
/**
|
|
18
18
|
* Wallpaper-group kaleidoscope: a drifting lattice-periodic Fourier motif summed over the coset representatives of one of the 17 plane crystallographic groups. The runtime builds the group tables and crossfades from group to group.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WallpaperGrid.d.ts","sourceRoot":"","sources":["../../src/components/WallpaperGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,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,
|
|
1
|
+
{"version":3,"file":"WallpaperGrid.d.ts","sourceRoot":"","sources":["../../src/components/WallpaperGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,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,yGAAyG;AACzG,eAAO,MAAM,0BAA0B,EAA6C,mBAAmB,CAAC;AAkQxG;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAmC,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,kBAAkB,+BA0D9J;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -7,40 +7,11 @@ import { useGridSurface } from '../hooks/useGridSurface.js';
|
|
|
7
7
|
import { useConfigDriver } from '../hooks/useConfigDriver.js';
|
|
8
8
|
import { withConfigDefaults } from '../utils/configAnimations.js';
|
|
9
9
|
import { applyGridConfig, GRID_STRUCTURAL } from '../utils/gridConfig.js';
|
|
10
|
-
import { WallpaperGridMaterial, GRIDS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
10
|
+
import { WallpaperGridMaterial, DEFAULT_GRIDS, GRIDS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
11
11
|
// Side-effect import registers <wallpaperGridMaterial> via extend().
|
|
12
12
|
void WallpaperGridMaterial;
|
|
13
|
-
/** WallpaperGridConfig defaults
|
|
14
|
-
export const defaultWallpaperGridConfig =
|
|
15
|
-
cellSize: 10,
|
|
16
|
-
size: 50,
|
|
17
|
-
flat: true,
|
|
18
|
-
segments: undefined,
|
|
19
|
-
lineMode: 2,
|
|
20
|
-
cellMode: 2,
|
|
21
|
-
lineWidth: 2,
|
|
22
|
-
sectionSize: 0,
|
|
23
|
-
sectionWidth: 1.4,
|
|
24
|
-
animSpeed: 1,
|
|
25
|
-
animScale: 0.6,
|
|
26
|
-
animIntensity: 0.55,
|
|
27
|
-
fadeDistance: undefined,
|
|
28
|
-
fadeStrength: 0.7,
|
|
29
|
-
displace: 0,
|
|
30
|
-
group: -1,
|
|
31
|
-
cycleTime: 12,
|
|
32
|
-
motif: 0.5,
|
|
33
|
-
levels: 11,
|
|
34
|
-
lineColor: '#f3d79b',
|
|
35
|
-
sectionColor: '#7fd6ff',
|
|
36
|
-
cellColor: '#101c50',
|
|
37
|
-
glowColor: '#ff9ec7',
|
|
38
|
-
bgColor: '#05070a',
|
|
39
|
-
bgOpacity: 0,
|
|
40
|
-
followMouse: false,
|
|
41
|
-
reveal: 1,
|
|
42
|
-
revealDuration: 0,
|
|
43
|
-
};
|
|
13
|
+
/** WallpaperGridConfig defaults: the core registry entry (DEFAULT_GRIDS.wallpaperGrid), never a copy. */
|
|
14
|
+
export const defaultWallpaperGridConfig = DEFAULT_GRIDS.wallpaperGrid;
|
|
44
15
|
// ---------------------------------------------------------------------------
|
|
45
16
|
// The 17 wallpaper groups (Farris, "Creating Symmetry").
|
|
46
17
|
// Each group is listed by its ITA general positions in lattice coordinates:
|
|
@@ -341,10 +312,10 @@ export function WallpaperGrid({ config = defaultWallpaperGridConfig, groupProps,
|
|
|
341
312
|
// The committed config over this grid's defaults: every knob has a value to render
|
|
342
313
|
// and for a keyframe or pointer binding to start from.
|
|
343
314
|
const base = useMemo(() => withConfigDefaults(defaultWallpaperGridConfig, config), [config]);
|
|
344
|
-
const { cellSize, size, segments,
|
|
315
|
+
const { cellSize, size, segments, displace, reveal, revealDuration } = base;
|
|
345
316
|
// the motif has up to ~3 waves per unit cell, so 16 vertices per cell keep the displaced relief smooth
|
|
346
317
|
const segs = segments ?? (displace > 0 ? Math.min(512, Math.max(96, Math.ceil(size / Math.max(cellSize, 1e-4)) * 16)) : 1);
|
|
347
|
-
useGridSurface(matRef, meshRef, {
|
|
318
|
+
useGridSurface(matRef, meshRef, { reveal, revealDuration });
|
|
348
319
|
// One push point for every uniform the config owns: the committed config when the
|
|
349
320
|
// material mounts or the config commits, the merged one while anything overrides it.
|
|
350
321
|
const baseRef = useRef(base);
|
|
@@ -373,6 +344,6 @@ export function WallpaperGrid({ config = defaultWallpaperGridConfig, groupProps,
|
|
|
373
344
|
runtimeRef.current = null;
|
|
374
345
|
}
|
|
375
346
|
}, []);
|
|
376
|
-
return (_jsx("group", { ref: rootRef, ...groupProps, children: _jsxs("mesh", { ref: meshRef, rotation:
|
|
347
|
+
return (_jsx("group", { ref: rootRef, ...groupProps, children: _jsxs("mesh", { ref: meshRef, rotation: [-Math.PI / 2, 0, 0], children: [_jsx("planeGeometry", { args: [size, size, segs, segs] }), _jsx("wallpaperGridMaterial", { ref: setMaterial, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, side: THREE.DoubleSide }, WallpaperGridMaterial.key)] }) }));
|
|
377
348
|
}
|
|
378
349
|
export default WallpaperGrid;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AnimationOptions, MouseMoveDomain, RainEnvironmentConfig } from '@3driseai/3drise-core';
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
export interface RainProps extends ObjectReadyProps {
|
|
5
|
+
config: RainEnvironmentConfig;
|
|
6
|
+
/** Scene object id: the live-edit handle is found by it. */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** Keyframes on the config knobs (animations.environment.animations). */
|
|
9
|
+
keyframes?: AnimationOptions[];
|
|
10
|
+
/** Pointer bindings on the config knobs (mouseMove.environment). */
|
|
11
|
+
mouseMove?: MouseMoveDomain;
|
|
12
|
+
}
|
|
13
|
+
declare const Rain: React.FC<RainProps>;
|
|
14
|
+
export default Rain;
|
|
15
|
+
//# sourceMappingURL=Rain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rain.d.ts","sourceRoot":"","sources":["../../../src/components/environment/Rain.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAItG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAehE,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IAC/C,MAAM,EAAE,qBAAqB,CAAC;IAC9B,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,oEAAoE;IACpE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAUD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAmF7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { DEFAULT_ENVIRONMENT_OBJECTS, ENVIRONMENT_OBJECTS_ANIMATABLE, RainMaterial } from '@3driseai/3drise-core';
|
|
6
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
7
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
9
|
+
const DEFAULTS = DEFAULT_ENVIRONMENT_OBJECTS.rain;
|
|
10
|
+
/** Knobs that rebuild the drops: never live, they change once, on commit. */
|
|
11
|
+
const STRUCTURAL = ['density'];
|
|
12
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what push applies. */
|
|
13
|
+
const ANIMATABLE = new Set(ENVIRONMENT_OBJECTS_ANIMATABLE.rain.map((p) => p.value));
|
|
14
|
+
const MAX_DROPS = 20000;
|
|
15
|
+
const DEG = Math.PI / 180;
|
|
16
|
+
const Rain = ({ config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
17
|
+
const rootRef = useRef(null);
|
|
18
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULTS, config), [config]);
|
|
19
|
+
useObjectReady(rootRef, cfg, onObjectReady, onObjectDispose);
|
|
20
|
+
const count = Math.min(Math.max(Math.round(cfg.density * 100), 100), MAX_DROPS);
|
|
21
|
+
const drops = useMemo(() => {
|
|
22
|
+
const positions = new Float32Array(count * 3);
|
|
23
|
+
const speeds = new Float32Array(count);
|
|
24
|
+
for (let i = 0; i < count; i++) {
|
|
25
|
+
positions[i * 3] = Math.random() - 0.5;
|
|
26
|
+
positions[i * 3 + 1] = Math.random();
|
|
27
|
+
positions[i * 3 + 2] = Math.random() - 0.5;
|
|
28
|
+
speeds[i] = 0.8 + Math.random() * 0.4;
|
|
29
|
+
}
|
|
30
|
+
const geometry = new THREE.BufferGeometry();
|
|
31
|
+
geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
|
|
32
|
+
geometry.setAttribute('speed', new THREE.BufferAttribute(speeds, 1));
|
|
33
|
+
return { geometry, positions, speeds };
|
|
34
|
+
}, [count]);
|
|
35
|
+
const material = useMemo(() => {
|
|
36
|
+
const m = new RainMaterial();
|
|
37
|
+
m.transparent = true;
|
|
38
|
+
m.depthWrite = false;
|
|
39
|
+
m.blending = THREE.NormalBlending;
|
|
40
|
+
return m;
|
|
41
|
+
}, []);
|
|
42
|
+
useEffect(() => () => drops.geometry.dispose(), [drops]);
|
|
43
|
+
useEffect(() => () => material.dispose(), [material]);
|
|
44
|
+
// What the simulation reads each frame; written only by push.
|
|
45
|
+
const sim = useRef({ speed: cfg.speed, windStrength: cfg.windStrength, windDirection: cfg.windDirection, turbulence: cfg.turbulence });
|
|
46
|
+
const push = useCallback((m) => {
|
|
47
|
+
const u = material.uniforms;
|
|
48
|
+
const c = m.color;
|
|
49
|
+
if (c !== undefined)
|
|
50
|
+
c.isColor ? u.uColor.value.copy(c) : u.uColor.value.set(c);
|
|
51
|
+
if (typeof m.opacity === 'number')
|
|
52
|
+
u.opacity.value = m.opacity;
|
|
53
|
+
if (typeof m.size === 'number')
|
|
54
|
+
u.streakLength.value = Math.max(m.size * 30, 1);
|
|
55
|
+
if (typeof m.windDirection === 'number') {
|
|
56
|
+
u.windAngle.value = m.windDirection * DEG;
|
|
57
|
+
sim.current.windDirection = m.windDirection;
|
|
58
|
+
}
|
|
59
|
+
if (typeof m.windStrength === 'number') {
|
|
60
|
+
u.windTilt.value = m.windStrength;
|
|
61
|
+
sim.current.windStrength = m.windStrength;
|
|
62
|
+
}
|
|
63
|
+
if (typeof m.speed === 'number')
|
|
64
|
+
sim.current.speed = m.speed;
|
|
65
|
+
if (typeof m.turbulence === 'number')
|
|
66
|
+
sim.current.turbulence = m.turbulence;
|
|
67
|
+
}, [material]);
|
|
68
|
+
useLayoutEffect(() => { push(cfg); }, [cfg, push]);
|
|
69
|
+
useConfigDriver({ rootRef, id, family: 'environment', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
70
|
+
const scale = useMemo(() => new THREE.Vector3(), []);
|
|
71
|
+
useFrame((_, delta) => {
|
|
72
|
+
const root = rootRef.current;
|
|
73
|
+
if (!root)
|
|
74
|
+
return;
|
|
75
|
+
root.getWorldScale(scale);
|
|
76
|
+
const sx = Math.max(Math.abs(scale.x), 1e-3), sy = Math.max(Math.abs(scale.y), 1e-3), sz = Math.max(Math.abs(scale.z), 1e-3);
|
|
77
|
+
const { speed, windStrength, windDirection, turbulence } = sim.current;
|
|
78
|
+
const dt = Math.min(delta, 0.05);
|
|
79
|
+
const fall = speed * 60 * dt / sy;
|
|
80
|
+
const wind = windStrength * 30 * dt;
|
|
81
|
+
const wx = Math.sin(windDirection * DEG) * wind / sx, wz = Math.cos(windDirection * DEG) * wind / sz;
|
|
82
|
+
const turb = turbulence * 10 * dt;
|
|
83
|
+
const p = drops.positions, v = drops.speeds;
|
|
84
|
+
for (let i = 0; i < count; i++) {
|
|
85
|
+
const i3 = i * 3, s = v[i];
|
|
86
|
+
p[i3] += wx * s + (turb > 0 ? (Math.random() - 0.5) * turb / sx : 0);
|
|
87
|
+
p[i3 + 1] -= fall * s;
|
|
88
|
+
p[i3 + 2] += wz * s + (turb > 0 ? (Math.random() - 0.5) * turb / sz : 0);
|
|
89
|
+
if (p[i3 + 1] < 0) {
|
|
90
|
+
p[i3] = Math.random() - 0.5;
|
|
91
|
+
p[i3 + 1] = 1;
|
|
92
|
+
p[i3 + 2] = Math.random() - 0.5;
|
|
93
|
+
v[i] = 0.8 + Math.random() * 0.4;
|
|
94
|
+
}
|
|
95
|
+
if (p[i3] > 0.5)
|
|
96
|
+
p[i3] -= 1;
|
|
97
|
+
else if (p[i3] < -0.5)
|
|
98
|
+
p[i3] += 1;
|
|
99
|
+
if (p[i3 + 2] > 0.5)
|
|
100
|
+
p[i3 + 2] -= 1;
|
|
101
|
+
else if (p[i3 + 2] < -0.5)
|
|
102
|
+
p[i3 + 2] += 1;
|
|
103
|
+
}
|
|
104
|
+
drops.geometry.attributes.position.needsUpdate = true;
|
|
105
|
+
});
|
|
106
|
+
// Clicks reach the scene: the drops never take a raycast.
|
|
107
|
+
const noRaycast = useMemo(() => () => { }, []);
|
|
108
|
+
return (_jsx("group", { ref: rootRef, children: _jsx("points", { geometry: drops.geometry, material: material, frustumCulled: false, raycast: noRaycast }) }));
|
|
109
|
+
};
|
|
110
|
+
export default Rain;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AnimationOptions, MouseMoveDomain, RainbowEnvironmentConfig } from '@3driseai/3drise-core';
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
export interface RainbowProps extends ObjectReadyProps {
|
|
5
|
+
config: RainbowEnvironmentConfig;
|
|
6
|
+
/** Scene object id: the live-edit handle is found by it. */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** Keyframes on the config knobs (animations.environment.animations). */
|
|
9
|
+
keyframes?: AnimationOptions[];
|
|
10
|
+
/** Pointer bindings on the config knobs (mouseMove.environment). */
|
|
11
|
+
mouseMove?: MouseMoveDomain;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A single physical rainbow on its own: water dispersion and an Airy profile with supernumerary fringes, centred opposite the sun and seen through the object’s volume. The cursor sprays, clears or polarises it. Use for after-rain and hopeful scenes.
|
|
15
|
+
*
|
|
16
|
+
* The volume is the parent's transform: x / z span its scale, y rises from its origin to scale.y.
|
|
17
|
+
*/
|
|
18
|
+
declare const Rainbow: React.FC<RainbowProps>;
|
|
19
|
+
export default Rainbow;
|
|
20
|
+
//# sourceMappingURL=Rainbow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rainbow.d.ts","sourceRoot":"","sources":["../../../src/components/environment/Rainbow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAMzG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAq3BhE,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IAClD,MAAM,EAAE,wBAAwB,CAAC;IACjC,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,oEAAoE;IACpE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED;;;;GAIG;AACH,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmCnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|