@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,344 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// UI binder — turns a layer's data attributes into SceneHandle calls
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Pure DOM + SceneHandle: no three.js and no React, so it runs (and is tested) on
|
|
6
|
+
// its own. One binder per rendered layer. It
|
|
7
|
+
// - runs data-click / data-hover-in / data-hover-out commands,
|
|
8
|
+
// - scrubs data-bind ranges and keeps them in step with a playing sequence,
|
|
9
|
+
// - reflects scene state (data-state → data-on, data-show-when → hidden),
|
|
10
|
+
// - writes data-set controls (sliders, colour pickers, switches, preset buttons) to live
|
|
11
|
+
// scene properties and keeps them in step with the scene,
|
|
12
|
+
// - registers data-anchor elements with the anchor registry (positioned by
|
|
13
|
+
// UiAnchorUpdater inside the canvas, through refs — never React state).
|
|
14
|
+
//
|
|
15
|
+
// State is refreshed on SceneHandle events plus a slow poll, because a reset or an
|
|
16
|
+
// object click can change state without an event this layer subscribes to.
|
|
17
|
+
//
|
|
18
|
+
import { UI_ATTR, UI_TRIGGER_ATTRS, collectUiBindings, resolveUiRef, } from '@3driseai/3drise-core';
|
|
19
|
+
import { uiAnchors } from './uiAnchors.js';
|
|
20
|
+
const NATIVE_INTERACTIVE = new Set(['button', 'a', 'input', 'select', 'textarea', 'summary']);
|
|
21
|
+
const GROUPS = { sequence: 'sequences', clip: 'clips' };
|
|
22
|
+
export function bindUiLayer(root, scene, options = {}) {
|
|
23
|
+
const warn = options.onWarn ?? (() => { });
|
|
24
|
+
const anchors = options.anchors ?? uiAnchors;
|
|
25
|
+
const cleanups = [];
|
|
26
|
+
const toggled = new Set(); // sequence / clip refs whose last toggle went forward
|
|
27
|
+
const listen = (el, type, fn) => {
|
|
28
|
+
el.addEventListener(type, fn);
|
|
29
|
+
cleanups.push(() => el.removeEventListener(type, fn));
|
|
30
|
+
};
|
|
31
|
+
const uses = collectUiBindings(root);
|
|
32
|
+
for (const use of uses)
|
|
33
|
+
for (const e of use.errors)
|
|
34
|
+
warn(`${use.label}: ${e}`);
|
|
35
|
+
// ----- ref resolution (for inspect and warnings) --------------------------------
|
|
36
|
+
const listOf = (kind) => (kind === 'action' ? scene.actions.list() : kind === 'clip' ? scene.clips.list() : scene.sequences.list());
|
|
37
|
+
const exists = (kind, ref) => !!resolveUiRef(listOf(kind), ref);
|
|
38
|
+
const layerEl = (ref) => root.querySelector(ref); // '#id'
|
|
39
|
+
// ----- commands -------------------------------------------------------------------
|
|
40
|
+
function run(c, source) {
|
|
41
|
+
if (c.kind === 'ui') {
|
|
42
|
+
const el = layerEl(c.ref);
|
|
43
|
+
if (!el) {
|
|
44
|
+
warn(`${source}: no element ${c.ref} in this layer.`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (c.verb === 'show')
|
|
48
|
+
el.hidden = false;
|
|
49
|
+
else if (c.verb === 'hide')
|
|
50
|
+
el.hidden = true;
|
|
51
|
+
else
|
|
52
|
+
el.hidden = !el.hidden;
|
|
53
|
+
refresh();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (c.kind === 'action') {
|
|
57
|
+
const a = scene.actions;
|
|
58
|
+
const ok = c.verb === 'apply' ? a.apply(c.ref) : c.verb === 'revert' ? a.revert(c.ref) : (a.toggle(c.ref), exists('action', c.ref));
|
|
59
|
+
if (!ok)
|
|
60
|
+
warn(`${source}: no action "${c.ref}".`);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const g = scene[GROUPS[c.kind]];
|
|
64
|
+
let ok = true;
|
|
65
|
+
switch (c.verb) {
|
|
66
|
+
case 'play':
|
|
67
|
+
ok = g.play(c.ref);
|
|
68
|
+
break;
|
|
69
|
+
case 'reverse':
|
|
70
|
+
ok = g.play(c.ref, { reverse: true });
|
|
71
|
+
break;
|
|
72
|
+
case 'pause':
|
|
73
|
+
ok = g.pause(c.ref);
|
|
74
|
+
break;
|
|
75
|
+
case 'resume':
|
|
76
|
+
ok = g.resume(c.ref);
|
|
77
|
+
break;
|
|
78
|
+
case 'stop':
|
|
79
|
+
ok = g.stop(c.ref);
|
|
80
|
+
break;
|
|
81
|
+
case 'toggle': {
|
|
82
|
+
const key = `${c.kind}:${c.ref}`;
|
|
83
|
+
const back = toggled.has(key);
|
|
84
|
+
if (back)
|
|
85
|
+
toggled.delete(key);
|
|
86
|
+
else
|
|
87
|
+
toggled.add(key);
|
|
88
|
+
ok = g.play(c.ref, { reverse: back });
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (!ok)
|
|
93
|
+
warn(`${source}: no ${c.kind} "${c.ref}".`);
|
|
94
|
+
}
|
|
95
|
+
function wireTriggers(use) {
|
|
96
|
+
const el = use.el;
|
|
97
|
+
for (const group of use.commands) {
|
|
98
|
+
if (!group.items.length)
|
|
99
|
+
continue;
|
|
100
|
+
const source = `${use.label} ${UI_TRIGGER_ATTRS[group.trigger]}`;
|
|
101
|
+
const fire = () => { for (const c of group.items)
|
|
102
|
+
run(c, source); };
|
|
103
|
+
if (group.trigger === 'click') {
|
|
104
|
+
listen(el, 'click', (e) => { if (el.localName !== 'a')
|
|
105
|
+
e.preventDefault(); fire(); });
|
|
106
|
+
if (!NATIVE_INTERACTIVE.has(el.localName)) {
|
|
107
|
+
if (!el.hasAttribute('tabindex'))
|
|
108
|
+
el.setAttribute('tabindex', '0');
|
|
109
|
+
if (!el.hasAttribute('role'))
|
|
110
|
+
el.setAttribute('role', 'button');
|
|
111
|
+
listen(el, 'keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
fire();
|
|
114
|
+
} });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
// Hover is for pointers; on touch a tap must go through data-click.
|
|
119
|
+
const type = group.trigger === 'hoverIn' ? 'pointerenter' : 'pointerleave';
|
|
120
|
+
listen(el, type, (e) => { if (e.pointerType !== 'touch')
|
|
121
|
+
fire(); });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// ----- scene state → DOM ----------------------------------------------------------
|
|
126
|
+
function holds(c) {
|
|
127
|
+
let on = false;
|
|
128
|
+
if (c.kind === 'action')
|
|
129
|
+
on = scene.actions.isApplied(c.ref);
|
|
130
|
+
else if (c.kind === 'sequence')
|
|
131
|
+
on = scene.sequences.isPlaying(c.ref);
|
|
132
|
+
else if (c.kind === 'clip')
|
|
133
|
+
on = scene.clips.isPlaying(c.ref);
|
|
134
|
+
else {
|
|
135
|
+
const el = layerEl(c.ref);
|
|
136
|
+
on = !!el && !el.hidden;
|
|
137
|
+
}
|
|
138
|
+
return c.negate ? !on : on;
|
|
139
|
+
}
|
|
140
|
+
function refresh() {
|
|
141
|
+
for (const use of uses) {
|
|
142
|
+
if (use.state.length)
|
|
143
|
+
use.el.setAttribute('data-on', String(use.state.every(holds)));
|
|
144
|
+
if (use.showWhen.length)
|
|
145
|
+
use.el.hidden = !use.showWhen.every(holds);
|
|
146
|
+
if (use.set)
|
|
147
|
+
syncSet(use);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// ----- data-set: controls that write live scene properties ---------------------------
|
|
151
|
+
const targetOf = (use) => `${use.set.target}${use.set.node ? '/' + use.set.node : ''}`;
|
|
152
|
+
const active = (el) => root.activeElement === el;
|
|
153
|
+
const dragging = new Set();
|
|
154
|
+
const warned = new Set();
|
|
155
|
+
const same = (a, b) => {
|
|
156
|
+
if (typeof a === 'number' && typeof b === 'number')
|
|
157
|
+
return Math.abs(a - b) < 1e-6 * Math.max(1, Math.abs(a), Math.abs(b));
|
|
158
|
+
if (Array.isArray(a) && Array.isArray(b))
|
|
159
|
+
return a.length === b.length && a.every((v, i) => same(v, b[i]));
|
|
160
|
+
if (typeof a === 'string' && typeof b === 'string')
|
|
161
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
162
|
+
return a === b;
|
|
163
|
+
};
|
|
164
|
+
function write(use, value) {
|
|
165
|
+
const ok = scene.values.set(targetOf(use), use.set.path, value);
|
|
166
|
+
if (!ok && !warned.has(use.el)) {
|
|
167
|
+
warned.add(use.el);
|
|
168
|
+
warn(`${use.label} ${UI_ATTR.set}: cannot write ${use.set.path} on ${targetOf(use)}${scene.values.check(targetOf(use), use.set.path) ? ' — ' + scene.values.check(targetOf(use), use.set.path) : ''}.`);
|
|
169
|
+
}
|
|
170
|
+
refresh();
|
|
171
|
+
}
|
|
172
|
+
function syncSet(use) {
|
|
173
|
+
const el = use.el;
|
|
174
|
+
const current = scene.values.get(targetOf(use), use.set.path);
|
|
175
|
+
if (use.setValue !== undefined) {
|
|
176
|
+
el.setAttribute('data-on', String(current !== undefined && same(current, use.setValue)));
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (current === undefined || dragging.has(el) || active(el))
|
|
180
|
+
return;
|
|
181
|
+
if (el.localName === 'select') {
|
|
182
|
+
el.value = String(current);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (el.localName !== 'input')
|
|
186
|
+
return;
|
|
187
|
+
if (el.type === 'checkbox')
|
|
188
|
+
el.checked = !!current;
|
|
189
|
+
else if (el.type === 'color') {
|
|
190
|
+
if (typeof current === 'string' && /^#[0-9a-f]{6}$/i.test(current))
|
|
191
|
+
el.value = current.toLowerCase();
|
|
192
|
+
}
|
|
193
|
+
else if (typeof current === 'number' || typeof current === 'string')
|
|
194
|
+
el.value = String(current);
|
|
195
|
+
}
|
|
196
|
+
for (const use of uses) {
|
|
197
|
+
if (!use.set)
|
|
198
|
+
continue;
|
|
199
|
+
const el = use.el;
|
|
200
|
+
if (use.setValue !== undefined) {
|
|
201
|
+
listen(el, 'click', (e) => { e.preventDefault(); write(use, use.setValue); });
|
|
202
|
+
if (!NATIVE_INTERACTIVE.has(el.localName)) {
|
|
203
|
+
if (!el.hasAttribute('tabindex'))
|
|
204
|
+
el.setAttribute('tabindex', '0');
|
|
205
|
+
if (!el.hasAttribute('role'))
|
|
206
|
+
el.setAttribute('role', 'button');
|
|
207
|
+
listen(el, 'keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
write(use, use.setValue);
|
|
210
|
+
} });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else if (el.localName === 'select') {
|
|
214
|
+
listen(el, 'change', () => {
|
|
215
|
+
const raw = el.value;
|
|
216
|
+
const current = scene.values.get(targetOf(use), use.set.path);
|
|
217
|
+
write(use, typeof current === 'number' && raw.trim() !== '' && Number.isFinite(Number(raw)) ? Number(raw) : raw);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
else if (el.localName === 'input') {
|
|
221
|
+
if (el.type === 'checkbox')
|
|
222
|
+
listen(el, 'change', () => write(use, el.checked));
|
|
223
|
+
else if (el.type === 'range' || el.type === 'number') {
|
|
224
|
+
listen(el, 'input', () => { if (el.value !== '' && Number.isFinite(Number(el.value)))
|
|
225
|
+
write(use, Number(el.value)); });
|
|
226
|
+
listen(el, 'pointerdown', () => { dragging.add(el); });
|
|
227
|
+
const up = () => { dragging.delete(el); };
|
|
228
|
+
window.addEventListener('pointerup', up);
|
|
229
|
+
cleanups.push(() => window.removeEventListener('pointerup', up));
|
|
230
|
+
}
|
|
231
|
+
else
|
|
232
|
+
listen(el, 'input', () => write(use, el.value)); // color, text
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// ----- data-bind ranges -------------------------------------------------------------
|
|
236
|
+
const followed = [];
|
|
237
|
+
for (const use of uses) {
|
|
238
|
+
if (!use.bind)
|
|
239
|
+
continue;
|
|
240
|
+
const input = use.el;
|
|
241
|
+
if (input.localName !== 'input' || input.type !== 'range')
|
|
242
|
+
continue;
|
|
243
|
+
const { kind, ref } = use.bind;
|
|
244
|
+
const span = () => { const lo = Number(input.min || 0); const hi = Number(input.max || 1); return { lo, hi: hi === lo ? lo + 1 : hi }; };
|
|
245
|
+
const f = { input, ref, dragging: false };
|
|
246
|
+
listen(input, 'input', () => {
|
|
247
|
+
const { lo, hi } = span();
|
|
248
|
+
const p = Math.min(1, Math.max(0, (Number(input.value) - lo) / (hi - lo)));
|
|
249
|
+
const ok = kind === 'sequence' ? scene.sequences.setProgress(ref, p) : scene.clips.seek(ref, p);
|
|
250
|
+
if (!ok)
|
|
251
|
+
warn(`${use.label}: no ${kind} "${ref}".`);
|
|
252
|
+
});
|
|
253
|
+
if (kind === 'sequence') {
|
|
254
|
+
listen(input, 'pointerdown', () => { f.dragging = true; });
|
|
255
|
+
const up = () => { f.dragging = false; };
|
|
256
|
+
window.addEventListener('pointerup', up);
|
|
257
|
+
cleanups.push(() => window.removeEventListener('pointerup', up));
|
|
258
|
+
followed.push(f);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
let raf = 0;
|
|
262
|
+
const follow = () => {
|
|
263
|
+
for (const f of followed) {
|
|
264
|
+
if (f.dragging || !scene.sequences.isPlaying(f.ref))
|
|
265
|
+
continue;
|
|
266
|
+
const lo = Number(f.input.min || 0);
|
|
267
|
+
const hi = Number(f.input.max || 1);
|
|
268
|
+
f.input.value = String(lo + (hi - lo) * scene.sequences.getProgress(f.ref));
|
|
269
|
+
}
|
|
270
|
+
raf = requestAnimationFrame(follow);
|
|
271
|
+
};
|
|
272
|
+
if (followed.length) {
|
|
273
|
+
raf = requestAnimationFrame(follow);
|
|
274
|
+
cleanups.push(() => cancelAnimationFrame(raf));
|
|
275
|
+
}
|
|
276
|
+
// ----- anchors ------------------------------------------------------------------------
|
|
277
|
+
for (const use of uses) {
|
|
278
|
+
if (!use.anchor)
|
|
279
|
+
continue;
|
|
280
|
+
const el = use.el;
|
|
281
|
+
el.style.position = 'absolute';
|
|
282
|
+
el.style.left = '0';
|
|
283
|
+
el.style.top = '0';
|
|
284
|
+
el.style.willChange = 'transform';
|
|
285
|
+
el.setAttribute('data-offscreen', ''); // hidden until the first projection places it
|
|
286
|
+
const entry = { el, object: use.anchor.object, node: use.anchor.node, occlude: use.anchorOcclude, offset: use.anchorOffset ?? [0, 0] };
|
|
287
|
+
cleanups.push(anchors.register(entry));
|
|
288
|
+
}
|
|
289
|
+
// ----- wire up ---------------------------------------------------------------------------
|
|
290
|
+
for (const use of uses)
|
|
291
|
+
wireTriggers(use);
|
|
292
|
+
refresh();
|
|
293
|
+
for (const type of ['actionApplied', 'actionReverted', 'animationStart', 'animationEnd']) {
|
|
294
|
+
cleanups.push(scene.on(type, () => { refresh(); requestAnimationFrame(refresh); }));
|
|
295
|
+
}
|
|
296
|
+
const poll = options.pollMs ?? 250;
|
|
297
|
+
if (poll > 0 && uses.some(u => u.state.length || u.showWhen.length || u.set)) {
|
|
298
|
+
const id = setInterval(refresh, poll);
|
|
299
|
+
cleanups.push(() => clearInterval(id));
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
dispose() { while (cleanups.length)
|
|
303
|
+
cleanups.pop()(); },
|
|
304
|
+
refresh,
|
|
305
|
+
inspect() {
|
|
306
|
+
const rows = [];
|
|
307
|
+
const resolvedUi = (ref) => !!layerEl(ref);
|
|
308
|
+
const push = (use, trigger, kind, text, ref) => rows.push({
|
|
309
|
+
element: use.label, trigger, command: text,
|
|
310
|
+
resolved: kind === 'ui' ? resolvedUi(ref) : exists(kind, ref),
|
|
311
|
+
});
|
|
312
|
+
for (const use of uses) {
|
|
313
|
+
for (const g of use.commands)
|
|
314
|
+
for (const c of g.items)
|
|
315
|
+
push(use, g.trigger, c.kind, `${c.kind}.${c.verb}:${c.ref}`, c.ref);
|
|
316
|
+
for (const c of use.state)
|
|
317
|
+
push(use, UI_ATTR.state, c.kind, `${c.negate ? '!' : ''}${c.kind}:${c.ref}`, c.ref);
|
|
318
|
+
for (const c of use.showWhen)
|
|
319
|
+
push(use, UI_ATTR.showWhen, c.kind, `${c.negate ? '!' : ''}${c.kind}:${c.ref}`, c.ref);
|
|
320
|
+
if (use.bind)
|
|
321
|
+
push(use, UI_ATTR.bind, use.bind.kind, `${use.bind.kind}:${use.bind.ref}`, use.bind.ref);
|
|
322
|
+
if (use.set)
|
|
323
|
+
rows.push({
|
|
324
|
+
element: use.label, trigger: UI_ATTR.set,
|
|
325
|
+
command: `${targetOf(use)}:${use.set.path}${use.setValue !== undefined ? ' = ' + JSON.stringify(use.setValue) : ''}`,
|
|
326
|
+
resolved: !scene.values.check(targetOf(use), use.set.path),
|
|
327
|
+
});
|
|
328
|
+
if (use.anchor)
|
|
329
|
+
rows.push({ element: use.label, trigger: UI_ATTR.anchor, command: `object:${use.anchor.object}${use.anchor.node ? '/' + use.anchor.node : ''}`, resolved: true });
|
|
330
|
+
}
|
|
331
|
+
return rows;
|
|
332
|
+
},
|
|
333
|
+
press(selector, trigger = 'click') {
|
|
334
|
+
const el = root.querySelector(selector);
|
|
335
|
+
if (!el)
|
|
336
|
+
return false;
|
|
337
|
+
if (trigger === 'click')
|
|
338
|
+
el.click();
|
|
339
|
+
else
|
|
340
|
+
el.dispatchEvent(new PointerEvent(trigger === 'hoverIn' ? 'pointerenter' : 'pointerleave', { pointerType: 'mouse', bubbles: false }));
|
|
341
|
+
return true;
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configAnimations.d.ts","sourceRoot":"","sources":["../../src/utils/configAnimations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"configAnimations.d.ts","sourceRoot":"","sources":["../../src/utils/configAnimations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAGjF;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE7D,yFAAyF;AACzF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEhE;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CACzC,UAAU,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAC1C,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,IAAI,CAqBN;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,iBAAiB,EAAE,GAAG,SAAS,EAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACjC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,IAAI,CAeN;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAGpE;AAED,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC,cAAc,GAAG,SAAS,CAAC,EAAE,GAAG,CAAC,CAK1G;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAMvH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { calculateTimeProgress, applyEasing, gsapEasingMap, interpolateValue, interpolateMouseMoveProperty } from '@3driseai/3drise-core';
|
|
2
|
+
import { Color } from 'three';
|
|
2
3
|
/**
|
|
3
4
|
* @param elapsedMs Milliseconds since this animation set started — NOT `Date.now()`,
|
|
4
5
|
* and not seconds. `calculateTimeProgress` divides by `duration`, so a wall
|
|
@@ -49,7 +50,10 @@ export function applyConfigMouseMove(properties, config, override, pointer, allo
|
|
|
49
50
|
const base = override[property] ?? config[property];
|
|
50
51
|
if (base === undefined)
|
|
51
52
|
continue;
|
|
52
|
-
|
|
53
|
+
const value = interpolateMouseMoveProperty(base, min, max, pointer, axis, sensitivity, inverted);
|
|
54
|
+
// A colour binding comes back as a THREE.Color; configs store hex, and some
|
|
55
|
+
// appliers (terrain's setStyle) only take a string.
|
|
56
|
+
override[property] = value instanceof Color ? `#${value.getHexString()}` : value;
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
/** True when anything is currently being driven. */
|
|
@@ -8,7 +8,7 @@ export declare const GRID_SURFACE_COLORS: readonly ["lineColor", "sectionColor",
|
|
|
8
8
|
* is here because the plane is only subdivided when it is > 0 at commit time, and
|
|
9
9
|
* `sectionSize` because it is a whole number of cells per accent group.
|
|
10
10
|
*/
|
|
11
|
-
export declare const GRID_STRUCTURAL: readonly ["size", "
|
|
11
|
+
export declare const GRID_STRUCTURAL: readonly ["size", "segments", "displace", "lineMode", "cellMode", "sectionSize"];
|
|
12
12
|
/** A uniform computed from the config (a clamp, a rounding, an enum index, a bool as 0/1). */
|
|
13
13
|
export type GridDerive = Readonly<Record<string, (c: Record<string, any>) => number>>;
|
|
14
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridConfig.d.ts","sourceRoot":"","sources":["../../src/utils/gridConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAkBpC,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,+KAGvB,CAAC;AAEX,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,6EAA8E,CAAC;AAE/G;;;;GAIG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"gridConfig.d.ts","sourceRoot":"","sources":["../../src/utils/gridConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAkBpC,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,+KAGvB,CAAC;AAEX,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,6EAA8E,CAAC;AAE/G;;;;GAIG;AACH,eAAO,MAAM,eAAe,kFAAmF,CAAC;AAIhH,8FAA8F;AAC9F,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;AAEtF;;;GAGG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI,GAAG,SAAS,EACjD,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,MAAM,GAAE,UAAe,GACxB,IAAI,CASN"}
|
package/dist/utils/gridConfig.js
CHANGED
|
@@ -25,7 +25,7 @@ export const GRID_SURFACE_COLORS = ['lineColor', 'sectionColor', 'cellColor', 'g
|
|
|
25
25
|
* is here because the plane is only subdivided when it is > 0 at commit time, and
|
|
26
26
|
* `sectionSize` because it is a whole number of cells per accent group.
|
|
27
27
|
*/
|
|
28
|
-
export const GRID_STRUCTURAL = ['size', '
|
|
28
|
+
export const GRID_STRUCTURAL = ['size', 'segments', 'displace', 'lineMode', 'cellMode', 'sectionSize'];
|
|
29
29
|
/**
|
|
30
30
|
* @param variant the grid's own numeric knobs, each pushed as-is to u_<key>
|
|
31
31
|
* @param derive the grid's computed uniforms: u_<key> = derive[key](config)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { LandObjectConfig, LandQuality, TerrainConfig, TerrainQualityConfig } from '@3driseai/3drise-core';
|
|
3
|
+
export declare const LAND_SEGMENTS: Record<LandQuality, number>;
|
|
4
|
+
/** The seed's offset into the field, in metres. Deterministic, far apart. */
|
|
5
|
+
export declare function landSeedOffset(seed: number, out?: THREE.Vector2): THREE.Vector2;
|
|
6
|
+
/** The land object's config as the shared terrain renderer reads it. Base 0: the
|
|
7
|
+
* object's position is the base. */
|
|
8
|
+
export declare function landToTerrainConfig(cfg: LandObjectConfig): TerrainConfig;
|
|
9
|
+
/** The renderer's quality block for a patch: no clipmap, no curvature. */
|
|
10
|
+
export declare function landQuality(cfg: LandObjectConfig): TerrainQualityConfig;
|
|
11
|
+
/** The object's world transform, split the way the patch needs it. */
|
|
12
|
+
export interface LandFrame {
|
|
13
|
+
position: THREE.Vector3;
|
|
14
|
+
quaternion: THREE.Quaternion;
|
|
15
|
+
scale: THREE.Vector3;
|
|
16
|
+
inverseQuaternion: THREE.Quaternion;
|
|
17
|
+
}
|
|
18
|
+
export declare function landFrame(object: THREE.Object3D, out?: LandFrame): LandFrame;
|
|
19
|
+
/**
|
|
20
|
+
* The per-object uniforms: footprint, seed offset, edge band, height scale, and
|
|
21
|
+
* the camera and sun brought into terrain space. Call after applyTerrainUniforms
|
|
22
|
+
* and applySunUniforms (both of which write world-space or unscaled values).
|
|
23
|
+
*/
|
|
24
|
+
export declare function applyLandPatchUniforms(material: THREE.ShaderMaterial, cfg: LandObjectConfig, frame: LandFrame, camera: THREE.Camera): void;
|
|
25
|
+
/**
|
|
26
|
+
* Height of the land above the object's base, in terrain metres, at terrain-space
|
|
27
|
+
* (tx, tz) measured from the object's centre (before rotation). Multiply nothing:
|
|
28
|
+
* scale.y is already in (elevation x scale.y).
|
|
29
|
+
*/
|
|
30
|
+
export declare function landHeightAt(cfg: LandObjectConfig, scale: THREE.Vector3, tx: number, tz: number, lodCell?: number): number;
|
|
31
|
+
/** World-space height of a land object's surface under world (x, z), or null off the patch. */
|
|
32
|
+
export declare function landWorldHeightAt(object: THREE.Object3D, cfg: LandObjectConfig, x: number, z: number): number | null;
|
|
33
|
+
//# sourceMappingURL=landPatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landPatch.d.ts","sourceRoot":"","sources":["../../src/utils/landPatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAgBhH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAwC,CAAC;AAE/F,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAsB,GAAG,KAAK,CAAC,OAAO,CAKrF;AAED;qCACqC;AACrC,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,GAAG,aAAa,CAExE;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,GAAG,EAAE,gBAAgB,GAAG,oBAAoB,CAevE;AAED,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACtB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC;IACxB,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;IACrB,iBAAiB,EAAE,KAAK,CAAC,UAAU,CAAC;CACvC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,SAAS,GAAG,SAAS,CAM5E;AAKD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,GACrB,IAAI,CAiBN;AAaD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,SAAI,GAAG,MAAM,CAOrH;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWpH"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { terrainHeightAt } from './terrainHeight.js';
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Land objects — a bounded patch of the terrain height field
|
|
5
|
+
// =============================================================================
|
|
6
|
+
//
|
|
7
|
+
// The patch is a unit grid on XZ that the object's transform places, rotates and
|
|
8
|
+
// sizes. The field is sampled in TERRAIN SPACE: metres from the object's origin,
|
|
9
|
+
// unrotated, plus the seed's offset into the endless field. So:
|
|
10
|
+
// footprint = scale.x / scale.z (metres) — a window: wider shows more land
|
|
11
|
+
// height = elevation x scale.y, above the object's base (position.y)
|
|
12
|
+
// The GPU side is TerrainMaterial's TERRAIN_PATCH path; the CPU side below is the
|
|
13
|
+
// same maths, for picking and placing things on the land.
|
|
14
|
+
//
|
|
15
|
+
export const LAND_SEGMENTS = { low: 128, medium: 256, high: 384 };
|
|
16
|
+
/** The seed's offset into the field, in metres. Deterministic, far apart. */
|
|
17
|
+
export function landSeedOffset(seed, out = new THREE.Vector2()) {
|
|
18
|
+
const s = Math.max(1, Math.round(seed || 1));
|
|
19
|
+
const fx = Math.sin(s * 12.9898) * 43758.5453;
|
|
20
|
+
const fz = Math.sin(s * 78.233) * 12345.6789;
|
|
21
|
+
return out.set((fx - Math.floor(fx) - 0.5) * 80000, (fz - Math.floor(fz) - 0.5) * 80000);
|
|
22
|
+
}
|
|
23
|
+
/** The land object's config as the shared terrain renderer reads it. Base 0: the
|
|
24
|
+
* object's position is the base. */
|
|
25
|
+
export function landToTerrainConfig(cfg) {
|
|
26
|
+
return { ...cfg, type: 'terrain', terrainType: cfg.type, seaLevel: 0 };
|
|
27
|
+
}
|
|
28
|
+
/** The renderer's quality block for a patch: no clipmap, no curvature. */
|
|
29
|
+
export function landQuality(cfg) {
|
|
30
|
+
return {
|
|
31
|
+
levels: 1,
|
|
32
|
+
segments: LAND_SEGMENTS[cfg.quality] ?? 256,
|
|
33
|
+
// The fragment's shading floor. The patch's own cell (u_patchCell, scaled to
|
|
34
|
+
// the footprint) is what limits detail; a fixed 1 m floor would blur a 5 m patch.
|
|
35
|
+
cellSize: 0.001,
|
|
36
|
+
curvature: 0,
|
|
37
|
+
shadowSteps: 12,
|
|
38
|
+
shadowDistance: 5000,
|
|
39
|
+
detailFadeDistance: 1200,
|
|
40
|
+
receiveShadows: true,
|
|
41
|
+
exposure: 1,
|
|
42
|
+
wireframe: false,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function landFrame(object, out) {
|
|
46
|
+
const f = out ?? { position: new THREE.Vector3(), quaternion: new THREE.Quaternion(), scale: new THREE.Vector3(), inverseQuaternion: new THREE.Quaternion() };
|
|
47
|
+
object.matrixWorld.decompose(f.position, f.quaternion, f.scale);
|
|
48
|
+
f.scale.set(Math.max(Math.abs(f.scale.x), 1e-3), Math.max(Math.abs(f.scale.y), 1e-4), Math.max(Math.abs(f.scale.z), 1e-3));
|
|
49
|
+
f.inverseQuaternion.copy(f.quaternion).invert();
|
|
50
|
+
return f;
|
|
51
|
+
}
|
|
52
|
+
const _v = new THREE.Vector3();
|
|
53
|
+
const _off = new THREE.Vector2();
|
|
54
|
+
/**
|
|
55
|
+
* The per-object uniforms: footprint, seed offset, edge band, height scale, and
|
|
56
|
+
* the camera and sun brought into terrain space. Call after applyTerrainUniforms
|
|
57
|
+
* and applySunUniforms (both of which write world-space or unscaled values).
|
|
58
|
+
*/
|
|
59
|
+
export function applyLandPatchUniforms(material, cfg, frame, camera) {
|
|
60
|
+
const u = material.uniforms;
|
|
61
|
+
const { scale } = frame;
|
|
62
|
+
landSeedOffset(cfg.seed, _off);
|
|
63
|
+
u.u_patchSize.value.set(scale.x, scale.z);
|
|
64
|
+
u.u_patchOffset.value.copy(_off);
|
|
65
|
+
u.u_edgeWidth.value = Math.max(0, cfg.edgeFade ?? 0) * Math.min(scale.x, scale.z);
|
|
66
|
+
u.u_scaleY.value = scale.y;
|
|
67
|
+
u.u_elevation.value = Math.max(cfg.elevation, 0.01) * scale.y;
|
|
68
|
+
u.u_seaLevel.value = 0;
|
|
69
|
+
u.u_patchCell.value = Math.max(scale.x, scale.z) / (LAND_SEGMENTS[cfg.quality] ?? 256);
|
|
70
|
+
camera.getWorldPosition(_v).sub(frame.position).applyQuaternion(frame.inverseQuaternion);
|
|
71
|
+
u.u_camTerrain.value.set(_v.x + _off.x, _v.y, _v.z + _off.y);
|
|
72
|
+
// World sun -> terrain space. A tilted patch is lit as tilted ground.
|
|
73
|
+
u.u_sunDir.value.applyQuaternion(frame.inverseQuaternion).normalize();
|
|
74
|
+
}
|
|
75
|
+
/** The edge band, exactly as terrainPatchMask in the shader. */
|
|
76
|
+
function patchMask(tx, tz, sizeX, sizeZ, edge) {
|
|
77
|
+
const dx = (0.5 - Math.abs(tx / sizeX)) * sizeX;
|
|
78
|
+
const dz = (0.5 - Math.abs(tz / sizeZ)) * sizeZ;
|
|
79
|
+
const d = Math.min(dx, dz);
|
|
80
|
+
if (d <= 0)
|
|
81
|
+
return 0;
|
|
82
|
+
if (edge <= 1e-3)
|
|
83
|
+
return 1;
|
|
84
|
+
const x = Math.min(Math.max(d / edge, 0), 1);
|
|
85
|
+
return x * x * (3 - 2 * x);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Height of the land above the object's base, in terrain metres, at terrain-space
|
|
89
|
+
* (tx, tz) measured from the object's centre (before rotation). Multiply nothing:
|
|
90
|
+
* scale.y is already in (elevation x scale.y).
|
|
91
|
+
*/
|
|
92
|
+
export function landHeightAt(cfg, scale, tx, tz, lodCell = 2) {
|
|
93
|
+
const m = patchMask(tx, tz, scale.x, scale.z, Math.max(0, cfg.edgeFade ?? 0) * Math.min(scale.x, scale.z));
|
|
94
|
+
if (m <= 0)
|
|
95
|
+
return 0;
|
|
96
|
+
const off = landSeedOffset(cfg.seed, _off);
|
|
97
|
+
const t = landToTerrainConfig(cfg);
|
|
98
|
+
t.elevation = Math.max(cfg.elevation, 0.01) * scale.y;
|
|
99
|
+
return terrainHeightAt(t, tx + off.x, tz + off.y, lodCell) * m;
|
|
100
|
+
}
|
|
101
|
+
/** World-space height of a land object's surface under world (x, z), or null off the patch. */
|
|
102
|
+
export function landWorldHeightAt(object, cfg, x, z) {
|
|
103
|
+
object.updateWorldMatrix(true, false);
|
|
104
|
+
const f = landFrame(object);
|
|
105
|
+
// A vertical line through (x, z) in terrain space: assume the patch is not
|
|
106
|
+
// tilted (the common case); for a tilted patch this is the nearest reading.
|
|
107
|
+
_v.set(x, f.position.y, z).sub(f.position).applyQuaternion(f.inverseQuaternion);
|
|
108
|
+
if (Math.abs(_v.x) > f.scale.x / 2 || Math.abs(_v.z) > f.scale.z / 2)
|
|
109
|
+
return null;
|
|
110
|
+
const h = landHeightAt(cfg, f.scale, _v.x, _v.z);
|
|
111
|
+
_v.y = h;
|
|
112
|
+
_v.applyQuaternion(f.quaternion).add(f.position);
|
|
113
|
+
return _v.y;
|
|
114
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
import type { Object3D } from 'three';
|
|
3
|
+
/**
|
|
4
|
+
* The sky as it was actually drawn this frame — stored, time-driven, keyframed,
|
|
5
|
+
* clip-driven, pointer-driven or mid-drag, whichever won. This is the scene's
|
|
6
|
+
* shared sky state: everything lit by the sky (the key light, volumetric clouds,
|
|
7
|
+
* ocean, terrain — through useCloudSun) reads it before falling back to stored
|
|
8
|
+
* settings, so the sun that is drawn and the sun that lights cannot disagree.
|
|
9
|
+
*
|
|
10
|
+
* Keyed by the R3F scene, so a second canvas (market preview, thumbnail) never
|
|
11
|
+
* reads the editor's sky.
|
|
12
|
+
*/
|
|
13
|
+
export interface RenderedSky {
|
|
14
|
+
turbidity: number;
|
|
15
|
+
rayleigh: number;
|
|
16
|
+
mieCoefficient: number;
|
|
17
|
+
mieDirectionalG: number;
|
|
18
|
+
elevation: number;
|
|
19
|
+
azimuth: number;
|
|
20
|
+
/** Unit vector toward the sun, derived from elevation/azimuth here and
|
|
21
|
+
* nowhere else (core sunUtils convention). Read-only for consumers. */
|
|
22
|
+
sunDirection: Vector3;
|
|
23
|
+
}
|
|
24
|
+
export type RenderedSkyValues = Omit<RenderedSky, 'sunDirection'>;
|
|
25
|
+
export declare function publishRenderedSky(scene: Object3D, values: RenderedSkyValues): void;
|
|
26
|
+
export declare function clearRenderedSky(scene: Object3D): void;
|
|
27
|
+
export declare function getRenderedSky(scene: Object3D): RenderedSky | undefined;
|
|
28
|
+
export declare function claimSceneSun(scene: Object3D): () => void;
|
|
29
|
+
export declare function skyOwnsSun(scene: Object3D): boolean;
|
|
30
|
+
/** The scene an object lives in (its top-most ancestor). */
|
|
31
|
+
export declare function sceneOf(object: Object3D): Object3D;
|
|
32
|
+
//# sourceMappingURL=renderedSky.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderedSky.d.ts","sourceRoot":"","sources":["../../src/utils/renderedSky.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB;4EACwE;IACxE,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAIlE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAanF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEtD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS,CAEvE;AAaD,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,IAAI,CAUzD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAEnD;AAED,4DAA4D;AAC5D,wBAAgB,OAAO,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAIlD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
import { sunDirectionFromAngles } from '@3driseai/3drise-core';
|
|
3
|
+
const rendered = new WeakMap();
|
|
4
|
+
export function publishRenderedSky(scene, values) {
|
|
5
|
+
let out = rendered.get(scene);
|
|
6
|
+
if (!out) {
|
|
7
|
+
out = { ...values, sunDirection: new Vector3() };
|
|
8
|
+
rendered.set(scene, out);
|
|
9
|
+
}
|
|
10
|
+
out.turbidity = values.turbidity;
|
|
11
|
+
out.rayleigh = values.rayleigh;
|
|
12
|
+
out.mieCoefficient = values.mieCoefficient;
|
|
13
|
+
out.mieDirectionalG = values.mieDirectionalG;
|
|
14
|
+
out.elevation = values.elevation;
|
|
15
|
+
out.azimuth = values.azimuth;
|
|
16
|
+
sunDirectionFromAngles(values.elevation, values.azimuth, out.sunDirection);
|
|
17
|
+
}
|
|
18
|
+
export function clearRenderedSky(scene) {
|
|
19
|
+
rendered.delete(scene);
|
|
20
|
+
}
|
|
21
|
+
export function getRenderedSky(scene) {
|
|
22
|
+
return rendered.get(scene);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Who owns the sun light. While a sky is active, SkySystem's key light (SunLight)
|
|
26
|
+
* is the scene's sun; the general lighting rig (LightsManager) keeps its ambient
|
|
27
|
+
* but turns its own `sun` off, so a scene never has two shadow-casting suns
|
|
28
|
+
* pointing different ways. A scene with no sky keeps LightsManager's sun as is.
|
|
29
|
+
*
|
|
30
|
+
* Counted, not a flag: a remount (the sky mode switching) claims before the old
|
|
31
|
+
* light releases.
|
|
32
|
+
*/
|
|
33
|
+
const sunClaims = new WeakMap();
|
|
34
|
+
export function claimSceneSun(scene) {
|
|
35
|
+
sunClaims.set(scene, (sunClaims.get(scene) ?? 0) + 1);
|
|
36
|
+
let released = false;
|
|
37
|
+
return () => {
|
|
38
|
+
if (released)
|
|
39
|
+
return;
|
|
40
|
+
released = true;
|
|
41
|
+
const n = (sunClaims.get(scene) ?? 1) - 1;
|
|
42
|
+
if (n > 0)
|
|
43
|
+
sunClaims.set(scene, n);
|
|
44
|
+
else
|
|
45
|
+
sunClaims.delete(scene);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function skyOwnsSun(scene) {
|
|
49
|
+
return (sunClaims.get(scene) ?? 0) > 0;
|
|
50
|
+
}
|
|
51
|
+
/** The scene an object lives in (its top-most ancestor). */
|
|
52
|
+
export function sceneOf(object) {
|
|
53
|
+
let o = object;
|
|
54
|
+
while (o.parent)
|
|
55
|
+
o = o.parent;
|
|
56
|
+
return o;
|
|
57
|
+
}
|