@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
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { BackSide, Color, Mesh, MeshStandardMaterial } from 'three';
|
|
17
17
|
import { defineOperation } from '../types.js';
|
|
18
18
|
import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
|
|
19
|
-
import { createFieldState, fieldGlsl, fieldUniforms, hideMeshes, runProgress } from './transitionField.js';
|
|
19
|
+
import { createFieldState, fieldGlsl, fieldUniforms, hideMeshes, runProgress, setReveal } from './transitionField.js';
|
|
20
20
|
import { hideUntilWarm } from './warmup.js';
|
|
21
21
|
const P = 'Prt';
|
|
22
22
|
const KEY = 'print3d';
|
|
@@ -60,6 +60,7 @@ function mainLayer(st) {
|
|
|
60
60
|
diffuse: /* glsl */ `
|
|
61
61
|
if (uPrtKeep > 0.5) {
|
|
62
62
|
prtPreview(diffuseColor.rgb);
|
|
63
|
+
if (uPrtReveal > 0.5 && prtConv < 0.5) discard; // revealed by the print: nothing above the nozzle
|
|
63
64
|
if (prtConv > 0.5) diffuseColor.rgb = prtCol * mix(0.22, 1.0, prtGap);
|
|
64
65
|
} else {
|
|
65
66
|
if (prtAge(vPrtR, vPrtQ) < 0.0) discard;
|
|
@@ -206,6 +207,7 @@ export default defineOperation({
|
|
|
206
207
|
disappear: { type: 'boolean', label: 'Disappear', default: true, hint: 'Off: the object turns into its slicer preview and stays' },
|
|
207
208
|
},
|
|
208
209
|
objectParams: { disappear: false },
|
|
210
|
+
presence: 'paint',
|
|
209
211
|
apply(target, p) {
|
|
210
212
|
let st = target.userData[STATE];
|
|
211
213
|
if (!st) {
|
|
@@ -247,6 +249,7 @@ export default defineOperation({
|
|
|
247
249
|
s.lines.value = Number(p.lines);
|
|
248
250
|
s.palette.value = Math.max(0, PALETTES.findIndex(o => o.value === p.preview));
|
|
249
251
|
s.keep.value = p.disappear === false ? 1 : 0;
|
|
252
|
+
setReveal(s.field, p);
|
|
250
253
|
// the preview never cuts the object open: the inside is only for the un-print
|
|
251
254
|
s.caps.forEach(c => { c.visible = !s.keep.value; });
|
|
252
255
|
if (s.keep.value) {
|
|
@@ -262,6 +265,7 @@ export default defineOperation({
|
|
|
262
265
|
if (!s)
|
|
263
266
|
return;
|
|
264
267
|
hideMeshes(target, KEY, false);
|
|
268
|
+
setReveal(s.field, p);
|
|
265
269
|
s.caps.forEach(c => { c.visible = !s.keep.value; });
|
|
266
270
|
return runProgress(target, s.field, 0, {
|
|
267
271
|
duration: Number(p.duration), ease: 'none',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulse.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/pulse.ts"],"names":[],"mappings":";AAMA,wBAuBG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Pulse — the object swells and settles about its centre. "Breathe" is a slow
|
|
2
|
+
// rise with a longer fall; "Heartbeat" is the double beat (lub-dub) and a rest.
|
|
3
|
+
import { DURATION, heldPhysical } from './physicalHeld.js';
|
|
4
|
+
const bump = (x, at, width) => Math.exp(-(((x - at) / width) ** 2));
|
|
5
|
+
export default heldPhysical({
|
|
6
|
+
value: 'pulse', label: 'Pulse',
|
|
7
|
+
description: 'Swell and settle — a slow breath, or a double heartbeat',
|
|
8
|
+
params: {
|
|
9
|
+
style: { type: 'select', label: 'Style', default: 'breathe', options: [{ value: 'breathe', label: 'Breathe' }, { value: 'heartbeat', label: 'Heartbeat' }] },
|
|
10
|
+
amount: { type: 'number', label: 'Amount', default: 0.06, min: 0.005, max: 0.6, step: 0.005, hint: 'How much bigger it gets' },
|
|
11
|
+
speed: { type: 'number', label: 'Beats', default: 0.5, min: 0.05, max: 4, step: 0.05, unit: '/s' },
|
|
12
|
+
duration: { ...DURATION, default: 4 },
|
|
13
|
+
},
|
|
14
|
+
memory: () => null,
|
|
15
|
+
move(part, st, time) {
|
|
16
|
+
const p = st.p;
|
|
17
|
+
const ph = (time * Number(p.speed)) % 1;
|
|
18
|
+
let k;
|
|
19
|
+
if (p.style === 'heartbeat')
|
|
20
|
+
k = bump(ph, 0.12, 0.05) + 0.62 * bump(ph, 0.34, 0.065);
|
|
21
|
+
else {
|
|
22
|
+
// in over 40% of the breath, out over the rest
|
|
23
|
+
const u = ph < 0.4 ? ph / 0.4 : 1 - (ph - 0.4) / 0.6;
|
|
24
|
+
k = u * u * (3 - 2 * u);
|
|
25
|
+
}
|
|
26
|
+
part.s.setScalar(1 + Number(p.amount) * k * st.amp.v);
|
|
27
|
+
part.pivot.copy(st.body.centerLocal);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { Quaternion, Vector3 } from 'three';
|
|
2
2
|
import type { Object3D } from 'three';
|
|
3
3
|
export interface RestPose {
|
|
4
|
-
position: Vector3;
|
|
5
|
-
quaternion: Quaternion;
|
|
6
|
-
scale: Vector3;
|
|
7
4
|
/** Bounds centre and bottom in the object's own local space (unscaled). */
|
|
8
5
|
centerLocal: Vector3;
|
|
9
6
|
bottomLocal: Vector3;
|
|
10
7
|
/** World-space size at rest. */
|
|
11
8
|
size: Vector3;
|
|
12
|
-
users: number;
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
export declare function
|
|
10
|
+
/** Start posing the object. `key`: the operation's own, so two operations stack instead of overwriting. */
|
|
11
|
+
export declare function acquireRest(target: Object3D, key?: string): RestPose;
|
|
12
|
+
/** Stop posing: this operation's part goes, the object returns to rest (or to what the others hold). */
|
|
13
|
+
export declare function releaseRest(target: Object3D, key?: string): void;
|
|
16
14
|
/**
|
|
17
15
|
* Pose the object as rest ∘ (rotation `q` and non-uniform scale `s` about the local
|
|
18
16
|
* `pivot`), then offset by `worldOffset`. The pivot stays where it is at rest.
|
|
19
17
|
*/
|
|
20
|
-
export declare function poseAbout(target: Object3D,
|
|
18
|
+
export declare function poseAbout(target: Object3D, _r: RestPose, pivot: Vector3, q: Quaternion, s: Vector3, worldOffset?: Vector3, key?: string): void;
|
|
21
19
|
//# sourceMappingURL=restPose.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restPose.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/restPose.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"restPose.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/restPose.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,WAAW,QAAQ;IACrB,2EAA2E;IAC3E,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,gCAAgC;IAChC,IAAI,EAAE,OAAO,CAAC;CACjB;AAID,2GAA2G;AAC3G,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAU,GAAG,QAAQ,CAErE;AAED,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAU,QAE1D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,OAAO,EAAE,GAAG,SAAU,QAKxI"}
|
|
@@ -1,55 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function acquireRest(target) {
|
|
7
|
-
let r = target.userData[KEY];
|
|
8
|
-
if (!r) {
|
|
9
|
-
target.updateWorldMatrix(true, true);
|
|
10
|
-
const box = new Box3().setFromObject(target);
|
|
11
|
-
const c = box.getCenter(new Vector3());
|
|
12
|
-
const bottom = new Vector3(c.x, box.min.y, c.z);
|
|
13
|
-
r = {
|
|
14
|
-
position: target.position.clone(), quaternion: target.quaternion.clone(), scale: target.scale.clone(),
|
|
15
|
-
centerLocal: target.worldToLocal(c.clone()), bottomLocal: target.worldToLocal(bottom),
|
|
16
|
-
size: box.getSize(new Vector3()), users: 0,
|
|
17
|
-
};
|
|
18
|
-
target.userData[KEY] = r;
|
|
19
|
-
}
|
|
20
|
-
r.users++;
|
|
21
|
-
return r;
|
|
1
|
+
import { composeMix, joinMix, leaveMix } from './physicalMix.js';
|
|
2
|
+
const DEFAULT = 'rest';
|
|
3
|
+
/** Start posing the object. `key`: the operation's own, so two operations stack instead of overwriting. */
|
|
4
|
+
export function acquireRest(target, key = DEFAULT) {
|
|
5
|
+
return joinMix(target, key).body;
|
|
22
6
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return;
|
|
27
|
-
r.users--;
|
|
28
|
-
if (r.users <= 0) {
|
|
29
|
-
target.position.copy(r.position);
|
|
30
|
-
target.quaternion.copy(r.quaternion);
|
|
31
|
-
target.scale.copy(r.scale);
|
|
32
|
-
delete target.userData[KEY];
|
|
33
|
-
}
|
|
7
|
+
/** Stop posing: this operation's part goes, the object returns to rest (or to what the others hold). */
|
|
8
|
+
export function releaseRest(target, key = DEFAULT) {
|
|
9
|
+
leaveMix(target, key);
|
|
34
10
|
}
|
|
35
|
-
const _v = new Vector3();
|
|
36
11
|
/**
|
|
37
12
|
* Pose the object as rest ∘ (rotation `q` and non-uniform scale `s` about the local
|
|
38
13
|
* `pivot`), then offset by `worldOffset`. The pivot stays where it is at rest.
|
|
39
14
|
*/
|
|
40
|
-
export function poseAbout(target,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const w = target.parent.localToWorld(target.position.clone()).add(worldOffset);
|
|
51
|
-
target.position.copy(target.parent.worldToLocal(w));
|
|
52
|
-
}
|
|
53
|
-
else if (worldOffset)
|
|
54
|
-
target.position.add(worldOffset);
|
|
15
|
+
export function poseAbout(target, _r, pivot, q, s, worldOffset, key = DEFAULT) {
|
|
16
|
+
const { part } = joinMix(target, key);
|
|
17
|
+
part.pivot.copy(pivot);
|
|
18
|
+
part.q.copy(q);
|
|
19
|
+
part.s.copy(s);
|
|
20
|
+
if (worldOffset)
|
|
21
|
+
part.off.copy(worldOffset);
|
|
22
|
+
else
|
|
23
|
+
part.off.set(0, 0, 0);
|
|
24
|
+
composeMix(target);
|
|
55
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/rotate.ts"],"names":[],"mappings":";AAmBA,wBA4BG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Rotate — the object turns steadily about its own axes, through its centre.
|
|
2
|
+
// One axis is a plain turn; two or three together is a turn about their diagonal
|
|
3
|
+
// (a tumble). Switching on spins it up; switching off lets it coast to the nearest
|
|
4
|
+
// whole turn, so it always stops facing the way it started. The other way round
|
|
5
|
+
// is the playback's Reverse.
|
|
6
|
+
import { Vector3 } from 'three';
|
|
7
|
+
import { multiValues } from '../types.js';
|
|
8
|
+
import { DURATION, heldPhysical, periodicEase } from './physicalHeld.js';
|
|
9
|
+
const AXES = { x: new Vector3(1, 0, 0), y: new Vector3(0, 1, 0), z: new Vector3(0, 0, 1) };
|
|
10
|
+
const TAU = Math.PI * 2;
|
|
11
|
+
const _axis = new Vector3();
|
|
12
|
+
/** The axis to turn about: the chosen ones together (their diagonal). */
|
|
13
|
+
function axisOf(value) {
|
|
14
|
+
_axis.set(0, 0, 0);
|
|
15
|
+
for (const k of multiValues(value))
|
|
16
|
+
if (AXES[k])
|
|
17
|
+
_axis.add(AXES[k]);
|
|
18
|
+
return _axis.lengthSq() > 0 ? _axis.normalize() : _axis.copy(AXES.y);
|
|
19
|
+
}
|
|
20
|
+
export default heldPhysical({
|
|
21
|
+
value: 'rotate', label: 'Rotate',
|
|
22
|
+
description: 'Turn steadily about its own axes — spins up, and coasts to a stop facing the way it started',
|
|
23
|
+
ease: 'none',
|
|
24
|
+
params: {
|
|
25
|
+
axis: { type: 'multi', label: 'Axes', default: 'y', options: [{ value: 'x', label: 'X' }, { value: 'y', label: 'Y' }, { value: 'z', label: 'Z' }], hint: 'Pick one, or several to tumble about them together' },
|
|
26
|
+
speed: { type: 'number', label: 'Speed', default: 0.2, min: 0.01, max: 4, step: 0.01, unit: 'turns/s' },
|
|
27
|
+
duration: { ...DURATION, default: 5 },
|
|
28
|
+
},
|
|
29
|
+
memory: () => ({ angle: 0, from: 0, to: 0 }),
|
|
30
|
+
onOut(st) {
|
|
31
|
+
// land on a whole turn ahead: at least what the current speed would cover while slowing
|
|
32
|
+
const m = st.mem, dir = st.p.__backward === true ? -1 : 1;
|
|
33
|
+
const coast = TAU * Number(st.p.speed) * periodicEase(Number(st.p.duration)) * 0.5 * st.amp.v;
|
|
34
|
+
m.from = m.angle;
|
|
35
|
+
m.to = dir * Math.ceil((dir * m.angle + coast - 1e-6) / TAU) * TAU;
|
|
36
|
+
},
|
|
37
|
+
move(part, st, _time, dt) {
|
|
38
|
+
const p = st.p, m = st.mem, a = st.amp.v;
|
|
39
|
+
if (st.out) {
|
|
40
|
+
const u = 1 - a; // 0 → 1 over the stop
|
|
41
|
+
m.angle = m.from + (m.to - m.from) * (1 - (1 - u) * (1 - u));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
m.angle += TAU * Number(p.speed) * a * a * dt; // spins up (dt is negative when played backwards)
|
|
45
|
+
}
|
|
46
|
+
part.q.setFromAxisAngle(axisOf(p.axis), m.angle);
|
|
47
|
+
part.pivot.copy(st.body.centerLocal);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shake.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/shake.ts"],"names":[],"mappings":";AAcA,wBAkBG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Shake — a tremble made of smooth noise (not a new random spot every frame, which
|
|
2
|
+
// reads as flicker): position and a little roll, each on its own noise track.
|
|
3
|
+
import { Vector3 } from 'three';
|
|
4
|
+
import { DURATION, heldPhysical } from './physicalHeld.js';
|
|
5
|
+
const Z = new Vector3(0, 0, 1);
|
|
6
|
+
const hash = (i, seed) => { const x = Math.sin(i * 127.1 + seed * 311.7) * 43758.5453; return (x - Math.floor(x)) * 2 - 1; };
|
|
7
|
+
/** Smooth 1D noise, −1..1. */
|
|
8
|
+
function noise(x, seed) {
|
|
9
|
+
const i = Math.floor(x), f = x - i;
|
|
10
|
+
const u = f * f * (3 - 2 * f);
|
|
11
|
+
return hash(i, seed) * (1 - u) + hash(i + 1, seed) * u;
|
|
12
|
+
}
|
|
13
|
+
export default heldPhysical({
|
|
14
|
+
value: 'shake', label: 'Shake',
|
|
15
|
+
description: 'Tremble on the spot — smooth, nervous noise in position and roll',
|
|
16
|
+
params: {
|
|
17
|
+
strength: { type: 'number', label: 'Strength', default: 0.02, min: 0.002, max: 0.3, step: 0.002, hint: 'As a fraction of the object’s height' },
|
|
18
|
+
frequency: { type: 'number', label: 'Rate', default: 14, min: 1, max: 40, step: 0.5, unit: '/s' },
|
|
19
|
+
roll: { type: 'number', label: 'Roll', default: 1.5, min: 0, max: 15, step: 0.25, unit: '°' },
|
|
20
|
+
duration: { ...DURATION, default: 1.2 },
|
|
21
|
+
},
|
|
22
|
+
memory: () => null,
|
|
23
|
+
move(part, st, time) {
|
|
24
|
+
const p = st.p, a = st.amp.v;
|
|
25
|
+
const x = time * Number(p.frequency);
|
|
26
|
+
const A = st.body.size.y * Number(p.strength) * a;
|
|
27
|
+
part.off.set(noise(x, 1) * A, noise(x, 2) * A, noise(x, 3) * A * 0.5);
|
|
28
|
+
part.q.setFromAxisAngle(Z, noise(x * 0.8, 4) * (Number(p.roll) * Math.PI / 180) * a);
|
|
29
|
+
part.pivot.copy(st.body.centerLocal);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shatter.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/shatter.ts"],"names":[],"mappings":";AAqKA,
|
|
1
|
+
{"version":3,"file":"shatter.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/shatter.ts"],"names":[],"mappings":";AAqKA,wBA+FG"}
|
|
@@ -162,7 +162,8 @@ export default defineOperation({
|
|
|
162
162
|
channel: 'visual',
|
|
163
163
|
multi: true,
|
|
164
164
|
toggles: true,
|
|
165
|
-
usableIn: ['interaction', 'action'],
|
|
165
|
+
usableIn: ['interaction', 'action', 'object'],
|
|
166
|
+
presence: 'vanish',
|
|
166
167
|
params: {
|
|
167
168
|
direction: { type: 'select', label: 'Direction', default: 'outward', options: DIRECTION_OPTIONS },
|
|
168
169
|
edgeColor: { type: 'color', label: 'Crack colour', default: '#8fe3ff' },
|
|
@@ -210,8 +211,10 @@ export default defineOperation({
|
|
|
210
211
|
retainPrograms(stage);
|
|
211
212
|
if (target.userData[STATE] !== own)
|
|
212
213
|
return; // reverted meanwhile
|
|
214
|
+
// (__opFxOwnMaterial: the mesh's real material, so the swap is not taken for a replaced surface — see surfaceSignature)
|
|
213
215
|
for (const sw of own.swaps)
|
|
214
216
|
if (sw.split) {
|
|
217
|
+
sw.mesh.userData.__opFxOwnMaterial = sw.material;
|
|
215
218
|
sw.mesh.geometry = sw.splitGeo;
|
|
216
219
|
sw.mesh.material = sw.splitMat;
|
|
217
220
|
}
|
|
@@ -253,6 +256,7 @@ export default defineOperation({
|
|
|
253
256
|
}
|
|
254
257
|
sw.mesh.geometry = sw.geometry;
|
|
255
258
|
sw.mesh.material = sw.material;
|
|
259
|
+
delete sw.mesh.userData.__opFxOwnMaterial;
|
|
256
260
|
(Array.isArray(sw.splitMat) ? sw.splitMat : [sw.splitMat]).forEach(m => m.dispose());
|
|
257
261
|
}
|
|
258
262
|
delete target.userData[STATE];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slam.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/slam.ts"],"names":[],"mappings":";AA4BA,wBAgEG"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Slam — weight and impact. Coming in, the object hangs above its spot, winds up
|
|
2
|
+
// (rises a little, slowing to a stop), then slams down, accelerating hard
|
|
3
|
+
// (height ∝ (1−t)³ … the speed is greatest at the floor), stretched by the speed.
|
|
4
|
+
// The impact squashes it flat at its base, it rebounds in a small hop and rattles
|
|
5
|
+
// (a fast, damped shake) until it is exactly at rest. Leaving: it lifts and winds
|
|
6
|
+
// up, slams down into the floor and is driven through it, rattling, and is gone.
|
|
7
|
+
import { Quaternion } from 'three';
|
|
8
|
+
import { clamp01, physicalExit, ring, smooth } from './physicalExit.js';
|
|
9
|
+
const _a = new Quaternion(), _b = new Quaternion();
|
|
10
|
+
const HANG = 0.32, HIT = 0.5; // entrance: hang + wind-up, then the drop, then the impact
|
|
11
|
+
/** A fast damped rattle about two screen axes, `amount` 0…1. */
|
|
12
|
+
function rattle(out, a, amount, secs) {
|
|
13
|
+
const rad = (Number(a.p.rattle) * Math.PI / 180) * amount;
|
|
14
|
+
const w = 2 * Math.PI * secs;
|
|
15
|
+
_a.setFromAxisAngle(a.frame.right, rad * Math.sin(19 * w));
|
|
16
|
+
_b.setFromAxisAngle(a.frame.toward, rad * 0.8 * Math.sin(23 * w + 1.3));
|
|
17
|
+
out.q.copy(a.local(_a.multiply(_b)));
|
|
18
|
+
}
|
|
19
|
+
/** Volume-keeping vertical scale about the base. */
|
|
20
|
+
function vert(out, sy, size = 1) {
|
|
21
|
+
const sxz = 1 / Math.sqrt(Math.max(sy, 0.05));
|
|
22
|
+
out.s.set(sxz * size, sy * size, sxz * size);
|
|
23
|
+
out.pivot = 'bottom';
|
|
24
|
+
}
|
|
25
|
+
export default physicalExit({
|
|
26
|
+
value: 'slam',
|
|
27
|
+
label: 'Slam',
|
|
28
|
+
description: 'Hangs above its spot, winds up and slams down — squash, hop and rattle; it leaves by slamming down through the floor',
|
|
29
|
+
params: {
|
|
30
|
+
height: { type: 'number', label: 'Height', default: 1.6, min: 0.5, max: 12, step: 0.1, hint: 'How high it hangs before the slam, × its height' },
|
|
31
|
+
squash: { type: 'number', label: 'Squash', default: 0.38, min: 0, max: 0.7, step: 0.01, hint: 'How flat the impact squashes it' },
|
|
32
|
+
rattle: { type: 'number', label: 'Rattle', default: 2.5, min: 0, max: 10, step: 0.25, unit: '°' },
|
|
33
|
+
duration: { type: 'number', label: 'Duration', default: 1.5, min: 0.4, max: 6, step: 0.05, unit: 's' },
|
|
34
|
+
},
|
|
35
|
+
enter(v, out, a) {
|
|
36
|
+
const p = a.p, H = a.size.y, D = Number(p.duration), up = a.frame.up;
|
|
37
|
+
const top = Number(p.height) * H;
|
|
38
|
+
const sq = Number(p.squash);
|
|
39
|
+
if (v < HANG) {
|
|
40
|
+
// appears and winds up: rises a little higher, slowing to a stop
|
|
41
|
+
const t = v / HANG;
|
|
42
|
+
const y = top + 0.12 * top * (1 - Math.pow(1 - t, 2));
|
|
43
|
+
out.off.copy(up).multiplyScalar(y);
|
|
44
|
+
vert(out, 1 - 0.08 * smooth(0.6, 1, t), smooth(0, 0.3, t)); // gathers itself
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (v < HIT) {
|
|
48
|
+
// the slam: accelerating all the way to the floor
|
|
49
|
+
const t = (v - HANG) / (HIT - HANG);
|
|
50
|
+
const y = 1.12 * top * (1 - t * t * t);
|
|
51
|
+
out.off.copy(up).multiplyScalar(y);
|
|
52
|
+
vert(out, 0.92 + (0.08 + 0.35 * sq) * smooth(0, 0.7, t));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
// impact: flat at once, then a hop and a rattle that die out exactly at rest
|
|
56
|
+
const sg = clamp01((v - HIT) / (1 - HIT));
|
|
57
|
+
const r = ring(sg, 2.2, 4.2);
|
|
58
|
+
const flat = sq * Math.exp(-14 * sg) * (1 - smooth(0, 0.5, sg)); // the hit itself
|
|
59
|
+
vert(out, 1 - flat - 0.35 * sq * r);
|
|
60
|
+
const hop = 0.1 * H * Math.max(0, Math.sin(Math.PI * clamp01((sg - 0.06) / 0.3))) * (1 - sg);
|
|
61
|
+
out.off.copy(up).multiplyScalar(hop);
|
|
62
|
+
rattle(out, a, Math.exp(-5 * sg) * (1 - sg) * smooth(0, 0.04, sg), v * D);
|
|
63
|
+
},
|
|
64
|
+
exit(u, out, a) {
|
|
65
|
+
const p = a.p, H = a.size.y, D = Number(p.duration), up = a.frame.up;
|
|
66
|
+
const sq = Number(p.squash);
|
|
67
|
+
const W = 0.35, HITX = 0.47;
|
|
68
|
+
if (u < W) {
|
|
69
|
+
// lifts and winds up
|
|
70
|
+
const t = u / W;
|
|
71
|
+
out.off.copy(up).multiplyScalar(0.45 * H * (1 - Math.pow(1 - t, 2)));
|
|
72
|
+
vert(out, 1 + 0.06 * smooth(0, 1, t));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (u < HITX) {
|
|
76
|
+
const t = (u - W) / (HITX - W);
|
|
77
|
+
out.off.copy(up).multiplyScalar(0.45 * H * (1 - t * t * t));
|
|
78
|
+
vert(out, 1.06 + 0.25 * sq * t);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// into the floor: flattened by the hit, then driven down through it, rattling
|
|
82
|
+
const sg = (u - HITX) / (1 - HITX);
|
|
83
|
+
const flat = sq * Math.exp(-10 * sg) * smooth(0, 0.03, sg);
|
|
84
|
+
const sink = 1.15 * H * Math.pow(smooth(0.08, 1, sg), 1.3);
|
|
85
|
+
out.off.copy(up).multiplyScalar(-sink);
|
|
86
|
+
vert(out, 1 - flat, 1 - smooth(0.6, 1, sg));
|
|
87
|
+
rattle(out, a, smooth(0, 0.05, sg) * (1 - 0.4 * sg), u * D);
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slingshot.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/slingshot.ts"],"names":[],"mappings":";AAoBA,wBA2DG"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Slingshot — the object is pulled back on an elastic, stretching against the
|
|
2
|
+
// pull (Hooke tension builds, the band quivers at full draw), then released:
|
|
3
|
+
// it snaps forward through rest and flies off still stretched, gone in the
|
|
4
|
+
// distance. Launched upwards the draw is a crouch into the ground instead.
|
|
5
|
+
// The way back: it flies in from where it went, fast, and is caught by a damped
|
|
6
|
+
// spring — overshooting past rest and ringing in until it is exactly there.
|
|
7
|
+
import { Vector3 } from 'three';
|
|
8
|
+
import { clamp01, physicalExit, ring, smooth, stretchAxis } from './physicalExit.js';
|
|
9
|
+
const DRAW_END = 0.42;
|
|
10
|
+
const CATCH = 0.45;
|
|
11
|
+
const _d = new Vector3(), _n = new Vector3();
|
|
12
|
+
function dirOf(f, d) {
|
|
13
|
+
if (d === 'left')
|
|
14
|
+
return _d.copy(f.right).negate();
|
|
15
|
+
if (d === 'up')
|
|
16
|
+
return _d.copy(f.up);
|
|
17
|
+
if (d === 'away')
|
|
18
|
+
return _d.copy(f.toward).negate();
|
|
19
|
+
return _d.copy(f.right);
|
|
20
|
+
}
|
|
21
|
+
export default physicalExit({
|
|
22
|
+
value: 'slingshot',
|
|
23
|
+
label: 'Slingshot',
|
|
24
|
+
description: 'Pulled back on an elastic, then let go — it snaps forward and flies off stretched; it flies back in and is caught by a spring',
|
|
25
|
+
params: {
|
|
26
|
+
direction: {
|
|
27
|
+
type: 'select', label: 'Direction', default: 'right', options: [
|
|
28
|
+
{ value: 'right', label: 'Right' }, { value: 'left', label: 'Left' }, { value: 'up', label: 'Up' }, { value: 'away', label: 'Away' },
|
|
29
|
+
], hint: 'Screen-relative when it starts',
|
|
30
|
+
},
|
|
31
|
+
pull: { type: 'number', label: 'Draw', default: 0.6, min: 0, max: 2, step: 0.05, hint: 'How far it is pulled back, × its size' },
|
|
32
|
+
stretch: { type: 'number', label: 'Stretch', default: 0.35, min: 0, max: 1.2, step: 0.01 },
|
|
33
|
+
distance: { type: 'number', label: 'Distance', default: 10, min: 3, max: 40, step: 0.5, hint: 'How far it flies before it is gone, × its size' },
|
|
34
|
+
duration: { type: 'number', label: 'Duration', default: 1.5, min: 0.3, max: 6, step: 0.05, unit: 's' },
|
|
35
|
+
},
|
|
36
|
+
exit(u, out, a) {
|
|
37
|
+
const p = a.p, f = a.frame, D = Number(p.duration);
|
|
38
|
+
const d = dirOf(f, p.direction);
|
|
39
|
+
const up = p.direction === 'up';
|
|
40
|
+
const axis = a.axis(d), st = Number(p.stretch);
|
|
41
|
+
const P = Number(p.pull) * a.span * (up ? 0 : 1);
|
|
42
|
+
const F = Number(p.distance) * a.span;
|
|
43
|
+
if (u < DRAW_END) {
|
|
44
|
+
const t = u / DRAW_END;
|
|
45
|
+
const draw = 1 - Math.pow(1 - t, 3);
|
|
46
|
+
// quivers at full draw, across the pull
|
|
47
|
+
_n.crossVectors(d, f.up);
|
|
48
|
+
if (_n.lengthSq() < 1e-6)
|
|
49
|
+
_n.copy(f.right);
|
|
50
|
+
_n.normalize();
|
|
51
|
+
const quiver = 0.012 * a.span * smooth(0.6, 1, t) * Math.sin(2 * Math.PI * 13 * u * D);
|
|
52
|
+
out.off.copy(d).multiplyScalar(-P * draw).addScaledVector(_n, quiver);
|
|
53
|
+
if (up) {
|
|
54
|
+
out.pivot = 'bottom';
|
|
55
|
+
stretchAxis(out.s, axis, 1 - 0.5 * st * draw);
|
|
56
|
+
}
|
|
57
|
+
else
|
|
58
|
+
stretchAxis(out.s, axis, 1 + st * draw);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const tau = (u - DRAW_END) / (1 - DRAW_END);
|
|
62
|
+
out.off.copy(d).multiplyScalar(-P + (P + F) * (1 - Math.pow(1 - tau, 2.2)));
|
|
63
|
+
// the band lets go: the stretch peaks just after release and relaxes in flight
|
|
64
|
+
const k = up
|
|
65
|
+
? 1 - 0.5 * st * (1 - smooth(0, 0.06, tau)) + 1.4 * st * smooth(0, 0.06, tau) * Math.pow(1 - tau, 1.2)
|
|
66
|
+
: 1 + st * (1 + 0.8 * smooth(0, 0.08, tau)) * Math.pow(1 - tau, 1.2);
|
|
67
|
+
if (up)
|
|
68
|
+
out.pivot = 'bottom';
|
|
69
|
+
stretchAxis(out.s, axis, k, 1 - smooth(0.55, 1, tau));
|
|
70
|
+
},
|
|
71
|
+
enter(v, out, a) {
|
|
72
|
+
const p = a.p, f = a.frame;
|
|
73
|
+
const d = dirOf(f, p.direction);
|
|
74
|
+
const axis = a.axis(d), st = Number(p.stretch);
|
|
75
|
+
const F = Number(p.distance) * a.span;
|
|
76
|
+
if (v < CATCH) {
|
|
77
|
+
const tau = v / CATCH;
|
|
78
|
+
out.off.copy(d).multiplyScalar(F * Math.pow(1 - tau, 1.6));
|
|
79
|
+
stretchAxis(out.s, axis, 1 + st * (1 - tau), smooth(0, 0.3, tau));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// caught: past rest the other way, then rings in
|
|
83
|
+
const sg = clamp01((v - CATCH) / (1 - CATCH));
|
|
84
|
+
const r = ring(sg, 1.25, 3.2);
|
|
85
|
+
out.off.copy(d).multiplyScalar(-0.22 * a.span * r);
|
|
86
|
+
stretchAxis(out.s, axis, 1 - 0.55 * st * Math.abs(r));
|
|
87
|
+
},
|
|
88
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spin.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/spin.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"spin.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/spin.ts"],"names":[],"mappings":";AAYA,wBA0CG"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Spin — the target turns a whole number of times about one of its own local
|
|
2
2
|
// axes and lands exactly where it started. One-shot: triggering again spins again.
|
|
3
3
|
import { gsap } from 'gsap';
|
|
4
|
-
import {
|
|
4
|
+
import { Vector3 } from 'three';
|
|
5
5
|
import { defineOperation } from '../types.js';
|
|
6
|
+
import { composeMix, joinMix, leaveMix } from './physicalMix.js';
|
|
6
7
|
const KEY = '__opSpin';
|
|
7
8
|
const AXES = { x: new Vector3(1, 0, 0), y: new Vector3(0, 1, 0), z: new Vector3(0, 0, 1) };
|
|
8
9
|
export default defineOperation({
|
|
@@ -12,7 +13,7 @@ export default defineOperation({
|
|
|
12
13
|
channel: 'transform',
|
|
13
14
|
multi: true,
|
|
14
15
|
toggles: false,
|
|
15
|
-
usableIn: ['interaction', 'action'],
|
|
16
|
+
usableIn: ['interaction', 'action', 'object'],
|
|
16
17
|
params: {
|
|
17
18
|
axis: { type: 'select', label: 'Axis', default: 'y', options: [{ value: 'y', label: 'Up (Y)' }, { value: 'x', label: 'Side (X)' }, { value: 'z', label: 'Front (Z)' }] },
|
|
18
19
|
turns: { type: 'number', label: 'Turns', default: 1, min: 1, max: 10, step: 1 },
|
|
@@ -20,23 +21,33 @@ export default defineOperation({
|
|
|
20
21
|
duration: { type: 'number', label: 'Duration', default: 1.2, min: 0.1, max: 20, step: 0.05, unit: 's' },
|
|
21
22
|
},
|
|
22
23
|
apply(target, p) {
|
|
23
|
-
// A spin already running is
|
|
24
|
+
// A spin already running is replaced (its part is reset below), so the rest pose is never lost.
|
|
24
25
|
const running = target.userData[KEY];
|
|
25
|
-
if (running)
|
|
26
|
+
if (running)
|
|
26
27
|
gsap.killTweensOf(running.proxy);
|
|
27
|
-
target.quaternion.copy(running.rest);
|
|
28
|
-
}
|
|
29
28
|
const axis = AXES[String(p.axis)] ?? AXES.y;
|
|
30
|
-
const st = { rest: target.quaternion.clone(), proxy: { angle: 0 } };
|
|
31
|
-
target.userData[KEY] = st;
|
|
32
|
-
const turn = new Quaternion();
|
|
33
29
|
const turns = Math.max(1, Math.round(Number(p.turns)));
|
|
30
|
+
const full = (p.reverse ? -1 : 1) * turns * Math.PI * 2;
|
|
31
|
+
// p.__backward (playback: reverse / yoyo) plays the same move backwards in time.
|
|
32
|
+
const back = p.__backward === true;
|
|
33
|
+
const st = { proxy: { angle: back ? full : 0 } };
|
|
34
|
+
target.userData[KEY] = st;
|
|
35
|
+
// a turn about the object's own axis and origin, laid over its transform by the physical mix
|
|
36
|
+
const { part } = joinMix(target, KEY);
|
|
37
|
+
part.pivot.set(0, 0, 0);
|
|
34
38
|
gsap.to(st.proxy, {
|
|
35
|
-
angle:
|
|
39
|
+
angle: back ? 0 : full,
|
|
36
40
|
duration: Number(p.duration), ease: 'power2.inOut',
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onComplete: () => { target.quaternion.copy(st.rest); delete target.userData[KEY]; },
|
|
41
|
+
onUpdate: () => { part.q.setFromAxisAngle(axis, st.proxy.angle); composeMix(target); },
|
|
42
|
+
onComplete: () => { leaveMix(target, KEY); delete target.userData[KEY]; },
|
|
40
43
|
});
|
|
41
44
|
},
|
|
45
|
+
cancel(target) {
|
|
46
|
+
const running = target.userData[KEY];
|
|
47
|
+
if (!running)
|
|
48
|
+
return;
|
|
49
|
+
gsap.killTweensOf(running.proxy);
|
|
50
|
+
delete target.userData[KEY];
|
|
51
|
+
leaveMix(target, KEY);
|
|
52
|
+
},
|
|
42
53
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sway.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/sway.ts"],"names":[],"mappings":";AAOA,wBAiBG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Sway — the object rocks about its base like something tall in a light wind:
|
|
2
|
+
// a pendulum swing with a touch of second harmonic, so it lingers at the ends.
|
|
3
|
+
import { Vector3 } from 'three';
|
|
4
|
+
import { DURATION, heldPhysical } from './physicalHeld.js';
|
|
5
|
+
const AXES = { side: new Vector3(0, 0, 1), front: new Vector3(1, 0, 0) };
|
|
6
|
+
export default heldPhysical({
|
|
7
|
+
value: 'sway', label: 'Sway',
|
|
8
|
+
description: 'Rock gently about its base, like something tall in a light wind',
|
|
9
|
+
params: {
|
|
10
|
+
direction: { type: 'select', label: 'Direction', default: 'side', options: [{ value: 'side', label: 'Side to side' }, { value: 'front', label: 'Front to back' }] },
|
|
11
|
+
angle: { type: 'number', label: 'Angle', default: 7, min: 0.5, max: 45, step: 0.5, unit: '°' },
|
|
12
|
+
speed: { type: 'number', label: 'Speed', default: 1, min: 0.1, max: 5, step: 0.05, unit: '×' },
|
|
13
|
+
duration: { ...DURATION, default: 3 },
|
|
14
|
+
},
|
|
15
|
+
memory: () => null,
|
|
16
|
+
move(part, st, time) {
|
|
17
|
+
const p = st.p;
|
|
18
|
+
const w = 2 * Math.PI * 0.4 * Number(p.speed) * time;
|
|
19
|
+
const swing = (Math.sin(w) + 0.14 * Math.sin(3 * w)) / 0.86; // flatter at the ends
|
|
20
|
+
part.q.setFromAxisAngle(AXES[String(p.direction)] ?? AXES.side, swing * (Number(p.angle) * Math.PI / 180) * st.amp.v);
|
|
21
|
+
part.pivot.copy(st.body.bottomLocal);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swirl.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/swirl.ts"],"names":[],"mappings":";AAgCA,
|
|
1
|
+
{"version":3,"file":"swirl.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/swirl.ts"],"names":[],"mappings":";AAgCA,wBAyCG"}
|