@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
|
@@ -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
|
+
}
|
package/dist/utils/shapes.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ export interface ShapeOptions {
|
|
|
39
39
|
tube?: number;
|
|
40
40
|
size?: number;
|
|
41
41
|
text?: string;
|
|
42
|
+
/** text: packed outline font id, extra letter advance (em), bevel on/off */
|
|
43
|
+
font?: string;
|
|
44
|
+
letterSpacing?: number;
|
|
45
|
+
bevelEnabled?: boolean;
|
|
42
46
|
vertices?: number[];
|
|
43
47
|
indices?: number[];
|
|
44
48
|
normals?: number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../src/utils/shapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAyQ,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../src/utils/shapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAyQ,MAAM,OAAO,CAAC;AAG3T,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,kBAAkB,GAAG,SAAS,GAAG,aAAa,GAAG,YAAY,GAAG,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEpa,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,cAAc,CAAC;AAgBpE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,cAAc,CAua7D,CAAC"}
|
package/dist/utils/shapes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoxGeometry, BufferGeometry, CapsuleGeometry, ConeGeometry, CylinderGeometry, DodecahedronGeometry, ExtrudeGeometry, Float32BufferAttribute, IcosahedronGeometry, OctahedronGeometry, Path, PlaneGeometry, RingGeometry, Shape, ShapeGeometry, SphereGeometry, TetrahedronGeometry, TorusGeometry, } from 'three';
|
|
2
2
|
import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
|
|
3
|
+
import { buildTextGeometry, outlineFontSync } from './textShape.js';
|
|
3
4
|
const safeNumber = (value, fallback, min) => {
|
|
4
5
|
const num = typeof value === 'number' && !Number.isNaN(value) ? value : fallback;
|
|
5
6
|
return min !== undefined ? Math.max(num, min) : num;
|
|
@@ -175,7 +176,9 @@ export const shapeGenerators = {
|
|
|
175
176
|
octahedron: ({ radius, detail }) => new OctahedronGeometry(safeNumber(radius, 0.5, 0.0001), safeNumber(detail, 0, 0)),
|
|
176
177
|
tetrahedron: ({ radius, detail }) => new TetrahedronGeometry(safeNumber(radius, 0.5, 0.0001), safeNumber(detail, 0, 0)),
|
|
177
178
|
dodecahedron: ({ radius, detail }) => new DodecahedronGeometry(safeNumber(radius, 0.5, 0.0001), safeNumber(detail, 0, 0)),
|
|
178
|
-
|
|
179
|
+
// the string extruded from a packed outline font (utils/textShape); empty until the font has loaded,
|
|
180
|
+
// GeometryShape re-renders when it lands
|
|
181
|
+
text: (o) => { const f = outlineFontSync(o.font); return f ? buildTextGeometry(f, o) : new BufferGeometry(); },
|
|
179
182
|
point: ({ size }) => new SphereGeometry(safeNumber(size, 0.1, 0.0001), 16, 16),
|
|
180
183
|
custom: ({ vertices = [], indices = [], normals, uvs }) => {
|
|
181
184
|
const geometry = new BufferGeometry();
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Vector3 } from 'three';
|
|
2
|
+
import type { TimeSettings } from '@3driseai/3drise-core';
|
|
3
|
+
export interface MoonState {
|
|
4
|
+
/** Unit vector toward the moon (core sunUtils convention). */
|
|
5
|
+
direction: Vector3;
|
|
6
|
+
/** Lit fraction of the disc, 0 new … 1 full. */
|
|
7
|
+
illumination: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Where the moon is, for the key light and the moon disc.
|
|
11
|
+
*
|
|
12
|
+
* With time of day on it is the clock's moon — the sun's own arc, `moonPhase`
|
|
13
|
+
* of a day behind (see SkySystemManager.calculateMoon). With time off there are
|
|
14
|
+
* no hours to lag by, so it is a full moon opposite the sun: set the sun below
|
|
15
|
+
* the horizon and the moon stands above it on the other side.
|
|
16
|
+
*
|
|
17
|
+
* `sunDirection` is the resolved sun (useCloudSun), so the moon is always
|
|
18
|
+
* placed against the sun that is actually drawn and lit.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveMoon(timeSettings: TimeSettings | undefined, sunDirection: Vector3, out: MoonState): MoonState;
|
|
21
|
+
/** Night tint for moonlight (perceived, not physical — real moonlight is
|
|
22
|
+
* slightly red; at night the eye reads it blue). Shared by the key light and
|
|
23
|
+
* the water so the moon lights both the same colour. */
|
|
24
|
+
export declare const MOON_LIGHT_COLOR: {
|
|
25
|
+
readonly r: 0.62;
|
|
26
|
+
readonly g: 0.72;
|
|
27
|
+
readonly b: 1;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 0..1 strength of moonlight: the sun must be down (fades in from −1° to −8°),
|
|
31
|
+
* the moon up (−1° … 4°), scaled by how much of the disc is lit. The key light
|
|
32
|
+
* and the ocean's moon glitter both use this, so they come and go together.
|
|
33
|
+
*/
|
|
34
|
+
export declare function moonlightFactor(sunElevationDeg: number, moon: MoonState): number;
|
|
35
|
+
//# sourceMappingURL=skyMoon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skyMoon.d.ts","sourceRoot":"","sources":["../../src/utils/skyMoon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,SAAS;IACtB,8DAA8D;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,GAAG,SAAS,CAWpH;AAED;;yDAEyD;AACzD,eAAO,MAAM,gBAAgB;;;;CAAwC,CAAC;AAOtE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAGhF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { skySystemManager } from '@3driseai/3drise-core';
|
|
2
|
+
/**
|
|
3
|
+
* Where the moon is, for the key light and the moon disc.
|
|
4
|
+
*
|
|
5
|
+
* With time of day on it is the clock's moon — the sun's own arc, `moonPhase`
|
|
6
|
+
* of a day behind (see SkySystemManager.calculateMoon). With time off there are
|
|
7
|
+
* no hours to lag by, so it is a full moon opposite the sun: set the sun below
|
|
8
|
+
* the horizon and the moon stands above it on the other side.
|
|
9
|
+
*
|
|
10
|
+
* `sunDirection` is the resolved sun (useCloudSun), so the moon is always
|
|
11
|
+
* placed against the sun that is actually drawn and lit.
|
|
12
|
+
*/
|
|
13
|
+
export function resolveMoon(timeSettings, sunDirection, out) {
|
|
14
|
+
if (timeSettings?.enabled) {
|
|
15
|
+
const s = skySystemManager.getState();
|
|
16
|
+
out.direction.copy(s.moonDirection);
|
|
17
|
+
out.illumination = s.moonIllumination;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
out.direction.copy(sunDirection).negate();
|
|
21
|
+
out.illumination = 1;
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
/** Night tint for moonlight (perceived, not physical — real moonlight is
|
|
26
|
+
* slightly red; at night the eye reads it blue). Shared by the key light and
|
|
27
|
+
* the water so the moon lights both the same colour. */
|
|
28
|
+
export const MOON_LIGHT_COLOR = { r: 0.62, g: 0.72, b: 1.0 };
|
|
29
|
+
const smooth01 = (edge0, edge1, x) => {
|
|
30
|
+
const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));
|
|
31
|
+
return t * t * (3 - 2 * t);
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 0..1 strength of moonlight: the sun must be down (fades in from −1° to −8°),
|
|
35
|
+
* the moon up (−1° … 4°), scaled by how much of the disc is lit. The key light
|
|
36
|
+
* and the ocean's moon glitter both use this, so they come and go together.
|
|
37
|
+
*/
|
|
38
|
+
export function moonlightFactor(sunElevationDeg, moon) {
|
|
39
|
+
const moonElevation = (Math.asin(Math.max(-1, Math.min(1, moon.direction.y))) * 180) / Math.PI;
|
|
40
|
+
return smooth01(-1, -8, sunElevationDeg) * smooth01(-1, 4, moonElevation) * moon.illumination;
|
|
41
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TerrainConfig } from '@3driseai/3drise-core';
|
|
2
|
+
/** World height of the terrain surface at world (x, z). */
|
|
3
|
+
export declare function terrainHeightAt(config: TerrainConfig, x: number, z: number, lodCell?: number): number;
|
|
4
|
+
//# sourceMappingURL=terrainHeight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terrainHeight.d.ts","sourceRoot":"","sources":["../../src/utils/terrainHeight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA6E3D,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,SAAI,GAAG,MAAM,CAmFhG"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terrain's height field on the CPU — a line-for-line port of
|
|
3
|
+
* `terrainHeightAt` in shaders/glsl/terrainCore.glsl.ts.
|
|
4
|
+
*
|
|
5
|
+
* Until this existed the shader was the only thing that knew where the ground
|
|
6
|
+
* was: nothing could stand on the terrain, and the studio camera could sit 200 m
|
|
7
|
+
* above it (or inside a hill) with no way to tell. Now the panel can put the
|
|
8
|
+
* camera on the ground and the agent can ask `env.terrain.heightAt(x, z)`.
|
|
9
|
+
*
|
|
10
|
+
* KEEP IT IN STEP WITH THE GLSL. Any change to the height field there — an
|
|
11
|
+
* octave rule, a shaping operator, a constant — must land here too, or a query
|
|
12
|
+
* and the rendered surface disagree.
|
|
13
|
+
*
|
|
14
|
+
* The hash runs through Math.fround so its fract() lands where the GPU's float32
|
|
15
|
+
* one does; everything else is plain double precision, which differs from the
|
|
16
|
+
* GPU by far less than a centimetre.
|
|
17
|
+
*
|
|
18
|
+
* `lodCell` is the shading cell, as in the shader: octaves finer than about two
|
|
19
|
+
* cells are faded out. The default is the finest clipmap cell, which is what the
|
|
20
|
+
* mesh under a camera standing on the ground is built from. Curvature is not
|
|
21
|
+
* applied — it is a view-relative bend, and is negligible within a kilometre.
|
|
22
|
+
*/
|
|
23
|
+
const f32 = Math.fround;
|
|
24
|
+
const fract = (x) => x - Math.floor(x);
|
|
25
|
+
const clamp = (x, lo, hi) => Math.min(hi, Math.max(lo, x));
|
|
26
|
+
const mix = (a, b, t) => a + (b - a) * t;
|
|
27
|
+
const smoothstep = (e0, e1, x) => {
|
|
28
|
+
const t = clamp((x - e0) / (e1 - e0), 0, 1);
|
|
29
|
+
return t * t * (3 - 2 * t);
|
|
30
|
+
};
|
|
31
|
+
/** tHash: Hoskins, float32. Returns two components in [-1, 1]. */
|
|
32
|
+
function tHash(px, py) {
|
|
33
|
+
let a = f32(fract(f32(px * 0.1031)));
|
|
34
|
+
let b = f32(fract(f32(py * 0.1030)));
|
|
35
|
+
let c = f32(fract(f32(px * 0.0973)));
|
|
36
|
+
const d = f32(f32(a * f32(b + 33.33)) + f32(b * f32(c + 33.33)) + f32(c * f32(a + 33.33)));
|
|
37
|
+
a = f32(a + d);
|
|
38
|
+
b = f32(b + d);
|
|
39
|
+
c = f32(c + d);
|
|
40
|
+
// fract((p3.xx + p3.yz) * p3.zy)
|
|
41
|
+
const x = f32(fract(f32(f32(a + b) * c)));
|
|
42
|
+
const y = f32(fract(f32(f32(a + c) * b)));
|
|
43
|
+
return [-1 + 2 * x, -1 + 2 * y];
|
|
44
|
+
}
|
|
45
|
+
/** tNoised: gradient noise with derivative. [value, d/dx, d/dy]. */
|
|
46
|
+
function tNoised(x, y) {
|
|
47
|
+
const ix = Math.floor(x), iy = Math.floor(y);
|
|
48
|
+
const fx = x - ix, fy = y - iy;
|
|
49
|
+
const ux = fx * fx * fx * (fx * (fx * 6 - 15) + 10);
|
|
50
|
+
const uy = fy * fy * fy * (fy * (fy * 6 - 15) + 10);
|
|
51
|
+
const dux = 30 * fx * fx * (fx * (fx - 2) + 1);
|
|
52
|
+
const duy = 30 * fy * fy * (fy * (fy - 2) + 1);
|
|
53
|
+
const ga = tHash(ix, iy);
|
|
54
|
+
const gb = tHash(ix + 1, iy);
|
|
55
|
+
const gc = tHash(ix, iy + 1);
|
|
56
|
+
const gd = tHash(ix + 1, iy + 1);
|
|
57
|
+
const va = ga[0] * fx + ga[1] * fy;
|
|
58
|
+
const vb = gb[0] * (fx - 1) + gb[1] * fy;
|
|
59
|
+
const vc = gc[0] * fx + gc[1] * (fy - 1);
|
|
60
|
+
const vd = gd[0] * (fx - 1) + gd[1] * (fy - 1);
|
|
61
|
+
const k = va - vb - vc + vd;
|
|
62
|
+
const v = va + ux * (vb - va) + uy * (vc - va) + ux * uy * k;
|
|
63
|
+
const dx = ga[0] + ux * (gb[0] - ga[0]) + uy * (gc[0] - ga[0]) + ux * uy * (ga[0] - gb[0] - gc[0] + gd[0])
|
|
64
|
+
+ dux * (uy * k + vb - va);
|
|
65
|
+
const dy = ga[1] + ux * (gb[1] - ga[1]) + uy * (gc[1] - ga[1]) + ux * uy * (ga[1] - gb[1] - gc[1] + gd[1])
|
|
66
|
+
+ duy * (ux * k + vc - va);
|
|
67
|
+
return [v, dx, dy];
|
|
68
|
+
}
|
|
69
|
+
const TYPE_INDEX = { mountains: 0, dunes: 1, hills: 2, canyon: 3 };
|
|
70
|
+
/** World height of the terrain surface at world (x, z). */
|
|
71
|
+
export function terrainHeightAt(config, x, z, lodCell = 2) {
|
|
72
|
+
const baseScale = 1 / (config.featureSize > 1e-6 ? config.featureSize : 2600);
|
|
73
|
+
const octaves = Math.round(clamp(config.octaves, 1, 12));
|
|
74
|
+
const lacunarity = config.lacunarity;
|
|
75
|
+
const gain = config.gain;
|
|
76
|
+
const ridge = config.ridgeSharpness;
|
|
77
|
+
const warpStrength = config.warpStrength;
|
|
78
|
+
const warpScale = config.warpSize;
|
|
79
|
+
const erosion = config.erosion;
|
|
80
|
+
const elevation = Math.max(config.elevation, 0.01);
|
|
81
|
+
const type = TYPE_INDEX[config.terrainType] ?? 2;
|
|
82
|
+
let qx = x * baseScale;
|
|
83
|
+
let qy = z * baseScale;
|
|
84
|
+
if (warpStrength > 0) {
|
|
85
|
+
const w0 = tNoised(qx * warpScale + 11.3, qy * warpScale + 5.7)[0];
|
|
86
|
+
const w1 = tNoised(qx * warpScale - 7.1, qy * warpScale + 19.2)[0];
|
|
87
|
+
qx += w0 * warpStrength;
|
|
88
|
+
qy += w1 * warpStrength;
|
|
89
|
+
}
|
|
90
|
+
let amp = 1, freq = 1, sum = 0, norm = 0;
|
|
91
|
+
let sx = 0, sy = 0;
|
|
92
|
+
let wl = 1 / Math.max(baseScale, 1e-9);
|
|
93
|
+
for (let i = 0; i < 12; i++) {
|
|
94
|
+
if (i >= octaves)
|
|
95
|
+
break;
|
|
96
|
+
const fade = clamp(wl / Math.max(2 * lodCell, 1e-4) - 1, 0, 1);
|
|
97
|
+
if (fade <= 0.001)
|
|
98
|
+
break;
|
|
99
|
+
const n = tNoised(qx * freq + i * 37.13, qy * freq + i * 61.91);
|
|
100
|
+
let v = n[0];
|
|
101
|
+
let gx = n[1], gy = n[2];
|
|
102
|
+
if (ridge > 0) {
|
|
103
|
+
const ridgeAmt = ridge * clamp(i * 0.5, 0, 1);
|
|
104
|
+
const sg = Math.sign(v);
|
|
105
|
+
const r = 1 - Math.abs(v);
|
|
106
|
+
v = mix(v, r * r * 2 - 1, ridgeAmt);
|
|
107
|
+
gx = mix(gx, -4 * r * sg * gx, ridgeAmt);
|
|
108
|
+
gy = mix(gy, -4 * r * sg * gy, ridgeAmt);
|
|
109
|
+
}
|
|
110
|
+
const damp = 1 / (1 + erosion * 1.5 * (sx * sx + sy * sy));
|
|
111
|
+
sum += amp * damp * fade * v;
|
|
112
|
+
norm += amp * fade;
|
|
113
|
+
sx += gx * amp * damp;
|
|
114
|
+
sy += gy * amp * damp;
|
|
115
|
+
amp *= gain;
|
|
116
|
+
freq *= lacunarity;
|
|
117
|
+
wl /= lacunarity;
|
|
118
|
+
}
|
|
119
|
+
const t = (sum / Math.max(norm, 1e-4)) * 3.2;
|
|
120
|
+
let h = 0.5 + 0.5 * t / Math.sqrt(1 + t * t);
|
|
121
|
+
if (type === 1) {
|
|
122
|
+
const a = (config.bearing * Math.PI) / 180;
|
|
123
|
+
let bx = Math.sin(a), by = Math.cos(a);
|
|
124
|
+
const bl = Math.hypot(bx, by) || 1;
|
|
125
|
+
bx /= bl;
|
|
126
|
+
by /= bl;
|
|
127
|
+
// d = vec2(bearingDir.y, -bearingDir.x)
|
|
128
|
+
const duneFreq = (Math.PI * 2) / Math.max(config.duneWavelength, 1);
|
|
129
|
+
const u = 0.5 + 0.5 * Math.sin((x * by + z * -bx) * duneFreq + 7 * h);
|
|
130
|
+
const s = Math.pow(Math.max(u, 1e-4), mix(1, 3.2, config.duneAsymmetry));
|
|
131
|
+
h = mix(0.15 + 0.5 * h, s * (0.45 + 0.55 * h), 0.8);
|
|
132
|
+
}
|
|
133
|
+
else if (type === 3) {
|
|
134
|
+
const om = 1 - h;
|
|
135
|
+
const mesa = mix(h, 1 - om * om * om, config.plateau);
|
|
136
|
+
const ch = 1 - Math.abs(tNoised(x * (baseScale * 1.7) + 4.2, z * (baseScale * 1.7) - 9.1)[0]);
|
|
137
|
+
h = mesa - config.valleyDepth * smoothstep(1 - config.valleyWidth, 1, ch);
|
|
138
|
+
}
|
|
139
|
+
const terraces = Math.round(config.terraces);
|
|
140
|
+
if (terraces >= 0.5) {
|
|
141
|
+
const n = terraces;
|
|
142
|
+
const featureSize = 1 / Math.max(baseScale, 1e-9);
|
|
143
|
+
const soft = clamp((lodCell * n * 8) / featureSize, 0, 1);
|
|
144
|
+
const w = Math.max(1 - 0.95 * config.terraceSharpness, 0.02);
|
|
145
|
+
const xh = h * n;
|
|
146
|
+
const fr = fract(xh);
|
|
147
|
+
h = (Math.floor(xh) + mix(smoothstep(0, w, fr), fr, soft)) / n;
|
|
148
|
+
}
|
|
149
|
+
return config.seaLevel + elevation * h;
|
|
150
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TerrainTextures } from '@3driseai/3drise-core';
|
|
2
|
+
/**
|
|
3
|
+
* Turns texture-set NAMES into map URLs for terrain textures that name a set but
|
|
4
|
+
* carry no URLs yet (a land object fresh from the catalog, a ground picked before
|
|
5
|
+
* the files were uploaded).
|
|
6
|
+
*
|
|
7
|
+
* The viewer does not know the app's file tree, so the client registers the
|
|
8
|
+
* resolver (it owns the texture library) and re-registers it when the library
|
|
9
|
+
* changes; renderers subscribe to the version so they re-resolve. Without one — an
|
|
10
|
+
* embed, a test harness — the stored URLs are used as they are. Must return the
|
|
11
|
+
* SAME object when nothing changes, so renderer memos hold.
|
|
12
|
+
*/
|
|
13
|
+
export type TerrainTextureResolver = (textures: TerrainTextures | undefined) => TerrainTextures | undefined;
|
|
14
|
+
export declare function setTerrainTextureResolver(fn: TerrainTextureResolver | null): void;
|
|
15
|
+
export declare function resolveTerrainTextureSets(textures: TerrainTextures | undefined): TerrainTextures | undefined;
|
|
16
|
+
/** Changes whenever the resolver does: a memo dependency for resolved textures. */
|
|
17
|
+
export declare function useTerrainTextureResolverVersion(): number;
|
|
18
|
+
//# sourceMappingURL=terrainTextureResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terrainTextureResolver.d.ts","sourceRoot":"","sources":["../../src/utils/terrainTextureResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,KAAK,eAAe,GAAG,SAAS,CAAC;AAM5G,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAIjF;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,eAAe,GAAG,SAAS,CAE5G;AAED,mFAAmF;AACnF,wBAAgB,gCAAgC,IAAI,MAAM,CAMzD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
let resolver = null;
|
|
3
|
+
let version = 0;
|
|
4
|
+
const listeners = new Set();
|
|
5
|
+
export function setTerrainTextureResolver(fn) {
|
|
6
|
+
resolver = fn;
|
|
7
|
+
version++;
|
|
8
|
+
for (const l of listeners)
|
|
9
|
+
l();
|
|
10
|
+
}
|
|
11
|
+
export function resolveTerrainTextureSets(textures) {
|
|
12
|
+
return resolver ? (resolver(textures) ?? textures) : textures;
|
|
13
|
+
}
|
|
14
|
+
/** Changes whenever the resolver does: a memo dependency for resolved textures. */
|
|
15
|
+
export function useTerrainTextureResolverVersion() {
|
|
16
|
+
return useSyncExternalStore((l) => { listeners.add(l); return () => { listeners.delete(l); }; }, () => version, () => version);
|
|
17
|
+
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import type { TerrainConfig, TerrainQualityConfig } from '@3driseai/3drise-core';
|
|
3
|
+
import type { TerrainTextureState } from '../hooks/useTerrainTextures';
|
|
3
4
|
import type { CloudSunState } from '../hooks/useCloudSun';
|
|
4
5
|
export declare function applyTerrainUniforms(material: THREE.ShaderMaterial, config: TerrainConfig, quality: TerrainQualityConfig): void;
|
|
5
6
|
export default applyTerrainUniforms;
|
|
7
|
+
/**
|
|
8
|
+
* The texture layer uniforms, and the TERRAIN_TEXTURED define.
|
|
9
|
+
*
|
|
10
|
+
* Called every frame after `applyTerrainUniforms`, like it, so tile size, tint,
|
|
11
|
+
* brightness and normal strength are live.
|
|
12
|
+
*
|
|
13
|
+
* A textured layer is the set's own colours, brought to the luminance of the
|
|
14
|
+
* layer's tuned colour, × tint × brightness. Its far colour —
|
|
15
|
+
* what the near field fades into past the texture distance — is the texture's mean
|
|
16
|
+
* × the same factors, so the fade has nothing to jump. An untextured layer is its
|
|
17
|
+
* flat hex colour, near and far.
|
|
18
|
+
*
|
|
19
|
+
* The define only flips when the arrays arrive or go, so the recompile happens
|
|
20
|
+
* once per texture change, never per frame.
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyTerrainTextures(material: THREE.ShaderMaterial, config: TerrainConfig, tex: TerrainTextureState): void;
|
|
6
23
|
/** skyRadiance(rd), in the units the shader returns. */
|
|
7
24
|
export declare function skyRadianceAt(rd: THREE.Vector3, sun: CloudSunState, out: THREE.Color): THREE.Color;
|
|
8
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terrainUniforms.d.ts","sourceRoot":"","sources":["../../src/utils/terrainUniforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAe,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"terrainUniforms.d.ts","sourceRoot":"","sources":["../../src/utils/terrainUniforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAe,MAAM,uBAAuB,CAAC;AAE9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAoD1D,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,oBAAoB,GAC9B,IAAI,CAwDN;AAED,eAAe,oBAAoB,CAAC;AAUpC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,mBAAmB,GACzB,IAAI,CAyDN;AAiCD,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CA4BlG;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAwC5F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
+
import { TERRAIN_LAYER_KEYS } from '@3driseai/3drise-core';
|
|
2
3
|
/**
|
|
3
4
|
* Config to uniform mapping for the terrain material.
|
|
4
5
|
*
|
|
@@ -98,6 +99,89 @@ export function applyTerrainUniforms(material, config, quality) {
|
|
|
98
99
|
}
|
|
99
100
|
export default applyTerrainUniforms;
|
|
100
101
|
// -----------------------------------------------------------------------------
|
|
102
|
+
// Ground textures
|
|
103
|
+
// -----------------------------------------------------------------------------
|
|
104
|
+
const _flat = new THREE.Color();
|
|
105
|
+
const luma = (r, g, b) => 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
106
|
+
const LAYER_COLOR_KEY = ['lowColor', 'midColor', 'rockColor', 'peakColor'];
|
|
107
|
+
/**
|
|
108
|
+
* The texture layer uniforms, and the TERRAIN_TEXTURED define.
|
|
109
|
+
*
|
|
110
|
+
* Called every frame after `applyTerrainUniforms`, like it, so tile size, tint,
|
|
111
|
+
* brightness and normal strength are live.
|
|
112
|
+
*
|
|
113
|
+
* A textured layer is the set's own colours, brought to the luminance of the
|
|
114
|
+
* layer's tuned colour, × tint × brightness. Its far colour —
|
|
115
|
+
* what the near field fades into past the texture distance — is the texture's mean
|
|
116
|
+
* × the same factors, so the fade has nothing to jump. An untextured layer is its
|
|
117
|
+
* flat hex colour, near and far.
|
|
118
|
+
*
|
|
119
|
+
* The define only flips when the arrays arrive or go, so the recompile happens
|
|
120
|
+
* once per texture change, never per frame.
|
|
121
|
+
*/
|
|
122
|
+
export function applyTerrainTextures(material, config, tex) {
|
|
123
|
+
const u = material.uniforms;
|
|
124
|
+
if (!u || !u.u_tFar)
|
|
125
|
+
return;
|
|
126
|
+
const textures = config.textures;
|
|
127
|
+
const far = u.u_tFar.value;
|
|
128
|
+
const layer = u.u_tLayer.value;
|
|
129
|
+
const tint = u.u_tTint.value;
|
|
130
|
+
let any = false;
|
|
131
|
+
TERRAIN_LAYER_KEYS.forEach((key, i) => {
|
|
132
|
+
const t = textures?.[key];
|
|
133
|
+
const textured = !!(tex.ready && tex.textured[i]);
|
|
134
|
+
any = any || textured;
|
|
135
|
+
if (textured) {
|
|
136
|
+
const m = tex.meanColor[i];
|
|
137
|
+
// Exposure: scans are photographed at any brightness, so a textured
|
|
138
|
+
// layer is first brought to the LUMINANCE of the layer's tuned colour
|
|
139
|
+
// (the biome sets it), keeping the scan's own hue and detail. Then the
|
|
140
|
+
// user's brightness and tint act on top of that.
|
|
141
|
+
_flat.setStyle(config[LAYER_COLOR_KEY[i]], THREE.SRGBColorSpace);
|
|
142
|
+
const auto = THREE.MathUtils.clamp(luma(_flat.r, _flat.g, _flat.b) / Math.max(luma(m.x, m.y, m.z), 1e-3), 0.25, 4);
|
|
143
|
+
_flat.setStyle(t?.tint || '#ffffff', THREE.SRGBColorSpace);
|
|
144
|
+
const k = Math.max(t?.brightness ?? 1, 0) * auto;
|
|
145
|
+
tint[i].setRGB(_flat.r * k, _flat.g * k, _flat.b * k);
|
|
146
|
+
far[i].setRGB(m.x * tint[i].r, m.y * tint[i].g, m.z * tint[i].b);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
_flat.setStyle(config[LAYER_COLOR_KEY[i]], THREE.SRGBColorSpace);
|
|
150
|
+
far[i].copy(_flat);
|
|
151
|
+
tint[i].setRGB(1, 1, 1);
|
|
152
|
+
}
|
|
153
|
+
layer[i].set(1 / Math.max(t?.tileSize ?? 3, 0.05), t?.normalStrength ?? 1, textured ? 1 : 0, 0);
|
|
154
|
+
});
|
|
155
|
+
if (any) {
|
|
156
|
+
u.u_tColor.value = tex.color;
|
|
157
|
+
u.u_tNormal.value = tex.normal;
|
|
158
|
+
u.u_tOrm.value = tex.orm;
|
|
159
|
+
const mc = u.u_tMeanC.value;
|
|
160
|
+
const mn = u.u_tMeanN.value;
|
|
161
|
+
const mo = u.u_tMeanO.value;
|
|
162
|
+
for (let i = 0; i < 4; i++) {
|
|
163
|
+
const c = tex.meanColor[i], n = tex.meanNormal[i], o = tex.meanOrm[i];
|
|
164
|
+
if (c)
|
|
165
|
+
mc[i].set(c.x, c.y, c.z, 1);
|
|
166
|
+
if (n)
|
|
167
|
+
mn[i].set(n.x, n.y, n.z, 0.5);
|
|
168
|
+
if (o)
|
|
169
|
+
mo[i].set(o.x, o.y, o.z, 1);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
u.u_tDistance.value = Math.max(config.textureDistance ?? 1500, 1);
|
|
173
|
+
u.u_tHeightBlend.value = THREE.MathUtils.clamp(config.textureHeightBlend ?? 0.7, 0, 1);
|
|
174
|
+
const defines = (material.defines ??= {});
|
|
175
|
+
const has = 'TERRAIN_TEXTURED' in defines;
|
|
176
|
+
if (any !== has) {
|
|
177
|
+
if (any)
|
|
178
|
+
defines.TERRAIN_TEXTURED = '';
|
|
179
|
+
else
|
|
180
|
+
delete defines.TERRAIN_TEXTURED;
|
|
181
|
+
material.needsUpdate = true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// -----------------------------------------------------------------------------
|
|
101
185
|
// Ambient
|
|
102
186
|
// -----------------------------------------------------------------------------
|
|
103
187
|
/**
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BufferGeometry } from 'three';
|
|
2
|
+
export declare const DEFAULT_TEXT_SHAPE_FONT = "inter";
|
|
3
|
+
export declare const isOutlineFontLoaded: (id: string | undefined) => boolean;
|
|
4
|
+
/** The packed outline font when it is already loaded, else null (and the load is started). */
|
|
5
|
+
export declare function outlineFontSync(id: string | undefined): any | null;
|
|
6
|
+
/** Loads (once) and caches a packed outline font. */
|
|
7
|
+
export declare function loadOutlineFont(id: string | undefined): Promise<any>;
|
|
8
|
+
export interface TextShapeOptions {
|
|
9
|
+
text?: string;
|
|
10
|
+
font?: string;
|
|
11
|
+
/** Em size in world units. */
|
|
12
|
+
size?: number;
|
|
13
|
+
/** Extrusion depth in world units. */
|
|
14
|
+
height?: number;
|
|
15
|
+
/** Extra advance between letters, in em. */
|
|
16
|
+
letterSpacing?: number;
|
|
17
|
+
bevelEnabled?: boolean;
|
|
18
|
+
bevelThickness?: number;
|
|
19
|
+
bevelSize?: number;
|
|
20
|
+
bevelSegments?: number;
|
|
21
|
+
}
|
|
22
|
+
/** The string as an extruded, centred geometry. `font` is a loaded packed outline font (outlineFontSync / loadOutlineFont). */
|
|
23
|
+
export declare function buildTextGeometry(font: any, o: TextShapeOptions): BufferGeometry;
|
|
24
|
+
//# sourceMappingURL=textShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textShape.d.ts","sourceRoot":"","sources":["../../src/utils/textShape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,OAAO,CAAC;AAgBrE,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAG/C,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,GAAG,SAAS,KAAG,OAAgC,CAAC;AAE9F,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,IAAI,CAMlE;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAUpE;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAqBD,+HAA+H;AAC/H,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAgChF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { BufferGeometry, ExtrudeGeometry, Path, Shape } from 'three';
|
|
2
|
+
import { layoutOutline } from '../components/text/engine/glyphs.js';
|
|
3
|
+
import { loadOutline, TEXT_FONT_IDS } from '../components/text/fonts/index.js';
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// Mesh text — the `text` shape of the mesh family: the string extruded into a solid, from the same packed
|
|
6
|
+
// outline fonts the text looks use (components/text/fonts), so one font list serves every text in 3drise.
|
|
7
|
+
//
|
|
8
|
+
// The outline fonts load lazily (one import() per font, a few hundred KB each). Shape generators are
|
|
9
|
+
// synchronous, so a font is read from this cache; the first build of a font yields an empty geometry and
|
|
10
|
+
// starts the load, and GeometryShape re-renders once it lands (useTextShapeFont).
|
|
11
|
+
// =============================================================================
|
|
12
|
+
const fonts = new Map();
|
|
13
|
+
const pending = new Map();
|
|
14
|
+
export const DEFAULT_TEXT_SHAPE_FONT = 'inter';
|
|
15
|
+
const fontId = (id) => (id && TEXT_FONT_IDS.includes(id) ? id : DEFAULT_TEXT_SHAPE_FONT);
|
|
16
|
+
export const isOutlineFontLoaded = (id) => fonts.has(fontId(id));
|
|
17
|
+
/** The packed outline font when it is already loaded, else null (and the load is started). */
|
|
18
|
+
export function outlineFontSync(id) {
|
|
19
|
+
const k = fontId(id);
|
|
20
|
+
const f = fonts.get(k);
|
|
21
|
+
if (f)
|
|
22
|
+
return f;
|
|
23
|
+
void loadOutlineFont(k);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
/** Loads (once) and caches a packed outline font. */
|
|
27
|
+
export function loadOutlineFont(id) {
|
|
28
|
+
const k = fontId(id);
|
|
29
|
+
const f = fonts.get(k);
|
|
30
|
+
if (f)
|
|
31
|
+
return Promise.resolve(f);
|
|
32
|
+
let p = pending.get(k);
|
|
33
|
+
if (!p) {
|
|
34
|
+
p = loadOutline(k).then((font) => { fonts.set(k, font); pending.delete(k); return font; });
|
|
35
|
+
pending.set(k, p);
|
|
36
|
+
}
|
|
37
|
+
return p;
|
|
38
|
+
}
|
|
39
|
+
// even-odd point in polygon (flat [x, y, ...] array)
|
|
40
|
+
function inside(px, py, p) {
|
|
41
|
+
let c = false;
|
|
42
|
+
const n = p.length / 2;
|
|
43
|
+
for (let i = 0, j = n - 1; i < n; j = i++) {
|
|
44
|
+
const xi = p[2 * i], yi = p[2 * i + 1], xj = p[2 * j], yj = p[2 * j + 1];
|
|
45
|
+
if (((yi > py) !== (yj > py)) && (px < ((xj - xi) * (py - yi)) / (yj - yi) + xi))
|
|
46
|
+
c = !c;
|
|
47
|
+
}
|
|
48
|
+
return c;
|
|
49
|
+
}
|
|
50
|
+
const pathOf = (pts, P, s) => {
|
|
51
|
+
// layoutOutline closes every contour by repeating its first point: drop it, Shape closes itself
|
|
52
|
+
const n = pts.length / 2 - 1;
|
|
53
|
+
P.moveTo(pts[0] * s, pts[1] * s);
|
|
54
|
+
for (let i = 1; i < n; i++)
|
|
55
|
+
P.lineTo(pts[2 * i] * s, pts[2 * i + 1] * s);
|
|
56
|
+
P.closePath();
|
|
57
|
+
return P;
|
|
58
|
+
};
|
|
59
|
+
/** The string as an extruded, centred geometry. `font` is a loaded packed outline font (outlineFontSync / loadOutlineFont). */
|
|
60
|
+
export function buildTextGeometry(font, o) {
|
|
61
|
+
const size = Math.max(1e-4, o.size ?? 1), depth = Math.max(1e-4, o.height ?? 0.2);
|
|
62
|
+
const text = String(o.text ?? 'Hello');
|
|
63
|
+
const layout = layoutOutline(font, text.length ? text : ' ', { align: 'center', letterSpacing: o.letterSpacing ?? 0 });
|
|
64
|
+
const shapes = [];
|
|
65
|
+
// contours come per glyph, outer first then counters (layoutOutline sorts them so); a counter belongs to the
|
|
66
|
+
// outer contour of its glyph that contains it
|
|
67
|
+
const byGlyph = new Map();
|
|
68
|
+
for (const s of layout.strokes) {
|
|
69
|
+
let g = byGlyph.get(s.glyph);
|
|
70
|
+
if (!g) {
|
|
71
|
+
g = { outers: [], holes: [] };
|
|
72
|
+
byGlyph.set(s.glyph, g);
|
|
73
|
+
}
|
|
74
|
+
if (s.hole)
|
|
75
|
+
g.holes.push(s.pts);
|
|
76
|
+
else {
|
|
77
|
+
const shape = pathOf(s.pts, new Shape(), size);
|
|
78
|
+
g.outers.push({ pts: s.pts, shape });
|
|
79
|
+
shapes.push(shape);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
for (const g of byGlyph.values()) {
|
|
83
|
+
if (!g.outers.length)
|
|
84
|
+
continue;
|
|
85
|
+
for (const h of g.holes) {
|
|
86
|
+
const owner = g.outers.find((oc) => inside(h[0], h[1], oc.pts.subarray(0, oc.pts.length - 2))) ?? g.outers[0];
|
|
87
|
+
owner.shape.holes.push(pathOf(h, new Path(), size));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!shapes.length)
|
|
91
|
+
return new BufferGeometry();
|
|
92
|
+
const bevel = !!o.bevelEnabled;
|
|
93
|
+
const geo = new ExtrudeGeometry(shapes, {
|
|
94
|
+
depth, curveSegments: 1, bevelEnabled: bevel,
|
|
95
|
+
bevelThickness: bevel ? Math.max(0, o.bevelThickness ?? 0.03) : 0,
|
|
96
|
+
bevelSize: bevel ? Math.max(0, o.bevelSize ?? 0.02) : 0,
|
|
97
|
+
bevelOffset: 0,
|
|
98
|
+
bevelSegments: bevel ? Math.max(1, Math.round(o.bevelSegments ?? 3)) : 1,
|
|
99
|
+
});
|
|
100
|
+
geo.center();
|
|
101
|
+
return geo;
|
|
102
|
+
}
|