@3driseai/3drise-viewer 0.1.28 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
- package/dist/animationsV2/ClipPlayer.js +13 -9
- package/dist/animationsV2/ClipsRuntime.d.ts +44 -3
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +173 -55
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +21 -5
- package/dist/animationsV2/index.d.ts +1 -1
- package/dist/animationsV2/index.d.ts.map +1 -1
- package/dist/animationsV2/normalize.d.ts.map +1 -1
- package/dist/animationsV2/normalize.js +7 -3
- package/dist/animationsV2/sequenceUtils.d.ts +44 -6
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +58 -12
- package/dist/animationsV2/types.d.ts +22 -12
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.d.ts +35 -1
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +88 -17
- package/dist/components/AdvancedGrid.d.ts +1 -5
- package/dist/components/AdvancedGrid.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.js +6 -35
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +9 -4
- package/dist/components/ApollonianGrid.d.ts +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/EnvironmentObject.d.ts.map +1 -1
- package/dist/components/EnvironmentObject.js +9 -7
- package/dist/components/FlowNetGrid.d.ts +1 -1
- package/dist/components/FlowNetGrid.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.js +6 -34
- package/dist/components/FractalGrid.d.ts +1 -1
- package/dist/components/FractalGrid.d.ts.map +1 -1
- package/dist/components/FractalGrid.js +6 -37
- package/dist/components/Galaxy.d.ts.map +1 -1
- package/dist/components/Galaxy.js +9 -23
- package/dist/components/GirihGrid.d.ts +1 -1
- package/dist/components/GirihGrid.d.ts.map +1 -1
- package/dist/components/GirihGrid.js +6 -35
- package/dist/components/GravWaveGrid.d.ts +1 -1
- package/dist/components/GravWaveGrid.d.ts.map +1 -1
- package/dist/components/GravWaveGrid.js +6 -35
- package/dist/components/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 +15 -4
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +7 -5
- package/dist/components/OceanBuilder.d.ts.map +1 -1
- package/dist/components/OceanBuilder.js +2 -0
- package/dist/components/ParastichyGrid.d.ts +1 -1
- package/dist/components/ParastichyGrid.d.ts.map +1 -1
- package/dist/components/ParastichyGrid.js +3 -30
- 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/ProjectLoader.d.ts +5 -3
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +6 -3
- package/dist/components/QuasiGrid.d.ts +1 -1
- package/dist/components/QuasiGrid.d.ts.map +1 -1
- package/dist/components/QuasiGrid.js +6 -33
- package/dist/components/RadarGrid.d.ts +1 -1
- package/dist/components/RadarGrid.d.ts.map +1 -1
- package/dist/components/RadarGrid.js +6 -34
- package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
- package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
- package/dist/components/ReactionDiffusionGrid.js +6 -35
- package/dist/components/SceneBuilder.d.ts +25 -3
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +68 -38
- package/dist/components/SkyController.d.ts +25 -1
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +189 -130
- package/dist/components/SkyMesh.d.ts.map +1 -1
- package/dist/components/SkyMesh.js +26 -1
- package/dist/components/SkyStars.d.ts +11 -0
- package/dist/components/SkyStars.d.ts.map +1 -0
- package/dist/components/SkyStars.js +187 -0
- package/dist/components/SkySystem.d.ts +3 -3
- package/dist/components/SkySystem.d.ts.map +1 -1
- package/dist/components/SkySystem.js +8 -2
- package/dist/components/Sun.d.ts +15 -1
- package/dist/components/Sun.d.ts.map +1 -1
- package/dist/components/Sun.js +64 -3
- package/dist/components/SunLight.d.ts +6 -1
- package/dist/components/SunLight.d.ts.map +1 -1
- package/dist/components/SunLight.js +96 -44
- package/dist/components/TerrainBuilder.d.ts.map +1 -1
- package/dist/components/TerrainBuilder.js +2 -0
- package/dist/components/TextGenerator.d.ts +9 -0
- package/dist/components/TextGenerator.d.ts.map +1 -0
- package/dist/components/TextGenerator.js +29 -0
- package/dist/components/TruchetGrid.d.ts +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 +10 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -6
- package/dist/components/land/LandPatch.d.ts +15 -0
- package/dist/components/land/LandPatch.d.ts.map +1 -0
- package/dist/components/land/LandPatch.js +170 -0
- package/dist/components/land/index.d.ts +3 -0
- package/dist/components/land/index.d.ts.map +1 -0
- package/dist/components/land/index.js +1 -0
- package/dist/components/space/Earth.d.ts +16 -0
- package/dist/components/space/Earth.d.ts.map +1 -0
- package/dist/components/space/Earth.js +75 -0
- package/dist/components/space/ShootingStar.d.ts +21 -0
- package/dist/components/space/ShootingStar.d.ts.map +1 -0
- package/dist/components/space/ShootingStar.js +101 -0
- package/dist/components/space/ShootingStars.d.ts +16 -0
- package/dist/components/space/ShootingStars.d.ts.map +1 -0
- package/dist/components/space/ShootingStars.js +71 -0
- package/dist/components/space/SolarSystem.d.ts +16 -0
- package/dist/components/space/SolarSystem.d.ts.map +1 -0
- package/dist/components/space/SolarSystem.js +141 -0
- package/dist/components/space/Stars.d.ts +20 -0
- package/dist/components/space/Stars.d.ts.map +1 -0
- package/dist/components/space/Stars.js +160 -0
- package/dist/components/space/index.d.ts +11 -0
- package/dist/components/space/index.d.ts.map +1 -0
- package/dist/components/space/index.js +8 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +27 -3
- package/dist/components/terrain/types.d.ts +5 -1
- package/dist/components/terrain/types.d.ts.map +1 -1
- package/dist/components/text/BurnAwayText.d.ts +15 -0
- package/dist/components/text/BurnAwayText.d.ts.map +1 -0
- package/dist/components/text/BurnAwayText.js +4 -0
- package/dist/components/text/ChalkboardText.d.ts +15 -0
- package/dist/components/text/ChalkboardText.d.ts.map +1 -0
- package/dist/components/text/ChalkboardText.js +4 -0
- package/dist/components/text/ConstellationText.d.ts +15 -0
- package/dist/components/text/ConstellationText.d.ts.map +1 -0
- package/dist/components/text/ConstellationText.js +4 -0
- package/dist/components/text/EmbroideryText.d.ts +15 -0
- package/dist/components/text/EmbroideryText.d.ts.map +1 -0
- package/dist/components/text/EmbroideryText.js +4 -0
- package/dist/components/text/FourierSketchText.d.ts +15 -0
- package/dist/components/text/FourierSketchText.d.ts.map +1 -0
- package/dist/components/text/FourierSketchText.js +4 -0
- package/dist/components/text/FrostGrowthText.d.ts +15 -0
- package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
- package/dist/components/text/FrostGrowthText.js +4 -0
- package/dist/components/text/HandwritingText.d.ts +15 -0
- package/dist/components/text/HandwritingText.d.ts.map +1 -0
- package/dist/components/text/HandwritingText.js +4 -0
- package/dist/components/text/InkBleedText.d.ts +15 -0
- package/dist/components/text/InkBleedText.d.ts.map +1 -0
- package/dist/components/text/InkBleedText.js +4 -0
- package/dist/components/text/LightPaintingText.d.ts +15 -0
- package/dist/components/text/LightPaintingText.d.ts.map +1 -0
- package/dist/components/text/LightPaintingText.js +4 -0
- package/dist/components/text/LiquidMetalText.d.ts +15 -0
- package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
- package/dist/components/text/LiquidMetalText.js +4 -0
- package/dist/components/text/NeonTubeText.d.ts +15 -0
- package/dist/components/text/NeonTubeText.d.ts.map +1 -0
- package/dist/components/text/NeonTubeText.js +4 -0
- package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
- package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
- package/dist/components/text/PlasmaDischargeText.js +4 -0
- package/dist/components/text/TextObjectView.d.ts +12 -0
- package/dist/components/text/TextObjectView.d.ts.map +1 -0
- package/dist/components/text/TextObjectView.js +11 -0
- package/dist/components/text/engine/fieldkit.d.ts +24 -0
- package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
- package/dist/components/text/engine/fieldkit.js +201 -0
- package/dist/components/text/engine/glyphs.d.ts +19 -0
- package/dist/components/text/engine/glyphs.d.ts.map +1 -0
- package/dist/components/text/engine/glyphs.js +269 -0
- package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
- package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
- package/dist/components/text/engine/looks/burnAway.js +593 -0
- package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
- package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
- package/dist/components/text/engine/looks/chalkboard.js +426 -0
- package/dist/components/text/engine/looks/constellation.d.ts +111 -0
- package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
- package/dist/components/text/engine/looks/constellation.js +496 -0
- package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
- package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
- package/dist/components/text/engine/looks/embroidery.js +645 -0
- package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
- package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
- package/dist/components/text/engine/looks/frostGrowth.js +727 -0
- package/dist/components/text/engine/looks/index.d.ts +2 -0
- package/dist/components/text/engine/looks/index.d.ts.map +1 -0
- package/dist/components/text/engine/looks/index.js +48 -0
- package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
- package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
- package/dist/components/text/engine/looks/inkBleed.js +590 -0
- package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
- package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
- package/dist/components/text/engine/looks/lightPainting.js +567 -0
- package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
- package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
- package/dist/components/text/engine/looks/liquidMetal.js +655 -0
- package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
- package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
- package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
- package/dist/components/text/engine/methods.d.ts +19 -0
- package/dist/components/text/engine/methods.d.ts.map +1 -0
- package/dist/components/text/engine/methods.js +126 -0
- package/dist/components/text/engine/playback.d.ts +40 -0
- package/dist/components/text/engine/playback.d.ts.map +1 -0
- package/dist/components/text/engine/playback.js +114 -0
- package/dist/components/text/engine/ribbon.d.ts +58 -0
- package/dist/components/text/engine/ribbon.d.ts.map +1 -0
- package/dist/components/text/engine/ribbon.js +250 -0
- package/dist/components/text/engine/variants.d.ts +159 -0
- package/dist/components/text/engine/variants.d.ts.map +1 -0
- package/dist/components/text/engine/variants.js +378 -0
- package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
- package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
- package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
- package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
- package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
- package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/caveat.outline.js +4 -0
- package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
- package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/caveat.strokes.js +4 -0
- package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
- package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/courgette.outline.js +4 -0
- package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
- package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/courgette.strokes.js +4 -0
- package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/dancing-script.outline.js +4 -0
- package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
- package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
- package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
- package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
- package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
- package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
- package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/handlee.outline.js +4 -0
- package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
- package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/handlee.strokes.js +4 -0
- package/dist/components/text/fonts/index.d.ts +5 -0
- package/dist/components/text/fonts/index.d.ts.map +1 -0
- package/dist/components/text/fonts/index.js +44 -0
- package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
- package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/indie-flower.outline.js +4 -0
- package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
- package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
- package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
- package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/kalam.outline.js +4 -0
- package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
- package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/kalam.strokes.js +4 -0
- package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
- package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
- package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
- package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/mynerve.outline.js +4 -0
- package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
- package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/mynerve.strokes.js +4 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
- package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
- package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/pacifico.outline.js +4 -0
- package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
- package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/pacifico.strokes.js +4 -0
- package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
- package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
- package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
- package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
- package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
- package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/poppins.outline.js +4 -0
- package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
- package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/poppins.strokes.js +4 -0
- package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
- package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/satisfy.outline.js +4 -0
- package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
- package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/satisfy.strokes.js +4 -0
- package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
- package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/sriracha.outline.js +4 -0
- package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
- package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/sriracha.strokes.js +4 -0
- package/dist/components/text/index.d.ts +27 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +13 -0
- package/dist/components/text/useTextObject.d.ts +21 -0
- package/dist/components/text/useTextObject.d.ts.map +1 -0
- package/dist/components/text/useTextObject.js +118 -0
- package/dist/components/water/OceanSurface.d.ts.map +1 -1
- package/dist/components/water/OceanSurface.js +3 -1
- package/dist/components/water/WaterBody.d.ts.map +1 -1
- package/dist/components/water/WaterBody.js +3 -1
- package/dist/components/water/types.d.ts +5 -1
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -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 +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/operations/catalogue/blastOff.d.ts +3 -0
- package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
- package/dist/operations/catalogue/blastOff.js +118 -0
- package/dist/operations/catalogue/bounce.d.ts +3 -0
- package/dist/operations/catalogue/bounce.d.ts.map +1 -0
- package/dist/operations/catalogue/bounce.js +34 -0
- package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
- package/dist/operations/catalogue/curlSmoke.js +3 -1
- package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
- package/dist/operations/catalogue/dissolve.js +2 -1
- package/dist/operations/catalogue/driftUp.d.ts +3 -0
- package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
- package/dist/operations/catalogue/driftUp.js +57 -0
- package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
- package/dist/operations/catalogue/emberAsh.js +2 -1
- package/dist/operations/catalogue/flip.d.ts.map +1 -1
- package/dist/operations/catalogue/flip.js +19 -9
- package/dist/operations/catalogue/float.d.ts +3 -0
- package/dist/operations/catalogue/float.d.ts.map +1 -0
- package/dist/operations/catalogue/float.js +39 -0
- package/dist/operations/catalogue/flyBy.d.ts +3 -0
- package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
- package/dist/operations/catalogue/flyBy.js +79 -0
- package/dist/operations/catalogue/frost.d.ts.map +1 -1
- package/dist/operations/catalogue/frost.js +10 -3
- package/dist/operations/catalogue/grow.d.ts +3 -0
- package/dist/operations/catalogue/grow.d.ts.map +1 -0
- package/dist/operations/catalogue/grow.js +19 -0
- package/dist/operations/catalogue/hologram.d.ts.map +1 -1
- package/dist/operations/catalogue/hologram.js +11 -5
- package/dist/operations/catalogue/jelly.d.ts.map +1 -1
- package/dist/operations/catalogue/jelly.js +18 -8
- package/dist/operations/catalogue/knockAway.d.ts +3 -0
- package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
- package/dist/operations/catalogue/knockAway.js +74 -0
- package/dist/operations/catalogue/leafFall.d.ts +3 -0
- package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
- package/dist/operations/catalogue/leafFall.js +74 -0
- package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
- package/dist/operations/catalogue/lidarScan.js +4 -1
- package/dist/operations/catalogue/metalize.d.ts.map +1 -1
- package/dist/operations/catalogue/metalize.js +8 -2
- package/dist/operations/catalogue/motionTrail.d.ts +6 -0
- package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
- package/dist/operations/catalogue/motionTrail.js +221 -0
- package/dist/operations/catalogue/petrify.d.ts.map +1 -1
- package/dist/operations/catalogue/petrify.js +9 -3
- package/dist/operations/catalogue/physicalExit.d.ts +55 -0
- package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalExit.js +165 -0
- package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
- package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalHeld.js +78 -0
- package/dist/operations/catalogue/physicalMix.d.ts +45 -0
- package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalMix.js +144 -0
- package/dist/operations/catalogue/pop.d.ts +3 -0
- package/dist/operations/catalogue/pop.d.ts.map +1 -0
- package/dist/operations/catalogue/pop.js +44 -0
- package/dist/operations/catalogue/print3d.d.ts.map +1 -1
- package/dist/operations/catalogue/print3d.js +5 -1
- package/dist/operations/catalogue/pulse.d.ts +3 -0
- package/dist/operations/catalogue/pulse.d.ts.map +1 -0
- package/dist/operations/catalogue/pulse.js +29 -0
- package/dist/operations/catalogue/restPose.d.ts +5 -7
- package/dist/operations/catalogue/restPose.d.ts.map +1 -1
- package/dist/operations/catalogue/restPose.js +18 -48
- package/dist/operations/catalogue/rotate.d.ts +3 -0
- package/dist/operations/catalogue/rotate.d.ts.map +1 -0
- package/dist/operations/catalogue/rotate.js +49 -0
- package/dist/operations/catalogue/shake.d.ts +3 -0
- package/dist/operations/catalogue/shake.d.ts.map +1 -0
- package/dist/operations/catalogue/shake.js +31 -0
- package/dist/operations/catalogue/shatter.d.ts.map +1 -1
- package/dist/operations/catalogue/shatter.js +5 -1
- package/dist/operations/catalogue/slam.d.ts +3 -0
- package/dist/operations/catalogue/slam.d.ts.map +1 -0
- package/dist/operations/catalogue/slam.js +89 -0
- package/dist/operations/catalogue/slingshot.d.ts +3 -0
- package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
- package/dist/operations/catalogue/slingshot.js +88 -0
- package/dist/operations/catalogue/spin.d.ts.map +1 -1
- package/dist/operations/catalogue/spin.js +24 -13
- package/dist/operations/catalogue/sway.d.ts +3 -0
- package/dist/operations/catalogue/sway.d.ts.map +1 -0
- package/dist/operations/catalogue/sway.js +23 -0
- package/dist/operations/catalogue/swirl.d.ts.map +1 -1
- package/dist/operations/catalogue/swirl.js +6 -5
- package/dist/operations/catalogue/trailCore.d.ts +89 -0
- package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
- package/dist/operations/catalogue/trailCore.js +190 -0
- package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
- package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
- package/dist/operations/catalogue/trailGhosts.js +179 -0
- package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
- package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStampStyles.js +479 -0
- package/dist/operations/catalogue/trailStamps.d.ts +57 -0
- package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStamps.js +349 -0
- package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
- package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStreaks.js +147 -0
- package/dist/operations/catalogue/transitionField.d.ts +30 -0
- package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
- package/dist/operations/catalogue/transitionField.js +21 -0
- package/dist/operations/catalogue/turnAway.d.ts +3 -0
- package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
- package/dist/operations/catalogue/turnAway.js +54 -0
- package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
- package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
- package/dist/operations/catalogue/vortexDrain.js +68 -0
- package/dist/operations/catalogue/warp.d.ts +3 -0
- package/dist/operations/catalogue/warp.d.ts.map +1 -0
- package/dist/operations/catalogue/warp.js +73 -0
- package/dist/operations/catalogue/whoosh.d.ts +3 -0
- package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
- package/dist/operations/catalogue/whoosh.js +84 -0
- package/dist/operations/catalogue/wobble.d.ts +3 -0
- package/dist/operations/catalogue/wobble.d.ts.map +1 -0
- package/dist/operations/catalogue/wobble.js +23 -0
- package/dist/operations/clipPreview.d.ts +3 -0
- package/dist/operations/clipPreview.d.ts.map +1 -0
- package/dist/operations/clipPreview.js +20 -0
- package/dist/operations/groupFanout.d.ts +96 -0
- package/dist/operations/groupFanout.d.ts.map +1 -0
- package/dist/operations/groupFanout.js +365 -0
- package/dist/operations/groups.d.ts +20 -0
- package/dist/operations/groups.d.ts.map +1 -0
- package/dist/operations/groups.js +66 -0
- package/dist/operations/index.d.ts +5 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +5 -2
- package/dist/operations/objectEffects.d.ts +161 -6
- package/dist/operations/objectEffects.d.ts.map +1 -1
- package/dist/operations/objectEffects.js +1091 -17
- package/dist/operations/registry.d.ts.map +1 -1
- package/dist/operations/registry.js +24 -2
- package/dist/operations/runtime.d.ts +57 -2
- package/dist/operations/runtime.d.ts.map +1 -1
- package/dist/operations/runtime.js +161 -18
- package/dist/operations/types.d.ts +60 -3
- package/dist/operations/types.d.ts.map +1 -1
- package/dist/operations/types.js +5 -1
- package/dist/operations/useObjectEffectLayers.d.ts +2 -2
- package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
- package/dist/operations/useObjectEffectLayers.js +31 -10
- package/dist/operations/usePresentedVisibility.d.ts +10 -0
- package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
- package/dist/operations/usePresentedVisibility.js +53 -0
- package/dist/presets/terrainBiomes.d.ts +67 -0
- package/dist/presets/terrainBiomes.d.ts.map +1 -0
- package/dist/presets/terrainBiomes.js +294 -0
- package/dist/presets/terrainPresets.d.ts +6 -0
- package/dist/presets/terrainPresets.d.ts.map +1 -1
- package/dist/presets/terrainPresets.js +26 -38
- package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
- package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
- package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
- package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
- package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
- package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
- package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
- package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
- package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
- package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
- package/dist/shaders/terrain/TerrainMaterial.js +107 -8
- package/dist/triggers/engine.d.ts +44 -0
- package/dist/triggers/engine.d.ts.map +1 -0
- package/dist/triggers/engine.js +165 -0
- package/dist/triggers/hosts/actions.d.ts +8 -0
- package/dist/triggers/hosts/actions.d.ts.map +1 -0
- package/dist/triggers/hosts/actions.js +22 -0
- package/dist/triggers/hosts/interactions.d.ts +6 -0
- package/dist/triggers/hosts/interactions.d.ts.map +1 -0
- package/dist/triggers/hosts/interactions.js +4 -0
- package/dist/triggers/hosts/timelineCues.d.ts +2 -0
- package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
- package/dist/triggers/hosts/timelineCues.js +22 -0
- package/dist/triggers/index.d.ts +13 -0
- package/dist/triggers/index.d.ts.map +1 -0
- package/dist/triggers/index.js +9 -0
- package/dist/triggers/kinds/action.d.ts +2 -0
- package/dist/triggers/kinds/action.d.ts.map +1 -0
- package/dist/triggers/kinds/action.js +31 -0
- package/dist/triggers/kinds/animations.d.ts +2 -0
- package/dist/triggers/kinds/animations.d.ts.map +1 -0
- package/dist/triggers/kinds/animations.js +75 -0
- package/dist/triggers/kinds/effects.d.ts +2 -0
- package/dist/triggers/kinds/effects.d.ts.map +1 -0
- package/dist/triggers/kinds/effects.js +27 -0
- package/dist/triggers/kinds/index.d.ts +4 -0
- package/dist/triggers/kinds/index.d.ts.map +1 -0
- package/dist/triggers/kinds/index.js +4 -0
- package/dist/triggers/log.d.ts +21 -0
- package/dist/triggers/log.d.ts.map +1 -0
- package/dist/triggers/log.js +43 -0
- package/dist/triggers/readiness.d.ts +40 -0
- package/dist/triggers/readiness.d.ts.map +1 -0
- package/dist/triggers/readiness.js +158 -0
- package/dist/triggers/registry.d.ts +41 -0
- package/dist/triggers/registry.d.ts.map +1 -0
- package/dist/triggers/registry.js +7 -0
- package/dist/types/gridConfigs.d.ts +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/renderedSky.d.ts +32 -0
- package/dist/utils/renderedSky.d.ts.map +1 -0
- package/dist/utils/renderedSky.js +57 -0
- package/dist/utils/skyMoon.d.ts +35 -0
- package/dist/utils/skyMoon.d.ts.map +1 -0
- package/dist/utils/skyMoon.js +41 -0
- package/dist/utils/terrainHeight.d.ts +4 -0
- package/dist/utils/terrainHeight.d.ts.map +1 -0
- package/dist/utils/terrainHeight.js +150 -0
- package/dist/utils/terrainTextureResolver.d.ts +18 -0
- package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
- package/dist/utils/terrainTextureResolver.js +17 -0
- package/dist/utils/terrainUniforms.d.ts +17 -0
- package/dist/utils/terrainUniforms.d.ts.map +1 -1
- package/dist/utils/terrainUniforms.js +84 -0
- package/dist/utils/textureArrays.d.ts +29 -0
- package/dist/utils/textureArrays.d.ts.map +1 -0
- package/dist/utils/textureArrays.js +140 -0
- package/package.json +2 -2
|
@@ -22,7 +22,7 @@ function pose(target, st, p) {
|
|
|
22
22
|
const q = new Quaternion().setFromAxisAngle(UP, dir * turns * 2 * Math.PI * 1.6 * t * t);
|
|
23
23
|
const k = 1 - smoothstep(0.3, 1, t);
|
|
24
24
|
const s = new Vector3(1, 1, 1).multiplyScalar(Math.max(k, 1e-4));
|
|
25
|
-
poseAbout(target, r, r.centerLocal, q, s, off);
|
|
25
|
+
poseAbout(target, r, r.centerLocal, q, s, off, KEY);
|
|
26
26
|
}
|
|
27
27
|
const smoothstep = (a, b, x) => { const v = Math.min(1, Math.max(0, (x - a) / (b - a))); return v * v * (3 - 2 * v); };
|
|
28
28
|
export default defineOperation({
|
|
@@ -32,7 +32,8 @@ export default defineOperation({
|
|
|
32
32
|
channel: 'transform',
|
|
33
33
|
multi: true,
|
|
34
34
|
toggles: true,
|
|
35
|
-
usableIn: ['interaction', 'action'],
|
|
35
|
+
usableIn: ['interaction', 'action', 'object'],
|
|
36
|
+
presence: 'vanish',
|
|
36
37
|
params: {
|
|
37
38
|
turns: { type: 'number', label: 'Turns', default: 1.5, min: 0.5, max: 6, step: 0.25 },
|
|
38
39
|
radius: { type: 'number', label: 'Radius', default: 0.6, min: 0, max: 3, step: 0.05, hint: 'A fraction of the object’s width' },
|
|
@@ -43,7 +44,7 @@ export default defineOperation({
|
|
|
43
44
|
apply(target, p) {
|
|
44
45
|
let st = target.userData[KEY];
|
|
45
46
|
if (!st) {
|
|
46
|
-
st = { rest: acquireRest(target), proxy: { t: 0 }, visible: target.visible };
|
|
47
|
+
st = { rest: acquireRest(target, KEY), proxy: { t: 0 }, visible: target.visible };
|
|
47
48
|
target.userData[KEY] = st;
|
|
48
49
|
}
|
|
49
50
|
const s = st;
|
|
@@ -58,12 +59,12 @@ export default defineOperation({
|
|
|
58
59
|
const s = target.userData[KEY];
|
|
59
60
|
if (!s)
|
|
60
61
|
return;
|
|
61
|
-
target.visible =
|
|
62
|
+
target.visible = true; // it comes back shown (it may have been made while the object was hidden)
|
|
62
63
|
gsap.killTweensOf(s.proxy);
|
|
63
64
|
gsap.to(s.proxy, {
|
|
64
65
|
t: 0, duration: Number(p.duration), ease: 'power2.out',
|
|
65
66
|
onUpdate: () => pose(target, s, p),
|
|
66
|
-
onComplete: () => { delete target.userData[KEY]; releaseRest(target); },
|
|
67
|
+
onComplete: () => { delete target.userData[KEY]; releaseRest(target, KEY); },
|
|
67
68
|
});
|
|
68
69
|
},
|
|
69
70
|
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Color, Group, Matrix4, Quaternion, Vector3 } from 'three';
|
|
2
|
+
import type { Object3D } from 'three';
|
|
3
|
+
export declare const CAP = 480;
|
|
4
|
+
export interface Sample {
|
|
5
|
+
t: number;
|
|
6
|
+
p: Vector3;
|
|
7
|
+
q: Quaternion;
|
|
8
|
+
s: Vector3;
|
|
9
|
+
}
|
|
10
|
+
export interface TrailParams {
|
|
11
|
+
style: string;
|
|
12
|
+
length: number;
|
|
13
|
+
amount: number;
|
|
14
|
+
size: number;
|
|
15
|
+
opacity: number;
|
|
16
|
+
/** The style's colours (linear), from its own settings — see each style for what they colour. */
|
|
17
|
+
color: Color;
|
|
18
|
+
color2: Color;
|
|
19
|
+
color3: Color;
|
|
20
|
+
}
|
|
21
|
+
export interface TrailCtx {
|
|
22
|
+
target: Object3D;
|
|
23
|
+
group: Group;
|
|
24
|
+
env: {
|
|
25
|
+
v: number;
|
|
26
|
+
};
|
|
27
|
+
p: TrailParams;
|
|
28
|
+
/** Bounding diameter of the object (world), and the floor under it (world y of its base). */
|
|
29
|
+
span: number;
|
|
30
|
+
floor: number;
|
|
31
|
+
hist: Sample[];
|
|
32
|
+
head: number;
|
|
33
|
+
count: number;
|
|
34
|
+
now: number;
|
|
35
|
+
dt: number;
|
|
36
|
+
vel: Vector3;
|
|
37
|
+
acc: Vector3;
|
|
38
|
+
speed: number;
|
|
39
|
+
world: Matrix4;
|
|
40
|
+
cam: Vector3 | null;
|
|
41
|
+
/** Called by the core when the history restarts (a teleport): simulations reset too. */
|
|
42
|
+
onReset?: () => void;
|
|
43
|
+
}
|
|
44
|
+
export interface TrailStyle {
|
|
45
|
+
/** Build meshes into ctx.group (compiled before shown by the caller). */
|
|
46
|
+
build(ctx: TrailCtx): void;
|
|
47
|
+
/** Every frame, after the history has the new sample. */
|
|
48
|
+
update(ctx: TrailCtx): void;
|
|
49
|
+
/** Particles still in flight — switching off waits for them to finish (never cut mid-air). */
|
|
50
|
+
alive?(ctx: TrailCtx): boolean;
|
|
51
|
+
/** Free what build made (geometries, materials) — the group itself is removed by the caller. */
|
|
52
|
+
dispose?(ctx: TrailCtx): void;
|
|
53
|
+
}
|
|
54
|
+
export declare const smooth: (a: number, b: number, x: number) => number;
|
|
55
|
+
export declare const clamp01: (x: number) => number;
|
|
56
|
+
export declare function newHistory(): Sample[];
|
|
57
|
+
/** Sample the object now; a jump of more than two sizes in one frame restarts the history. */
|
|
58
|
+
export declare function record(ctx: TrailCtx, now: number): void;
|
|
59
|
+
/** The pose `ago` seconds back (interpolated); false when the history does not reach that far. */
|
|
60
|
+
export declare function poseAgo(ctx: TrailCtx, ago: number, out: Sample): boolean;
|
|
61
|
+
/** How far a past pose is from the pose now, in object sizes (position + turn + scale). */
|
|
62
|
+
export declare function awayFromNow(ctx: TrailCtx, s: Sample): number;
|
|
63
|
+
export declare function cameraPos(out: Vector3): Vector3 | null;
|
|
64
|
+
export interface SurfacePts {
|
|
65
|
+
pos: Float32Array;
|
|
66
|
+
nrm: Float32Array;
|
|
67
|
+
col: Float32Array;
|
|
68
|
+
n: number;
|
|
69
|
+
}
|
|
70
|
+
export declare function surfaceOf(target: Object3D, count: number, seed: number): SurfacePts;
|
|
71
|
+
/** `k` points spread over the surface (farthest-point picks), root-local. */
|
|
72
|
+
export declare function spreadPoints(target: Object3D, k: number, seed?: number): Vector3[];
|
|
73
|
+
/** Bounding diameter (world) and the world y of the object's base. */
|
|
74
|
+
export declare function measure(target: Object3D): {
|
|
75
|
+
span: number;
|
|
76
|
+
floor: number;
|
|
77
|
+
};
|
|
78
|
+
/** Smooth value noise in [−1, 1]. */
|
|
79
|
+
export declare function vnoise(x: number, y: number, z: number): number;
|
|
80
|
+
/** Divergence-free (curl) flow at a point — swirls without sinks or sources. */
|
|
81
|
+
export declare function curl(x: number, y: number, z: number, out: Vector3): Vector3;
|
|
82
|
+
/**
|
|
83
|
+
* Blackbody-like ramp for a cooling spark, linear RGB: 1 = white-hot, 0.6 yellow,
|
|
84
|
+
* 0.35 orange, 0.15 deep red, 0 = gone.
|
|
85
|
+
*/
|
|
86
|
+
export declare function blackbody(t: number, out: Color): Color;
|
|
87
|
+
/** GLSL: anti-aliased edge — 1 inside, 0 outside, a one-pixel ramp (fragment only). */
|
|
88
|
+
export declare const GLSL_AA = "\nfloat trlAA(float d) { float w = fwidth(d); return clamp(0.5 - d / max(w, 1e-5), 0.0, 1.0); }";
|
|
89
|
+
//# sourceMappingURL=trailCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trailCore.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/trailCore.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC,eAAO,MAAM,GAAG,MAAM,CAAC;AAEvB,MAAM,WAAW,MAAM;IAAG,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,OAAO,CAAC;IAAC,CAAC,EAAE,UAAU,CAAC;IAAC,CAAC,EAAE,OAAO,CAAA;CAAE;AAE5E,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,iGAAiG;IACjG,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACrB,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnB,CAAC,EAAE,WAAW,CAAC;IACf,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IAEX,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACvB,yEAAyE;IACzE,KAAK,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,yDAAyD;IACzD,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC5B,8FAA8F;IAC9F,KAAK,CAAC,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC/B,gGAAgG;IAChG,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,WAA2F,CAAC;AAClJ,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,WAAgC,CAAC;AAMlE,wBAAgB,UAAU,IAAI,MAAM,EAAE,CAErC;AAED,8FAA8F;AAC9F,wBAAgB,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,QA2BhD;AAED,kGAAkG;AAClG,wBAAgB,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAkBxE;AAED,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,UAGnD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAKtD;AAID,MAAM,WAAW,UAAU;IAAG,GAAG,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,YAAY,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE;AAElG,wBAAgB,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAGnF;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,OAAO,EAAE,CAkB9E;AAED,sEAAsE;AACtE,wBAAgB,OAAO,CAAC,MAAM,EAAE,QAAQ;;;EAkBvC;AASD,qCAAqC;AACrC,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAQrD;AACD,gFAAgF;AAChF,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,WASjE;AAID;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,SAM9C;AAED,uFAAuF;AACvF,eAAO,MAAM,OAAO,oGAC0E,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// Motion trail — the shared core every trail style is built on (see motionTrail.ts).
|
|
2
|
+
//
|
|
3
|
+
// history the object's world pose, sampled every frame on gsap's clock, with
|
|
4
|
+
// interpolated look-ups back in time (poseAgo)
|
|
5
|
+
// motion smoothed velocity and acceleration of the object (world units / s)
|
|
6
|
+
// surface surface samples of the object (root-local position, normal, colour)
|
|
7
|
+
// camera where the camera is (for camera-facing ribbons and lines)
|
|
8
|
+
// helpers curl noise, blackbody ramp, farthest-point picks, smoothstep
|
|
9
|
+
//
|
|
10
|
+
// A style gets a TrailCtx: it builds its meshes into ctx.group (which lives in the
|
|
11
|
+
// SCENE, not under the object — the trail outlives an exit that hides the object)
|
|
12
|
+
// and updates them every frame. ctx.env (0…1) is the effect's on / off envelope.
|
|
13
|
+
import { Quaternion, Vector3 } from 'three';
|
|
14
|
+
import { sampleSurfaceCached } from './surfaceSample.js';
|
|
15
|
+
import cameraManager from '../../utils/CameraSingleton.js';
|
|
16
|
+
export const CAP = 480; // history samples kept (~8 s at 60 fps)
|
|
17
|
+
export const smooth = (a, b, x) => { const v = Math.min(1, Math.max(0, (x - a) / (b - a))); return v * v * (3 - 2 * v); };
|
|
18
|
+
export const clamp01 = (x) => Math.min(1, Math.max(0, x));
|
|
19
|
+
// ---------------------------------------------------------------- history & motion
|
|
20
|
+
const _p = new Vector3(), _q = new Quaternion(), _s = new Vector3(), _v = new Vector3(), _dv = new Vector3();
|
|
21
|
+
export function newHistory() {
|
|
22
|
+
return Array.from({ length: CAP }, () => ({ t: 0, p: new Vector3(), q: new Quaternion(), s: new Vector3() }));
|
|
23
|
+
}
|
|
24
|
+
/** Sample the object now; a jump of more than two sizes in one frame restarts the history. */
|
|
25
|
+
export function record(ctx, now) {
|
|
26
|
+
const t = ctx.target;
|
|
27
|
+
t.updateWorldMatrix(true, false);
|
|
28
|
+
ctx.world.copy(t.matrixWorld);
|
|
29
|
+
ctx.world.decompose(_p, _q, _s);
|
|
30
|
+
const last = ctx.count ? ctx.hist[ctx.head] : null;
|
|
31
|
+
ctx.dt = last ? Math.max(0, now - last.t) : 0;
|
|
32
|
+
ctx.now = now;
|
|
33
|
+
if (last && last.p.distanceTo(_p) > 2 * ctx.span && ctx.dt < 0.12) {
|
|
34
|
+
ctx.count = 0;
|
|
35
|
+
ctx.vel.set(0, 0, 0);
|
|
36
|
+
ctx.acc.set(0, 0, 0);
|
|
37
|
+
ctx.speed = 0;
|
|
38
|
+
ctx.onReset?.();
|
|
39
|
+
}
|
|
40
|
+
else if (last && ctx.dt > 1e-5) {
|
|
41
|
+
// velocity and acceleration, smoothed over ~50 ms (frame-rate independent)
|
|
42
|
+
_v.subVectors(_p, last.p).divideScalar(ctx.dt);
|
|
43
|
+
const k = 1 - Math.exp(-ctx.dt / 0.05);
|
|
44
|
+
_dv.copy(ctx.vel);
|
|
45
|
+
ctx.vel.lerp(_v, k);
|
|
46
|
+
_dv.subVectors(ctx.vel, _dv).divideScalar(ctx.dt);
|
|
47
|
+
ctx.acc.lerp(_dv, 1 - Math.exp(-ctx.dt / 0.06));
|
|
48
|
+
ctx.speed = ctx.vel.length() / ctx.span;
|
|
49
|
+
}
|
|
50
|
+
if (last && ctx.dt <= 1e-5 && ctx.count)
|
|
51
|
+
return; // same instant (composed twice): keep one sample
|
|
52
|
+
ctx.head = (ctx.head + 1) % CAP;
|
|
53
|
+
const e = ctx.hist[ctx.head];
|
|
54
|
+
e.t = now;
|
|
55
|
+
e.p.copy(_p);
|
|
56
|
+
e.q.copy(_q);
|
|
57
|
+
e.s.copy(_s);
|
|
58
|
+
ctx.count = Math.min(CAP, ctx.count + 1);
|
|
59
|
+
}
|
|
60
|
+
/** The pose `ago` seconds back (interpolated); false when the history does not reach that far. */
|
|
61
|
+
export function poseAgo(ctx, ago, out) {
|
|
62
|
+
if (!ctx.count)
|
|
63
|
+
return false;
|
|
64
|
+
const now = ctx.hist[ctx.head].t, want = now - ago;
|
|
65
|
+
let i = ctx.head;
|
|
66
|
+
for (let k = 0; k < ctx.count - 1; k++) {
|
|
67
|
+
const prev = (i - 1 + CAP) % CAP;
|
|
68
|
+
const a = ctx.hist[prev], b = ctx.hist[i];
|
|
69
|
+
if (a.t <= want) {
|
|
70
|
+
const f = b.t > a.t ? (want - a.t) / (b.t - a.t) : 0;
|
|
71
|
+
out.p.lerpVectors(a.p, b.p, f);
|
|
72
|
+
out.q.slerpQuaternions(a.q, b.q, f);
|
|
73
|
+
out.s.lerpVectors(a.s, b.s, f);
|
|
74
|
+
out.t = want;
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
i = prev;
|
|
78
|
+
}
|
|
79
|
+
const o = ctx.hist[i];
|
|
80
|
+
out.p.copy(o.p);
|
|
81
|
+
out.q.copy(o.q);
|
|
82
|
+
out.s.copy(o.s);
|
|
83
|
+
out.t = o.t;
|
|
84
|
+
return ago <= 0;
|
|
85
|
+
}
|
|
86
|
+
/** How far a past pose is from the pose now, in object sizes (position + turn + scale). */
|
|
87
|
+
export function awayFromNow(ctx, s) {
|
|
88
|
+
const now = ctx.hist[ctx.head];
|
|
89
|
+
return s.p.distanceTo(now.p) / ctx.span + 1.4 * (1 - Math.abs(s.q.dot(now.q))) + Math.abs(s.s.x - now.s.x);
|
|
90
|
+
}
|
|
91
|
+
export function cameraPos(out) {
|
|
92
|
+
const cam = cameraManager.getCamera?.();
|
|
93
|
+
if (!cam)
|
|
94
|
+
return null;
|
|
95
|
+
cam.updateMatrixWorld();
|
|
96
|
+
return cam.getWorldPosition(out);
|
|
97
|
+
}
|
|
98
|
+
export function surfaceOf(target, count, seed) {
|
|
99
|
+
const s = sampleSurfaceCached(target, count, seed);
|
|
100
|
+
return { pos: s.position, nrm: s.normal, col: s.color, n: s.position.length / 3 };
|
|
101
|
+
}
|
|
102
|
+
/** `k` points spread over the surface (farthest-point picks), root-local. */
|
|
103
|
+
export function spreadPoints(target, k, seed = 11) {
|
|
104
|
+
const s = surfaceOf(target, 500, seed);
|
|
105
|
+
const pts = [];
|
|
106
|
+
if (!s.n)
|
|
107
|
+
return pts;
|
|
108
|
+
const at = (i) => new Vector3(s.pos[i * 3], s.pos[i * 3 + 1], s.pos[i * 3 + 2]);
|
|
109
|
+
pts.push(at(0));
|
|
110
|
+
const d = new Float32Array(s.n).fill(Infinity);
|
|
111
|
+
while (pts.length < Math.min(k, s.n)) {
|
|
112
|
+
const last = pts[pts.length - 1];
|
|
113
|
+
let best = -1, bi = 0;
|
|
114
|
+
for (let i = 0; i < s.n; i++) {
|
|
115
|
+
const v = at(i);
|
|
116
|
+
d[i] = Math.min(d[i], v.distanceToSquared(last));
|
|
117
|
+
if (d[i] > best) {
|
|
118
|
+
best = d[i];
|
|
119
|
+
bi = i;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
pts.push(at(bi));
|
|
123
|
+
}
|
|
124
|
+
return pts;
|
|
125
|
+
}
|
|
126
|
+
/** Bounding diameter (world) and the world y of the object's base. */
|
|
127
|
+
export function measure(target) {
|
|
128
|
+
target.updateWorldMatrix(true, true);
|
|
129
|
+
let r = 0, floor = Infinity;
|
|
130
|
+
const v = new Vector3();
|
|
131
|
+
target.traverse((c) => {
|
|
132
|
+
if (!c.isMesh || !c.geometry || c.userData?.__opFxHelper)
|
|
133
|
+
return;
|
|
134
|
+
const g = c.geometry;
|
|
135
|
+
if (!g.boundingSphere)
|
|
136
|
+
g.computeBoundingSphere();
|
|
137
|
+
if (!g.boundingBox)
|
|
138
|
+
g.computeBoundingBox();
|
|
139
|
+
const ws = new Vector3();
|
|
140
|
+
c.getWorldScale(ws);
|
|
141
|
+
r = Math.max(r, g.boundingSphere.radius * Math.max(ws.x, ws.y, ws.z));
|
|
142
|
+
const b = g.boundingBox;
|
|
143
|
+
for (let i = 0; i < 8; i++) {
|
|
144
|
+
v.set(i & 1 ? b.max.x : b.min.x, i & 2 ? b.max.y : b.min.y, i & 4 ? b.max.z : b.min.z).applyMatrix4(c.matrixWorld);
|
|
145
|
+
floor = Math.min(floor, v.y);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return { span: Math.max(2 * r, 1e-3), floor: Number.isFinite(floor) ? floor : 0 };
|
|
149
|
+
}
|
|
150
|
+
// ---------------------------------------------------------------- noise
|
|
151
|
+
function hash3(x, y, z) {
|
|
152
|
+
let h = (x * 374761393 + y * 668265263 + z * 2147483647) | 0;
|
|
153
|
+
h = (h ^ (h >>> 13)) * 1274126177;
|
|
154
|
+
return ((h ^ (h >>> 16)) >>> 0) / 4294967295;
|
|
155
|
+
}
|
|
156
|
+
/** Smooth value noise in [−1, 1]. */
|
|
157
|
+
export function vnoise(x, y, z) {
|
|
158
|
+
const xi = Math.floor(x), yi = Math.floor(y), zi = Math.floor(z);
|
|
159
|
+
const xf = x - xi, yf = y - yi, zf = z - zi;
|
|
160
|
+
const u = xf * xf * (3 - 2 * xf), v = yf * yf * (3 - 2 * yf), w = zf * zf * (3 - 2 * zf);
|
|
161
|
+
const l = (a, b, t) => a + (b - a) * t;
|
|
162
|
+
const c = (dx, dy, dz) => hash3(xi + dx, yi + dy, zi + dz);
|
|
163
|
+
return 2 * l(l(l(c(0, 0, 0), c(1, 0, 0), u), l(c(0, 1, 0), c(1, 1, 0), u), v), l(l(c(0, 0, 1), c(1, 0, 1), u), l(c(0, 1, 1), c(1, 1, 1), u), v), w) - 1;
|
|
164
|
+
}
|
|
165
|
+
/** Divergence-free (curl) flow at a point — swirls without sinks or sources. */
|
|
166
|
+
export function curl(x, y, z, out) {
|
|
167
|
+
const e = 0.1;
|
|
168
|
+
const A = (px, py, pz) => vnoise(px, py, pz);
|
|
169
|
+
const B = (px, py, pz) => vnoise(px + 31.4, py + 17.2, pz + 5.9);
|
|
170
|
+
const C = (px, py, pz) => vnoise(px + 9.1, py + 43.7, pz + 23.3);
|
|
171
|
+
const dCdy = (C(x, y + e, z) - C(x, y - e, z)) / (2 * e), dBdz = (B(x, y, z + e) - B(x, y, z - e)) / (2 * e);
|
|
172
|
+
const dAdz = (A(x, y, z + e) - A(x, y, z - e)) / (2 * e), dCdx = (C(x + e, y, z) - C(x - e, y, z)) / (2 * e);
|
|
173
|
+
const dBdx = (B(x + e, y, z) - B(x - e, y, z)) / (2 * e), dAdy = (A(x, y + e, z) - A(x, y - e, z)) / (2 * e);
|
|
174
|
+
return out.set(dCdy - dBdz, dAdz - dCdx, dBdx - dAdy);
|
|
175
|
+
}
|
|
176
|
+
// ---------------------------------------------------------------- colour
|
|
177
|
+
/**
|
|
178
|
+
* Blackbody-like ramp for a cooling spark, linear RGB: 1 = white-hot, 0.6 yellow,
|
|
179
|
+
* 0.35 orange, 0.15 deep red, 0 = gone.
|
|
180
|
+
*/
|
|
181
|
+
export function blackbody(t, out) {
|
|
182
|
+
const x = clamp01(t);
|
|
183
|
+
const r = smooth(0.02, 0.3, x);
|
|
184
|
+
const g = Math.pow(smooth(0.18, 0.75, x), 1.6);
|
|
185
|
+
const b = Math.pow(smooth(0.55, 1, x), 2);
|
|
186
|
+
return out.setRGB(r * 1.0, g * 0.82, b * 0.75);
|
|
187
|
+
}
|
|
188
|
+
/** GLSL: anti-aliased edge — 1 inside, 0 outside, a one-pixel ramp (fragment only). */
|
|
189
|
+
export const GLSL_AA = /* glsl */ `
|
|
190
|
+
float trlAA(float d) { float w = fwidth(d); return clamp(0.5 - d / max(w, 1e-5), 0.0, 1.0); }`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trailGhosts.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/trailGhosts.ts"],"names":[],"mappings":"AAmBA,OAAO,EAA8E,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AA6I1H,eAAO,MAAM,UAAU,YAOrB,CAAC;AAEH,eAAO,MAAM,YAAY,YASvB,CAAC;AAEH,eAAO,MAAM,aAAa,YAQxB,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// Ghost trails — copies of the object's own geometry placed at its poses back in time
|
|
2
|
+
// (instanced per mesh, sharing the mesh's attributes), drawn as additive Fresnel shells.
|
|
3
|
+
// One machine, three looks:
|
|
4
|
+
//
|
|
5
|
+
// afterimage a handful of distinct copies fading along the path, colour →
|
|
6
|
+
// tail colour (length × 1)
|
|
7
|
+
// longExposure many faint copies, so close they read as one continuous
|
|
8
|
+
// smear — a long-exposure photograph of the move (length × 1.25)
|
|
9
|
+
// chromaticEcho three copies a beat apart in three colours (red, green, blue by
|
|
10
|
+
// default): they split into a fringe when it moves fast and add
|
|
11
|
+
// back up to white as they close in (length × 0.5)
|
|
12
|
+
//
|
|
13
|
+
// A copy that sits on the object draws nothing (alpha ∝ how far its pose is from now),
|
|
14
|
+
// so a still object has no trail.
|
|
15
|
+
import { AdditiveBlending, BufferGeometry, Color, DoubleSide, InstancedBufferAttribute, InstancedMesh, Matrix4, Quaternion, ShaderMaterial, Vector3, } from 'three';
|
|
16
|
+
import { awayFromNow, poseAgo, smooth } from './trailCore.js';
|
|
17
|
+
const MAX_MESHES = 24;
|
|
18
|
+
const VERT = /* glsl */ `
|
|
19
|
+
attribute float aTrlAlpha;
|
|
20
|
+
attribute vec3 aTrlTint;
|
|
21
|
+
varying float vTrlA;
|
|
22
|
+
varying vec3 vTrlTint;
|
|
23
|
+
varying vec3 vTrlN;
|
|
24
|
+
varying vec3 vTrlV;
|
|
25
|
+
void main() {
|
|
26
|
+
vTrlA = aTrlAlpha;
|
|
27
|
+
vTrlTint = aTrlTint;
|
|
28
|
+
mat4 m = modelMatrix * instanceMatrix;
|
|
29
|
+
vec4 wp = m * vec4(position, 1.0);
|
|
30
|
+
vTrlN = normalize(mat3(m) * normal);
|
|
31
|
+
vTrlV = normalize(cameraPosition - wp.xyz);
|
|
32
|
+
gl_Position = projectionMatrix * viewMatrix * wp;
|
|
33
|
+
}`;
|
|
34
|
+
const FRAG = /* glsl */ `
|
|
35
|
+
uniform vec3 uTrlColor;
|
|
36
|
+
uniform float uTrlOpacity;
|
|
37
|
+
uniform float uTrlBody;
|
|
38
|
+
varying float vTrlA;
|
|
39
|
+
varying vec3 vTrlTint;
|
|
40
|
+
varying vec3 vTrlN;
|
|
41
|
+
varying vec3 vTrlV;
|
|
42
|
+
void main() {
|
|
43
|
+
if (vTrlA < 0.001) discard;
|
|
44
|
+
float fres = pow(1.0 - abs(dot(normalize(vTrlN), normalize(vTrlV))), 2.2);
|
|
45
|
+
float a = vTrlA * uTrlOpacity * (uTrlBody + (1.0 - uTrlBody) * fres);
|
|
46
|
+
vec3 col = uTrlColor * vTrlTint * (0.55 + 0.9 * fres);
|
|
47
|
+
gl_FragColor = vec4(col * a, a);
|
|
48
|
+
#include <tonemapping_fragment>
|
|
49
|
+
#include <colorspace_fragment>
|
|
50
|
+
}`;
|
|
51
|
+
const state = new WeakMap();
|
|
52
|
+
const _a = { t: 0, p: new Vector3(), q: new Quaternion(), s: new Vector3() };
|
|
53
|
+
const _poses = Array.from({ length: 64 }, () => new Matrix4());
|
|
54
|
+
const _alphas = new Float32Array(64);
|
|
55
|
+
const _rootInv = new Matrix4(), _rel = new Matrix4(), _w = new Matrix4(), _prevP = new Vector3();
|
|
56
|
+
const _tints = new Float32Array(64 * 3), _tc = new Color();
|
|
57
|
+
/** Colour → second colour along the copies (newest → oldest). */
|
|
58
|
+
const gradient = (i, n, p, out) => out.copy(p.color).lerp(p.color2, n > 1 ? i / (n - 1) : 0);
|
|
59
|
+
function ghostStyle(cfg) {
|
|
60
|
+
return {
|
|
61
|
+
build(ctx) {
|
|
62
|
+
const meshes = [];
|
|
63
|
+
ctx.target.traverse((c) => {
|
|
64
|
+
if (c.isMesh && !c.isInstancedMesh && !c.userData?.__opFxHelper && c.geometry?.attributes?.position && meshes.length < MAX_MESHES)
|
|
65
|
+
meshes.push(c);
|
|
66
|
+
});
|
|
67
|
+
const tris = meshes.reduce((n, m) => n + (m.geometry.index ? m.geometry.index.count : m.geometry.attributes.position.count) / 3, 0);
|
|
68
|
+
// keep the copies' total triangle count sane on heavy models
|
|
69
|
+
const n = Math.max(1, Math.min(64, cfg.copies(ctx.p.amount), Math.floor(4e6 / Math.max(1, tris))));
|
|
70
|
+
const g = { list: [], n };
|
|
71
|
+
for (const m of meshes) {
|
|
72
|
+
// its own geometry object that SHARES the mesh's attributes (no copy), plus the per-copy attributes
|
|
73
|
+
const geo = new BufferGeometry();
|
|
74
|
+
for (const [name, attr] of Object.entries(m.geometry.attributes))
|
|
75
|
+
geo.setAttribute(name, attr);
|
|
76
|
+
geo.setIndex(m.geometry.index);
|
|
77
|
+
const alpha = new InstancedBufferAttribute(new Float32Array(n), 1);
|
|
78
|
+
geo.setAttribute('aTrlAlpha', alpha);
|
|
79
|
+
const tint = new InstancedBufferAttribute(new Float32Array(n * 3), 3);
|
|
80
|
+
geo.setAttribute('aTrlTint', tint);
|
|
81
|
+
const mat = new ShaderMaterial({
|
|
82
|
+
vertexShader: VERT, fragmentShader: FRAG,
|
|
83
|
+
uniforms: { uTrlColor: { value: new Color(1, 1, 1) }, uTrlOpacity: { value: ctx.p.opacity }, uTrlBody: { value: cfg.body } },
|
|
84
|
+
transparent: true, depthWrite: false, blending: AdditiveBlending, side: DoubleSide,
|
|
85
|
+
});
|
|
86
|
+
const inst = new InstancedMesh(geo, mat, n);
|
|
87
|
+
inst.frustumCulled = false;
|
|
88
|
+
inst.raycast = () => undefined;
|
|
89
|
+
inst.renderOrder = 2;
|
|
90
|
+
inst.matrixAutoUpdate = false;
|
|
91
|
+
ctx.group.add(inst);
|
|
92
|
+
g.list.push({ mesh: m, inst, alpha, tint });
|
|
93
|
+
}
|
|
94
|
+
state.set(ctx, g);
|
|
95
|
+
},
|
|
96
|
+
update(ctx) {
|
|
97
|
+
const g = state.get(ctx);
|
|
98
|
+
if (!g)
|
|
99
|
+
return;
|
|
100
|
+
const len = ctx.p.length * cfg.lengthScale;
|
|
101
|
+
_prevP.copy(ctx.hist[ctx.head].p);
|
|
102
|
+
for (let i = 0; i < g.n; i++) {
|
|
103
|
+
let a = 0;
|
|
104
|
+
if (poseAgo(ctx, len * cfg.when(i, g.n), _a)) {
|
|
105
|
+
const gap = _a.p.distanceTo(_prevP) / ctx.span;
|
|
106
|
+
a = ctx.env.v * cfg.alpha(i, g.n, ctx.p.amount, gap) * smooth(0.04, 0.3, awayFromNow(ctx, _a));
|
|
107
|
+
}
|
|
108
|
+
_prevP.copy(_a.p);
|
|
109
|
+
_poses[i].compose(_a.p, _a.q, _a.s);
|
|
110
|
+
_alphas[i] = a;
|
|
111
|
+
}
|
|
112
|
+
// colours are live settings: per copy, every frame (a handful of numbers)
|
|
113
|
+
for (let i = 0; i < g.n; i++) {
|
|
114
|
+
cfg.tint(i, g.n, ctx.p, _tc);
|
|
115
|
+
_tints[i * 3] = _tc.r;
|
|
116
|
+
_tints[i * 3 + 1] = _tc.g;
|
|
117
|
+
_tints[i * 3 + 2] = _tc.b;
|
|
118
|
+
}
|
|
119
|
+
_rootInv.copy(ctx.world).invert();
|
|
120
|
+
for (const c of g.list) {
|
|
121
|
+
c.tint.array.set(_tints.subarray(0, g.n * 3));
|
|
122
|
+
c.tint.needsUpdate = true;
|
|
123
|
+
c.inst.material.uniforms.uTrlOpacity.value = ctx.p.opacity;
|
|
124
|
+
c.mesh.updateWorldMatrix(true, false);
|
|
125
|
+
_rel.multiplyMatrices(_rootInv, c.mesh.matrixWorld); // the mesh inside the object, as it is now
|
|
126
|
+
for (let i = 0; i < g.n; i++) {
|
|
127
|
+
c.inst.setMatrixAt(i, _w.multiplyMatrices(_poses[i], _rel));
|
|
128
|
+
c.alpha.array[i] = _alphas[i];
|
|
129
|
+
}
|
|
130
|
+
c.inst.instanceMatrix.needsUpdate = true;
|
|
131
|
+
c.alpha.needsUpdate = true;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
dispose(ctx) {
|
|
135
|
+
const g = state.get(ctx);
|
|
136
|
+
if (!g)
|
|
137
|
+
return;
|
|
138
|
+
for (const c of g.list) {
|
|
139
|
+
// the copies share the object's own attributes: drop those first, so disposing frees only ours
|
|
140
|
+
const geo = c.inst.geometry;
|
|
141
|
+
for (const name of Object.keys(geo.attributes))
|
|
142
|
+
if (name !== 'aTrlAlpha' && name !== 'aTrlTint')
|
|
143
|
+
geo.deleteAttribute(name);
|
|
144
|
+
geo.setIndex(null);
|
|
145
|
+
geo.dispose();
|
|
146
|
+
c.inst.material.dispose();
|
|
147
|
+
c.inst.dispose();
|
|
148
|
+
}
|
|
149
|
+
state.delete(ctx);
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
export const afterimage = ghostStyle({
|
|
154
|
+
copies: a => Math.round(4 + a * 20),
|
|
155
|
+
lengthScale: 1,
|
|
156
|
+
when: (i, n) => (i + 1) / n,
|
|
157
|
+
alpha: (i, n) => Math.pow(1 - i / n, 1.35),
|
|
158
|
+
tint: gradient,
|
|
159
|
+
body: 0.12,
|
|
160
|
+
});
|
|
161
|
+
export const longExposure = ghostStyle({
|
|
162
|
+
copies: a => Math.round(18 + a * 40),
|
|
163
|
+
lengthScale: 1.25,
|
|
164
|
+
when: (i, n) => (i + 1) / n,
|
|
165
|
+
// many faint copies that read as ONE smear: a copy's strength follows how far it is from
|
|
166
|
+
// the next one — packed tight they share the light, spread out each carries more
|
|
167
|
+
alpha: (i, n, _a, gap) => 0.34 * Math.min(1, Math.max(0.06, gap / 0.12)) * Math.pow(1 - i / n, 0.7),
|
|
168
|
+
tint: gradient,
|
|
169
|
+
body: 0.45,
|
|
170
|
+
});
|
|
171
|
+
export const chromaticEcho = ghostStyle({
|
|
172
|
+
copies: () => 3,
|
|
173
|
+
lengthScale: 0.5,
|
|
174
|
+
when: (i, n) => (i + 1) / n,
|
|
175
|
+
alpha: (_i, _n, a) => 0.55 + 0.45 * a,
|
|
176
|
+
// its three colours (red, green, blue by default): apart they fringe, together they add up to white
|
|
177
|
+
tint: (i, _n, p, out) => out.copy(i === 0 ? p.color : i === 1 ? p.color2 : p.color3),
|
|
178
|
+
body: 0.42,
|
|
179
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const smoke: import("./trailCore").TrailStyle;
|
|
2
|
+
export declare const ash: import("./trailCore").TrailStyle;
|
|
3
|
+
export declare const hologram: import("./trailCore").TrailStyle;
|
|
4
|
+
export declare const ink: import("./trailCore").TrailStyle;
|
|
5
|
+
export declare const frost: import("./trailCore").TrailStyle;
|
|
6
|
+
export declare const sand: import("./trailCore").TrailStyle;
|
|
7
|
+
export declare const voxel: import("./trailCore").TrailStyle;
|
|
8
|
+
export declare const shatter: import("./trailCore").TrailStyle;
|
|
9
|
+
export declare const wireframe: import("./trailCore").TrailStyle;
|
|
10
|
+
export declare const bubbles: import("./trailCore").TrailStyle;
|
|
11
|
+
//# sourceMappingURL=trailStampStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trailStampStyles.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/trailStampStyles.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,KAAK,kCAgBhB,CAAC;AAIH,eAAO,MAAM,GAAG,kCAqBd,CAAC;AAIH,eAAO,MAAM,QAAQ,kCA2BnB,CAAC;AAIH,eAAO,MAAM,GAAG,kCAsBd,CAAC;AAIH,eAAO,MAAM,KAAK,kCAmBhB,CAAC;AAIH,eAAO,MAAM,IAAI,kCA8Cf,CAAC;AAIH,eAAO,MAAM,KAAK,kCAuDhB,CAAC;AAIH,eAAO,MAAM,OAAO,kCA4ElB,CAAC;AAIH,eAAO,MAAM,SAAS,kCA2CpB,CAAC;AASH,eAAO,MAAM,OAAO,kCAmDlB,CAAC"}
|