@3driseai/3drise-viewer 0.1.28 → 0.1.30
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 +48 -3
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +239 -57
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +21 -5
- package/dist/animationsV2/clipUtils.js +1 -1
- 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 +49 -6
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +68 -12
- package/dist/animationsV2/types.d.ts +28 -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 +1 -1
- package/dist/components/ApollonianGrid.d.ts.map +1 -1
- package/dist/components/ApollonianGrid.js +3 -28
- 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 +1 -1
- package/dist/components/ConformalGrid.d.ts.map +1 -1
- package/dist/components/ConformalGrid.js +3 -34
- 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/EffectsGenerator.d.ts.map +1 -1
- package/dist/components/EffectsGenerator.js +43 -38
- 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/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +22 -2
- 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/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 +1 -1
- package/dist/components/HilbertGrid.d.ts.map +1 -1
- package/dist/components/HilbertGrid.js +3 -30
- 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 +1 -1
- package/dist/components/LensingGrid.d.ts.map +1 -1
- package/dist/components/LensingGrid.js +3 -29
- 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 +10 -10
- 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 +1 -1
- package/dist/components/ParastichyGrid.d.ts.map +1 -1
- package/dist/components/ParastichyGrid.js +3 -30
- package/dist/components/ParticlesGenerator.d.ts.map +1 -1
- package/dist/components/ParticlesGenerator.js +44 -24
- package/dist/components/PhyllotaxisGrid.d.ts +1 -1
- package/dist/components/PhyllotaxisGrid.d.ts.map +1 -1
- package/dist/components/PhyllotaxisGrid.js +3 -32
- package/dist/components/PickVolume.d.ts +17 -0
- package/dist/components/PickVolume.d.ts.map +1 -0
- package/dist/components/PickVolume.js +20 -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 +268 -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 +30 -0
- package/dist/components/TruchetGrid.d.ts +1 -1
- package/dist/components/TruchetGrid.d.ts.map +1 -1
- package/dist/components/TruchetGrid.js +3 -30
- 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 +11 -18
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +9 -10
- 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/particles/BioluminescentWakeParticles.d.ts +5 -0
- package/dist/components/particles/BioluminescentWakeParticles.d.ts.map +1 -1
- package/dist/components/particles/BioluminescentWakeParticles.js +2 -1
- package/dist/components/particles/BrownianDustParticles.d.ts +5 -0
- package/dist/components/particles/BrownianDustParticles.d.ts.map +1 -1
- package/dist/components/particles/BrownianDustParticles.js +2 -0
- package/dist/components/particles/ChladniSandParticles.d.ts +5 -0
- package/dist/components/particles/ChladniSandParticles.d.ts.map +1 -1
- package/dist/components/particles/ChladniSandParticles.js +2 -1
- package/dist/components/particles/ElectronOrbitalsParticles.d.ts +5 -0
- package/dist/components/particles/ElectronOrbitalsParticles.d.ts.map +1 -1
- package/dist/components/particles/ElectronOrbitalsParticles.js +2 -1
- package/dist/components/particles/FaradayPowderParticles.d.ts +5 -0
- package/dist/components/particles/FaradayPowderParticles.d.ts.map +1 -1
- package/dist/components/particles/FaradayPowderParticles.js +2 -1
- package/dist/components/particles/GrinderSparksParticles.d.ts +5 -0
- package/dist/components/particles/GrinderSparksParticles.d.ts.map +1 -1
- package/dist/components/particles/GrinderSparksParticles.js +2 -1
- package/dist/components/particles/MagneticBottleParticles.d.ts +5 -0
- package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -1
- package/dist/components/particles/MagneticBottleParticles.js +2 -1
- package/dist/components/particles/NeonRainParticles.d.ts +5 -0
- package/dist/components/particles/NeonRainParticles.d.ts.map +1 -1
- package/dist/components/particles/NeonRainParticles.js +2 -1
- package/dist/components/particles/ShapeBurstParticles.d.ts +5 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -1
- package/dist/components/particles/ShapeBurstParticles.js +2 -1
- package/dist/components/particles/ShapeFlowParticles.d.ts +5 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -1
- package/dist/components/particles/ShapeFlowParticles.js +2 -1
- package/dist/components/particles/TidalStreamParticles.d.ts +5 -0
- package/dist/components/particles/TidalStreamParticles.d.ts.map +1 -1
- package/dist/components/particles/TidalStreamParticles.js +2 -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/PlainText.d.ts +15 -0
- package/dist/components/text/PlainText.d.ts.map +1 -0
- package/dist/components/text/PlainText.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 +14 -0
- package/dist/components/text/TextObjectView.d.ts.map +1 -0
- package/dist/components/text/TextObjectView.js +17 -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 +49 -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/plain.d.ts +146 -0
- package/dist/components/text/engine/looks/plain.d.ts.map +1 -0
- package/dist/components/text/engine/looks/plain.js +104 -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/bebas-neue.outline.d.ts +3 -0
- package/dist/components/text/fonts/bebas-neue.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/bebas-neue.outline.js +4 -0
- package/dist/components/text/fonts/bebas-neue.strokes.d.ts +3 -0
- package/dist/components/text/fonts/bebas-neue.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/bebas-neue.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 +58 -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/inter.outline.d.ts +3 -0
- package/dist/components/text/fonts/inter.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/inter.outline.js +4 -0
- package/dist/components/text/fonts/inter.strokes.d.ts +3 -0
- package/dist/components/text/fonts/inter.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/inter.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/lora.outline.d.ts +3 -0
- package/dist/components/text/fonts/lora.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/lora.outline.js +4 -0
- package/dist/components/text/fonts/lora.strokes.d.ts +3 -0
- package/dist/components/text/fonts/lora.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/lora.strokes.js +4 -0
- package/dist/components/text/fonts/montserrat.outline.d.ts +3 -0
- package/dist/components/text/fonts/montserrat.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/montserrat.outline.js +4 -0
- package/dist/components/text/fonts/montserrat.strokes.d.ts +3 -0
- package/dist/components/text/fonts/montserrat.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/montserrat.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/oswald.outline.d.ts +3 -0
- package/dist/components/text/fonts/oswald.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/oswald.outline.js +4 -0
- package/dist/components/text/fonts/oswald.strokes.d.ts +3 -0
- package/dist/components/text/fonts/oswald.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/oswald.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/playfair-display.outline.d.ts +3 -0
- package/dist/components/text/fonts/playfair-display.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/playfair-display.outline.js +4 -0
- package/dist/components/text/fonts/playfair-display.strokes.d.ts +3 -0
- package/dist/components/text/fonts/playfair-display.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/playfair-display.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/roboto.outline.d.ts +3 -0
- package/dist/components/text/fonts/roboto.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/roboto.outline.js +4 -0
- package/dist/components/text/fonts/roboto.strokes.d.ts +3 -0
- package/dist/components/text/fonts/roboto.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/roboto.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 +29 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +14 -0
- package/dist/components/text/useTextObject.d.ts +22 -0
- package/dist/components/text/useTextObject.d.ts.map +1 -0
- package/dist/components/text/useTextObject.js +130 -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.map +1 -1
- package/dist/constants.js +6 -0
- 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 +12 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -2
- 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/flock.d.ts.map +1 -1
- package/dist/operations/catalogue/flock.js +44 -9
- 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/inkBloom.d.ts.map +1 -1
- package/dist/operations/catalogue/inkBloom.js +46 -9
- 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/liquidMetal.d.ts.map +1 -1
- package/dist/operations/catalogue/liquidMetal.js +41 -12
- 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/particleSwarm.d.ts.map +1 -1
- package/dist/operations/catalogue/particleSwarm.js +29 -9
- package/dist/operations/catalogue/petalPeel.d.ts.map +1 -1
- package/dist/operations/catalogue/petalPeel.js +33 -9
- 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/portal.d.ts.map +1 -1
- package/dist/operations/catalogue/portal.js +33 -11
- 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/sandErosion.d.ts.map +1 -1
- package/dist/operations/catalogue/sandErosion.js +36 -14
- 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/teleport.d.ts.map +1 -1
- package/dist/operations/catalogue/teleport.js +43 -12
- 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/unweave.d.ts.map +1 -1
- package/dist/operations/catalogue/unweave.js +34 -15
- 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/voxelize.d.ts.map +1 -1
- package/dist/operations/catalogue/voxelize.js +37 -10
- 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 +168 -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 +18 -23
- package/dist/types/gridConfigs.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/pickProxy.d.ts +11 -0
- package/dist/utils/pickProxy.d.ts.map +1 -0
- package/dist/utils/pickProxy.js +36 -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/shapes.d.ts +4 -0
- package/dist/utils/shapes.d.ts.map +1 -1
- package/dist/utils/shapes.js +4 -1
- 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/textShape.d.ts +24 -0
- package/dist/utils/textShape.d.ts.map +1 -0
- package/dist/utils/textShape.js +102 -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRef } from 'react';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
/**
|
|
@@ -6,28 +6,16 @@ import { useFrame } from '@react-three/fiber';
|
|
|
6
6
|
*
|
|
7
7
|
* Advances `u_time` with the raw clock (each shader applies its own
|
|
8
8
|
* `u_animSpeed`, matching MyGridMaterial), mirrors the pointer into `u_mouse`
|
|
9
|
-
* as NDC — the 3drise convention —
|
|
10
|
-
*
|
|
11
|
-
* its target.
|
|
12
|
-
*
|
|
13
|
-
* The pick plane is derived from the mesh's world matrix rather than hard-coded
|
|
14
|
-
* to XZ, so the projection stays correct whether the grid lies flat or stands
|
|
15
|
-
* upright, and whether or not the host applied a transform above it.
|
|
9
|
+
* as NDC — the 3drise convention — and drives `u_reveal` toward its target.
|
|
10
|
+
* `u_focus` stays at the origin: pointer behaviour is a Pointer-tab binding.
|
|
16
11
|
*
|
|
17
12
|
* Reveal is driven at a constant *rate* rather than by replaying a fixed
|
|
18
13
|
* timeline, so retargeting mid-flight — the dissolve that starts while the
|
|
19
14
|
* build is still running — continues smoothly from wherever it had got to
|
|
20
15
|
* instead of snapping back to the start.
|
|
21
16
|
*/
|
|
22
|
-
export function useGridSurface(materialRef,
|
|
23
|
-
const {
|
|
24
|
-
const scratch = useMemo(() => ({
|
|
25
|
-
ray: new THREE.Raycaster(),
|
|
26
|
-
plane: new THREE.Plane(),
|
|
27
|
-
hit: new THREE.Vector3(),
|
|
28
|
-
origin: new THREE.Vector3(),
|
|
29
|
-
normal: new THREE.Vector3(),
|
|
30
|
-
}), []);
|
|
17
|
+
export function useGridSurface(materialRef, _meshRef, options = {}) {
|
|
18
|
+
const { reveal = 1, revealDuration = 0 } = options;
|
|
31
19
|
// Starts at 0 when it has a duration to travel, so the first frame is the
|
|
32
20
|
// beginning of the build rather than a flash of the finished grid.
|
|
33
21
|
const revealNow = useRef(revealDuration > 0 ? 0 : reveal);
|
|
@@ -47,20 +35,6 @@ export function useGridSurface(materialRef, meshRef, options = {}) {
|
|
|
47
35
|
revealNow.current = target;
|
|
48
36
|
}
|
|
49
37
|
material.u_reveal = revealNow.current;
|
|
50
|
-
const mesh = meshRef.current;
|
|
51
|
-
if (!followMouse || !mesh)
|
|
52
|
-
return;
|
|
53
|
-
const { ray, plane, hit, origin, normal } = scratch;
|
|
54
|
-
mesh.updateWorldMatrix(true, false);
|
|
55
|
-
// A PlaneGeometry lives in local XY, so local +Z is its normal.
|
|
56
|
-
normal.set(0, 0, 1).transformDirection(mesh.matrixWorld).normalize();
|
|
57
|
-
origin.setFromMatrixPosition(mesh.matrixWorld);
|
|
58
|
-
plane.setFromNormalAndCoplanarPoint(normal, origin);
|
|
59
|
-
ray.setFromCamera(state.pointer, state.camera);
|
|
60
|
-
if (ray.ray.intersectPlane(plane, hit)) {
|
|
61
|
-
mesh.worldToLocal(hit);
|
|
62
|
-
material.u_focus.set(hit.x, hit.y);
|
|
63
|
-
}
|
|
64
38
|
});
|
|
65
39
|
}
|
|
66
40
|
export default useGridSurface;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEnG,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI9E,wBAAgB,cAAc,CAAC,EAC3B,cAAc,EAAE,SAAc,EAAE,KAAU,EAAE,eAAoB,GACnE,EAAE;IACC,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACtC;iCAkBmD,wBAAwB;EAS3E;AACD,eAAe,cAAc,CAAC"}
|
|
@@ -15,88 +15,35 @@
|
|
|
15
15
|
* actions apply / revert / toggle an action (SceneActions; its own effects
|
|
16
16
|
* run through the same runtime).
|
|
17
17
|
*/
|
|
18
|
-
import { useCallback, useMemo, useRef } from 'react';
|
|
19
|
-
import { SceneActions } from '@3driseai/3drise-core';
|
|
20
|
-
import ClipsRuntime from '../animationsV2/ClipsRuntime.js';
|
|
18
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
21
19
|
import { clipMap } from '../animationsV2/sequenceUtils.js';
|
|
22
|
-
import { runEffect } from '../operations/runtime.js';
|
|
23
20
|
import { useOperationsRuntime } from '../operations/useOperationsRuntime.js';
|
|
21
|
+
import { commandsOf, registerTriggerCatalog, runCommand } from '../triggers/index.js';
|
|
24
22
|
export function useInteraction({ cameraSettings, sequences = [], clips = [], actionSequences = [], }) {
|
|
25
23
|
// The scene's operation tools (camera, bring-to-front…) for the shared runtime.
|
|
26
24
|
useOperationsRuntime(cameraSettings);
|
|
27
|
-
// Toggle state: animation ids whose last toggle went "forward".
|
|
28
|
-
const toggledRef = useRef(new Set());
|
|
29
25
|
const clipsById = useMemo(() => clipMap(clips), [clips]);
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
// Where the commands find their action / clip / sequence (read live: the lists change while editing).
|
|
27
|
+
const lists = useRef({ clipsById, sequences, actionSequences });
|
|
28
|
+
lists.current = { clipsById, sequences, actionSequences };
|
|
29
|
+
const catalog = useMemo(() => ({
|
|
30
|
+
action: (id) => lists.current.actionSequences.find(x => x.id === id),
|
|
31
|
+
clip: (id) => lists.current.clipsById.get(id),
|
|
32
|
+
sequence: (id) => lists.current.sequences.find(s => s.id === id),
|
|
33
|
+
clips: () => lists.current.clipsById,
|
|
34
|
+
}), []);
|
|
35
|
+
// …and the scene's catalog for commands that come without one (studio buttons, nested triggers).
|
|
36
|
+
useEffect(() => registerTriggerCatalog(catalog), [catalog]);
|
|
40
37
|
// ---------------------------------------------------------------- run
|
|
41
38
|
const executeInteraction = useCallback((params) => {
|
|
42
|
-
const { interaction, ref } = params;
|
|
39
|
+
const { interaction, ref, createdObject } = params;
|
|
43
40
|
if (!interaction?.enabled)
|
|
44
41
|
return;
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (a.kind === 'clip') {
|
|
51
|
-
const clip = clipsById.get(a.ref);
|
|
52
|
-
if (!clip)
|
|
53
|
-
continue;
|
|
54
|
-
if (a.command === 'pause')
|
|
55
|
-
ClipsRuntime.pause(clip.id);
|
|
56
|
-
else if (a.command === 'stop')
|
|
57
|
-
ClipsRuntime.stop(clip.id);
|
|
58
|
-
else if (a.command === 'toggle')
|
|
59
|
-
ClipsRuntime.play(clip, { reverse: nextIsBack(`clip:${clip.id}`) });
|
|
60
|
-
else if (ClipsRuntime.isActive(clip.id) && !ClipsRuntime.isPlaying(clip.id) && ClipsRuntime.getTime(clip.id) < clip.duration)
|
|
61
|
-
ClipsRuntime.resume(clip.id);
|
|
62
|
-
else
|
|
63
|
-
ClipsRuntime.play(clip, { from: 0 });
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
const seq = sequences.find(s => s.id === a.ref);
|
|
67
|
-
if (!seq)
|
|
68
|
-
continue;
|
|
69
|
-
if (a.command === 'pause')
|
|
70
|
-
ClipsRuntime.pauseSequence(seq.id);
|
|
71
|
-
else if (a.command === 'stop')
|
|
72
|
-
ClipsRuntime.stopSequence(seq.id);
|
|
73
|
-
else if (a.command === 'toggle') {
|
|
74
|
-
const back = nextIsBack(`seq:${seq.id}`);
|
|
75
|
-
ClipsRuntime.playSequence(seq, clipsById, { reverse: back ? !seq.reverse : seq.reverse });
|
|
76
|
-
}
|
|
77
|
-
else if (ClipsRuntime.isSequenceActive(seq.id) && !ClipsRuntime.isSequencePlaying(seq.id) && ClipsRuntime.getSequenceProgress(seq.id) < 1) {
|
|
78
|
-
ClipsRuntime.resumeSequence(seq.id);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
// From the start edge of its own direction.
|
|
82
|
-
const total = ClipsRuntime.getSequenceDuration(seq.id);
|
|
83
|
-
ClipsRuntime.playSequence(seq, clipsById, { from: seq.reverse && total > 0 ? total : 0 });
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
// 3. Actions.
|
|
88
|
-
for (const a of interaction.actions ?? []) {
|
|
89
|
-
const action = actionSequences.find(x => x.id === a.ref);
|
|
90
|
-
if (!action)
|
|
91
|
-
continue;
|
|
92
|
-
if (a.command === 'revert')
|
|
93
|
-
SceneActions.revertAction(action);
|
|
94
|
-
else if (a.command === 'toggle')
|
|
95
|
-
SceneActions.toggleAction(action);
|
|
96
|
-
else
|
|
97
|
-
SceneActions.applyAction(action);
|
|
98
|
-
}
|
|
99
|
-
}, [clipsById, sequences, actionSequences, nextIsBack]);
|
|
42
|
+
// Every reaction goes through the triggers engine, in the order they always ran.
|
|
43
|
+
const source = { host: 'interaction', id: `${createdObject?.id ?? '?'}:${interaction.mouseEvent}` };
|
|
44
|
+
for (const cmd of commandsOf(interaction))
|
|
45
|
+
runCommand(cmd, { source, self: ref, catalog, chain: [] });
|
|
46
|
+
}, [catalog]);
|
|
100
47
|
return { executeInteraction };
|
|
101
48
|
}
|
|
102
49
|
export default useInteraction;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MutableRefObject, RefObject } from 'react';
|
|
2
2
|
import type { Light, Object3D } from 'three';
|
|
3
3
|
import type { AnimationOptions, MouseMoveDomain } from '@3driseai/3drise-core';
|
|
4
|
+
import type { ConfigLiveValue } from './useConfigLive';
|
|
4
5
|
/**
|
|
5
6
|
* Push a light config onto a THREE light. Only properties the light actually
|
|
6
7
|
* has are written, so one function covers every light type.
|
|
@@ -10,7 +11,7 @@ export interface UseLightConfigResult {
|
|
|
10
11
|
/** Committed config + live drags + animation overrides, refreshed every frame. */
|
|
11
12
|
merged: MutableRefObject<Record<string, any>>;
|
|
12
13
|
/** What the slider drags have written since the last commit. */
|
|
13
|
-
live: MutableRefObject<Record<string,
|
|
14
|
+
live: MutableRefObject<Record<string, ConfigLiveValue>>;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Registers the live-edit handle, evaluates the light's keyframe animations and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLightConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useLightConfig.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLightConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useLightConfig.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CA6B7E;AAED,MAAM,WAAW,oBAAoB;IACjC,kFAAkF;IAClF,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9C,gEAAgE;IAChE,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;CAC3D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,EACnC,QAAQ,EAAE,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,EACjC,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,UAAU,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAC1C,SAAS,CAAC,EAAE,eAAe,GAC5B,oBAAoB,CAiEtB;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -2,7 +2,7 @@ import * as THREE from 'three';
|
|
|
2
2
|
import { type RootState } from '@react-three/fiber';
|
|
3
3
|
import type { SkySettings, TimeSettings } from '@3driseai/3drise-core';
|
|
4
4
|
import { OceanSurfaceMaterial } from '../shaders/ocean/OceanSurfaceMaterial';
|
|
5
|
-
import type { OceanConfig, OceanQualityConfig } from '@3driseai/3drise-core';
|
|
5
|
+
import type { OceanConfig, OceanQualityConfig, ObjectAnimations, MouseMoveInteractions } from '@3driseai/3drise-core';
|
|
6
6
|
/**
|
|
7
7
|
* Everything the two water hosts share: the material, the live-edit handle, and
|
|
8
8
|
* the per-frame uniform push.
|
|
@@ -23,6 +23,10 @@ export interface UseOceanMaterialOptions {
|
|
|
23
23
|
skySettings?: SkySettings;
|
|
24
24
|
timeSettings?: TimeSettings;
|
|
25
25
|
sunIntensity?: number;
|
|
26
|
+
/** Keyframes; the `ocean` domain drives config knobs per frame. */
|
|
27
|
+
animations?: ObjectAnimations;
|
|
28
|
+
/** Pointer bindings; same `ocean` domain. */
|
|
29
|
+
mouseMove?: MouseMoveInteractions;
|
|
26
30
|
/** Runs after the uniforms are pushed, with the live overrides already
|
|
27
31
|
* merged in — where a host does its own per-frame work (snapping the
|
|
28
32
|
* clipmap to the camera, say) with the config it is actually rendering. */
|
|
@@ -34,6 +38,6 @@ export interface OceanMaterialHandle {
|
|
|
34
38
|
* handle a controller reaches through `findById`. */
|
|
35
39
|
rootRef: React.RefObject<THREE.Group | null>;
|
|
36
40
|
}
|
|
37
|
-
export declare function useOceanMaterial({ id, config, quality, skySettings, timeSettings, sunIntensity, onFrame, }: UseOceanMaterialOptions): OceanMaterialHandle;
|
|
41
|
+
export declare function useOceanMaterial({ id, config, quality, skySettings, timeSettings, sunIntensity, animations, mouseMove, onFrame, }: UseOceanMaterialOptions): OceanMaterialHandle;
|
|
38
42
|
export default useOceanMaterial;
|
|
39
43
|
//# sourceMappingURL=useOceanMaterial.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOceanMaterial.d.ts","sourceRoot":"","sources":["../../src/hooks/useOceanMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"useOceanMaterial.d.ts","sourceRoot":"","sources":["../../src/hooks/useOceanMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAU7E,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAStH;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC;;gFAE4E;IAC5E,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACtF;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B;0DACsD;IACtD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;CAChD;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,EAAE,EACF,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAgB,EAChB,UAAU,EACV,SAAS,EACT,OAAO,GACV,EAAE,uBAAuB,GAAG,mBAAmB,CAuG/C;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
1
2
|
import { useEffect, useMemo, useRef } from 'react';
|
|
2
3
|
import { useFrame } from '@react-three/fiber';
|
|
3
4
|
import { useCloudSun } from './useCloudSun.js';
|
|
@@ -6,8 +7,16 @@ import { OceanSurfaceMaterial } from '../shaders/ocean/OceanSurfaceMaterial.js';
|
|
|
6
7
|
import { applySunUniforms } from '../utils/cloudUniforms.js';
|
|
7
8
|
import { applyTerrainAmbient } from '../utils/terrainUniforms.js';
|
|
8
9
|
import { applyOceanUniforms } from '../utils/oceanUniforms.js';
|
|
9
|
-
|
|
10
|
+
import { resolveMoon, moonlightFactor, MOON_LIGHT_COLOR } from '../utils/skyMoon.js';
|
|
11
|
+
/** Moonlight on the water relative to the sun's (sunIntensity 1). The key light
|
|
12
|
+
* runs the moon at ~0.1 of the sun; the water gets a little more so the glitter
|
|
13
|
+
* path reads at night. Tuning knob. */
|
|
14
|
+
const MOON_WATER_STRENGTH = 0.15;
|
|
15
|
+
import { getAnimatableProperties } from '@3driseai/3drise-core';
|
|
16
|
+
import { applyConfigKeyframeAnimations, applyConfigMouseMove, } from '../utils/configAnimations.js';
|
|
17
|
+
export function useOceanMaterial({ id, config, quality, skySettings, timeSettings, sunIntensity = 1, animations, mouseMove, onFrame, }) {
|
|
10
18
|
const { state: sun, update: updateSun } = useCloudSun({ skySettings, timeSettings });
|
|
19
|
+
const moon = useRef({ direction: new THREE.Vector3(), illumination: 0 });
|
|
11
20
|
const material = useMemo(() => new OceanSurfaceMaterial(), []);
|
|
12
21
|
useEffect(() => () => { material.dispose(); }, [material]);
|
|
13
22
|
// Live controller overrides. A slider drag writes here on every pointer-move
|
|
@@ -19,6 +28,17 @@ export function useOceanMaterial({ id, config, quality, skySettings, timeSetting
|
|
|
19
28
|
const liveQuality = useRef({});
|
|
20
29
|
useEffect(() => { liveConfig.current = {}; }, [config]);
|
|
21
30
|
useEffect(() => { liveQuality.current = {}; }, [quality]);
|
|
31
|
+
// The `ocean` keyframe / pointer domains. Same order as the clouds:
|
|
32
|
+
// config -> keyframes -> pointer -> live controller drag. The allowed set is the
|
|
33
|
+
// registry's, so it follows the water type and host exactly as the panels do.
|
|
34
|
+
const animatable = useMemo(() => new Set(getAnimatableProperties({ type: 'ocean', config }, 'ocean').map(p => p.value)), [config.waterType, config.host]);
|
|
35
|
+
const override = useRef({});
|
|
36
|
+
const startValues = useRef({});
|
|
37
|
+
const animStart = useRef(0);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
animStart.current = performance.now();
|
|
40
|
+
startValues.current = {};
|
|
41
|
+
}, [animations]);
|
|
22
42
|
const rootRef = useRef(null);
|
|
23
43
|
// Set in an effect, never as a userData JSX prop: R3F replaces the whole
|
|
24
44
|
// userData object on every render, which would drop the handle whenever
|
|
@@ -44,7 +64,22 @@ export function useOceanMaterial({ id, config, quality, skySettings, timeSetting
|
|
|
44
64
|
// reflect — the sky actually being drawn behind it, or a sunset sea comes
|
|
45
65
|
// out black under a blazing sky.
|
|
46
66
|
applyTerrainAmbient(shader, sun);
|
|
47
|
-
|
|
67
|
+
// The moon's glitter path and light on the water, from the same moon
|
|
68
|
+
// as the key light and the disc (resolveMoon), and the same strength
|
|
69
|
+
// curve (moonlightFactor), so all three appear and fade together.
|
|
70
|
+
const m = resolveMoon(timeSettings, sun.direction, moon.current);
|
|
71
|
+
const sunElevation = THREE.MathUtils.radToDeg(Math.asin(THREE.MathUtils.clamp(sun.direction.y, -1, 1)));
|
|
72
|
+
const k = MOON_WATER_STRENGTH * moonlightFactor(sunElevation, m) * (skySettings?.sunSystem?.moonIntensity ?? 1);
|
|
73
|
+
if (shader.uniforms.u_moonDir)
|
|
74
|
+
shader.uniforms.u_moonDir.value.copy(m.direction);
|
|
75
|
+
if (shader.uniforms.u_moonColor)
|
|
76
|
+
shader.uniforms.u_moonColor.value.setRGB(MOON_LIGHT_COLOR.r * k, MOON_LIGHT_COLOR.g * k, MOON_LIGHT_COLOR.b * k);
|
|
77
|
+
const o = override.current;
|
|
78
|
+
applyConfigKeyframeAnimations(animations?.ocean?.animations, startValues.current, config, o, performance.now() - animStart.current, animatable);
|
|
79
|
+
if (mouseMove?.enabled && mouseMove.ocean?.enabled) {
|
|
80
|
+
applyConfigMouseMove(mouseMove.ocean.properties, config, o, state.pointer, animatable);
|
|
81
|
+
}
|
|
82
|
+
const cfg = { ...config, ...o, ...liveConfig.current };
|
|
48
83
|
const qual = { ...quality, ...liveQuality.current };
|
|
49
84
|
applyOceanUniforms(shader, cfg, qual);
|
|
50
85
|
shader.uniforms.u_time.value = state.clock.getElapsedTime();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Live sky editing, the counterpart to `useCloudLive` and `useOceanLive`.
|
|
4
|
+
*
|
|
5
|
+
* A slider drag writes here on every pointer-move; SkyController's frame loop
|
|
6
|
+
* lays it over the stored settings (and over any keyframe / pointer domain) and
|
|
7
|
+
* pushes the uniforms. Redux only hears about it on slider end.
|
|
8
|
+
*
|
|
9
|
+
* const live = useSkyLive(sky.id);
|
|
10
|
+
* <BaseControllerUi onLiveChange={live.set} onSettingsChange={dispatch} ... />
|
|
11
|
+
*
|
|
12
|
+
* Pass the ID, not a resolved Object3D: the sky mesh is not in the scene while
|
|
13
|
+
* the sun rig is drawing the background, and a findById() memoised in the
|
|
14
|
+
* controller would resolve to null once and stay null.
|
|
15
|
+
*/
|
|
16
|
+
/** Where SkyController stashes its handle on the sky mesh's userData. */
|
|
17
|
+
export declare const SKY_LIVE_KEY = "__skyLive";
|
|
18
|
+
export interface SkyLiveHandle {
|
|
19
|
+
set(key: string, value: number): void;
|
|
20
|
+
}
|
|
21
|
+
export declare function useSkyLive(target?: Object3D | string | null): SkyLiveHandle;
|
|
22
|
+
export default useSkyLive;
|
|
23
|
+
//# sourceMappingURL=useSkyLive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSkyLive.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyLive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC;;;;;;;;;;;;;GAaG;AAEH,yEAAyE;AACzE,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,MAAM,WAAW,aAAa;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAID,wBAAgB,UAAU,CAAC,MAAM,GAAE,QAAQ,GAAG,MAAM,GAAG,IAAa,GAAG,aAAa,CAQnF;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { SKY_ID } from '@3driseai/3drise-core';
|
|
3
|
+
import { findById } from '../utils/sceneQuery.js';
|
|
4
|
+
/**
|
|
5
|
+
* Live sky editing, the counterpart to `useCloudLive` and `useOceanLive`.
|
|
6
|
+
*
|
|
7
|
+
* A slider drag writes here on every pointer-move; SkyController's frame loop
|
|
8
|
+
* lays it over the stored settings (and over any keyframe / pointer domain) and
|
|
9
|
+
* pushes the uniforms. Redux only hears about it on slider end.
|
|
10
|
+
*
|
|
11
|
+
* const live = useSkyLive(sky.id);
|
|
12
|
+
* <BaseControllerUi onLiveChange={live.set} onSettingsChange={dispatch} ... />
|
|
13
|
+
*
|
|
14
|
+
* Pass the ID, not a resolved Object3D: the sky mesh is not in the scene while
|
|
15
|
+
* the sun rig is drawing the background, and a findById() memoised in the
|
|
16
|
+
* controller would resolve to null once and stay null.
|
|
17
|
+
*/
|
|
18
|
+
/** Where SkyController stashes its handle on the sky mesh's userData. */
|
|
19
|
+
export const SKY_LIVE_KEY = '__skyLive';
|
|
20
|
+
const NOOP = { set: () => { } };
|
|
21
|
+
export function useSkyLive(target = SKY_ID) {
|
|
22
|
+
return useMemo(() => {
|
|
23
|
+
const resolve = () => {
|
|
24
|
+
const object = typeof target === 'string' ? findById(target) : target;
|
|
25
|
+
return object?.userData?.[SKY_LIVE_KEY] ?? NOOP;
|
|
26
|
+
};
|
|
27
|
+
return { set: (key, value) => resolve().set(key, value) };
|
|
28
|
+
}, [target]);
|
|
29
|
+
}
|
|
30
|
+
export default useSkyLive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSkyUniforms.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyUniforms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSkyUniforms.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyUniforms.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,wBAAgB,cAAc,IAAI;IAC1B,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,gBAAgB,EAAE,MAAM;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,GAAG,CAAC;QACf,QAAQ,EAAE,GAAG,CAAC;QACd,cAAc,EAAE,GAAG,CAAC;QACpB,eAAe,EAAE,GAAG,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,sBAAsB,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK;QAC9C,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;CACL,CA0DJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useRef, useCallback } from 'react';
|
|
2
2
|
import { createSunPosition } from '../utils/utils3d.js';
|
|
3
|
+
import { sunAnglesFromDirection } from '@3driseai/3drise-core';
|
|
3
4
|
import { findById } from '@3driseai/3drise-core';
|
|
4
5
|
export function useSkyUniforms() {
|
|
5
6
|
const skyMeshRef = useRef(null);
|
|
@@ -15,16 +16,7 @@ export function useSkyUniforms() {
|
|
|
15
16
|
skyMeshRef.current = findById('3drise-sky') || null;
|
|
16
17
|
return skyMeshRef.current;
|
|
17
18
|
}, []);
|
|
18
|
-
const getElevationAndAzimuth = useCallback((sunPosition) =>
|
|
19
|
-
const { x, y, z } = sunPosition;
|
|
20
|
-
const r = Math.sqrt(x * x + y * y + z * z);
|
|
21
|
-
const phi = Math.acos(y / r);
|
|
22
|
-
const theta = Math.atan2(z, x);
|
|
23
|
-
return {
|
|
24
|
-
elevation: 90 - phi * (180 / Math.PI),
|
|
25
|
-
azimuth: theta * (180 / Math.PI),
|
|
26
|
-
};
|
|
27
|
-
}, []);
|
|
19
|
+
const getElevationAndAzimuth = useCallback((sunPosition) => sunAnglesFromDirection(sunPosition), []);
|
|
28
20
|
const updateUniforms = useCallback((settings) => {
|
|
29
21
|
const skyRef = getSkyRef();
|
|
30
22
|
if (!skyRef?.material)
|
|
@@ -21,7 +21,9 @@ import type { Object3D } from 'three';
|
|
|
21
21
|
/** Where TerrainSurface stashes its handle on the root object's userData. */
|
|
22
22
|
export declare const TERRAIN_LIVE_KEY = "__terrainLive";
|
|
23
23
|
export interface TerrainLiveHandle {
|
|
24
|
-
|
|
24
|
+
/** `textures` takes the whole layer block — a texture-layer slider drags it
|
|
25
|
+
* live (tile size, strength, tint are uniforms; nothing repacks). */
|
|
26
|
+
config(key: string, value: number | boolean | string | object): void;
|
|
25
27
|
quality(key: string, value: number | boolean | string): void;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTerrainLive.d.ts","sourceRoot":"","sources":["../../src/hooks/useTerrainLive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAC9B,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"useTerrainLive.d.ts","sourceRoot":"","sources":["../../src/hooks/useTerrainLive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAC9B;0EACsE;IACtE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;CAChE;AAID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,iBAAiB,CAcnF;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { type TerrainTextures } from '@3driseai/3drise-core';
|
|
3
|
+
/**
|
|
4
|
+
* The terrain's four texture layers, loaded and packed into three arrays.
|
|
5
|
+
*
|
|
6
|
+
* | array | R | G | B | A |
|
|
7
|
+
* |--------|--------|-----------|-----|----------|
|
|
8
|
+
* | color | albedo (sRGB) || 255 |
|
|
9
|
+
* | normal | tangent normal, GL || height |
|
|
10
|
+
* | orm | AO | roughness | 0 | 255 |
|
|
11
|
+
*
|
|
12
|
+
* Height is the set's displacement map; a set without one falls back to its AO,
|
|
13
|
+
* which tracks height closely on ground scans (cavities are dark), and to a flat
|
|
14
|
+
* mid value without either. Three arrays rather than five: 4 layers x 1024^2 x 3
|
|
15
|
+
* is ~50 MB, ~67 MB with mips.
|
|
16
|
+
*
|
|
17
|
+
* Returns a ref-stable state object that is mutated when a new set of arrays is
|
|
18
|
+
* ready, so the frame loop reads it without React re-rendering. The previous
|
|
19
|
+
* arrays are released only after the new ones are in, so a set change does not
|
|
20
|
+
* blink the ground.
|
|
21
|
+
*
|
|
22
|
+
* The arrays are SHARED: a module-level cache keyed by the URLs, reference
|
|
23
|
+
* counted. The environment terrain and every land object on the same ground use
|
|
24
|
+
* one copy — at ~67 MB a copy, five patches of Alpine meadow must not cost five.
|
|
25
|
+
*/
|
|
26
|
+
export interface TerrainTextureState {
|
|
27
|
+
ready: boolean;
|
|
28
|
+
color: THREE.DataArrayTexture | null;
|
|
29
|
+
normal: THREE.DataArrayTexture | null;
|
|
30
|
+
orm: THREE.DataArrayTexture | null;
|
|
31
|
+
/** Per layer: has a colour map, so it draws textured. */
|
|
32
|
+
textured: boolean[];
|
|
33
|
+
meanColor: THREE.Vector3[];
|
|
34
|
+
meanNormal: THREE.Vector3[];
|
|
35
|
+
meanOrm: THREE.Vector3[];
|
|
36
|
+
}
|
|
37
|
+
export declare function useTerrainTextures(textures: TerrainTextures | undefined, anisotropy?: number): TerrainTextureState;
|
|
38
|
+
//# sourceMappingURL=useTerrainTextures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTerrainTextures.d.ts","sourceRoot":"","sources":["../../src/hooks/useTerrainTextures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAA;IACpC,MAAM,EAAE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAA;IACrC,GAAG,EAAE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAA;IAClC,yDAAyD;IACzD,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IAC1B,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;IAC3B,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA;CAC3B;AAwHD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,EAAE,UAAU,SAAI,GAAG,mBAAmB,CAwC7G"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { TERRAIN_LAYER_KEYS } from '@3driseai/3drise-core';
|
|
4
|
+
import { buildChannelArray, loadArrayImageOrNull } from '../utils/textureArrays.js';
|
|
5
|
+
/** Array layer size. Every source is redrawn at this size. */
|
|
6
|
+
const ARRAY_SIZE = 1024;
|
|
7
|
+
/** Only the URLs matter: tile size, tint and strength are uniforms and must not
|
|
8
|
+
* trigger a repack. */
|
|
9
|
+
function urlsKey(textures) {
|
|
10
|
+
return JSON.stringify(TERRAIN_LAYER_KEYS.map((k) => {
|
|
11
|
+
const m = textures?.[k]?.maps ?? {};
|
|
12
|
+
return [m.color ?? '', m.normal ?? '', m.roughness ?? '', m.ao ?? '', m.displacement ?? ''];
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
const cache = new Map();
|
|
16
|
+
function disposeData(d) {
|
|
17
|
+
d?.color?.dispose();
|
|
18
|
+
d?.normal?.dispose();
|
|
19
|
+
d?.orm?.dispose();
|
|
20
|
+
}
|
|
21
|
+
async function buildArrays(urls, anisotropy) {
|
|
22
|
+
const images = await Promise.all(urls.map((layer) => Promise.all(layer.map((u) => loadArrayImageOrNull(u)))));
|
|
23
|
+
const colorLayers = [];
|
|
24
|
+
const normalLayers = [];
|
|
25
|
+
const ormLayers = [];
|
|
26
|
+
const textured = [];
|
|
27
|
+
for (const [color, normal, roughness, ao, displacement] of images) {
|
|
28
|
+
textured.push(!!color);
|
|
29
|
+
colorLayers.push([
|
|
30
|
+
{ image: color, channel: 0, fallback: 128 },
|
|
31
|
+
{ image: color, channel: 1, fallback: 128 },
|
|
32
|
+
{ image: color, channel: 2, fallback: 128 },
|
|
33
|
+
{ image: null, fallback: 255 },
|
|
34
|
+
]);
|
|
35
|
+
const height = displacement ?? ao;
|
|
36
|
+
normalLayers.push([
|
|
37
|
+
{ image: normal, channel: 0, fallback: 128 },
|
|
38
|
+
{ image: normal, channel: 1, fallback: 128 },
|
|
39
|
+
{ image: normal, channel: 2, fallback: 255 },
|
|
40
|
+
{ image: height, channel: 0, fallback: 128 },
|
|
41
|
+
]);
|
|
42
|
+
ormLayers.push([
|
|
43
|
+
{ image: ao, channel: 0, fallback: 255 },
|
|
44
|
+
{ image: roughness, channel: 0, fallback: 230 },
|
|
45
|
+
{ image: null, fallback: 0 },
|
|
46
|
+
{ image: null, fallback: 255 },
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const color = buildChannelArray(colorLayers, ARRAY_SIZE, THREE.SRGBColorSpace);
|
|
51
|
+
const normal = buildChannelArray(normalLayers, ARRAY_SIZE, THREE.NoColorSpace);
|
|
52
|
+
const orm = buildChannelArray(ormLayers, ARRAY_SIZE, THREE.NoColorSpace);
|
|
53
|
+
for (const b of [color, normal, orm])
|
|
54
|
+
b.texture.anisotropy = anisotropy;
|
|
55
|
+
return {
|
|
56
|
+
color: color.texture,
|
|
57
|
+
normal: normal.texture,
|
|
58
|
+
orm: orm.texture,
|
|
59
|
+
meanColor: color.means,
|
|
60
|
+
meanNormal: normal.means,
|
|
61
|
+
meanOrm: orm.means,
|
|
62
|
+
textured,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.warn('[terrain] texture packing failed:', error);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function acquire(urlKey, anisotropy) {
|
|
71
|
+
const key = `${anisotropy}|${urlKey}`;
|
|
72
|
+
let entry = cache.get(key);
|
|
73
|
+
if (!entry) {
|
|
74
|
+
const created = { key, refs: 0, data: null, disposed: false, promise: Promise.resolve(null) };
|
|
75
|
+
created.promise = buildArrays(JSON.parse(urlKey), anisotropy).then((data) => {
|
|
76
|
+
// Released while loading: nobody will ever read it.
|
|
77
|
+
if (created.disposed) {
|
|
78
|
+
disposeData(data);
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
created.data = data;
|
|
82
|
+
return data;
|
|
83
|
+
});
|
|
84
|
+
cache.set(key, created);
|
|
85
|
+
entry = created;
|
|
86
|
+
}
|
|
87
|
+
entry.refs++;
|
|
88
|
+
return entry;
|
|
89
|
+
}
|
|
90
|
+
function release(entry) {
|
|
91
|
+
if (!entry)
|
|
92
|
+
return;
|
|
93
|
+
entry.refs--;
|
|
94
|
+
if (entry.refs > 0)
|
|
95
|
+
return;
|
|
96
|
+
entry.disposed = true;
|
|
97
|
+
cache.delete(entry.key);
|
|
98
|
+
disposeData(entry.data);
|
|
99
|
+
entry.data = null;
|
|
100
|
+
}
|
|
101
|
+
const EMPTY = () => ({
|
|
102
|
+
ready: false,
|
|
103
|
+
color: null,
|
|
104
|
+
normal: null,
|
|
105
|
+
orm: null,
|
|
106
|
+
textured: [false, false, false, false],
|
|
107
|
+
meanColor: [],
|
|
108
|
+
meanNormal: [],
|
|
109
|
+
meanOrm: [],
|
|
110
|
+
});
|
|
111
|
+
export function useTerrainTextures(textures, anisotropy = 8) {
|
|
112
|
+
const key = useMemo(() => urlsKey(textures), [textures]);
|
|
113
|
+
const state = useRef(EMPTY()).current;
|
|
114
|
+
/** The cache entry `state` currently shows. */
|
|
115
|
+
const held = useRef(null);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
const urls = JSON.parse(key);
|
|
118
|
+
if (!urls.some((layer) => !!layer[0])) {
|
|
119
|
+
Object.assign(state, EMPTY());
|
|
120
|
+
release(held.current);
|
|
121
|
+
held.current = null;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
let cancelled = false;
|
|
125
|
+
const entry = acquire(key, anisotropy);
|
|
126
|
+
entry.promise.then((data) => {
|
|
127
|
+
if (cancelled || !data)
|
|
128
|
+
return;
|
|
129
|
+
Object.assign(state, data, { ready: true });
|
|
130
|
+
const old = held.current;
|
|
131
|
+
held.current = entry;
|
|
132
|
+
// Same entry re-acquired (anisotropy unchanged, key back): drop the extra ref.
|
|
133
|
+
release(old);
|
|
134
|
+
});
|
|
135
|
+
return () => {
|
|
136
|
+
cancelled = true;
|
|
137
|
+
// Never shown: give it back. A shown entry is released when its
|
|
138
|
+
// replacement arrives, or on unmount.
|
|
139
|
+
if (held.current !== entry)
|
|
140
|
+
release(entry);
|
|
141
|
+
};
|
|
142
|
+
}, [key, anisotropy, state]);
|
|
143
|
+
useEffect(() => () => {
|
|
144
|
+
release(held.current);
|
|
145
|
+
held.current = null;
|
|
146
|
+
Object.assign(state, EMPTY());
|
|
147
|
+
}, [state]);
|
|
148
|
+
return state;
|
|
149
|
+
}
|