@3driseai/3drise-viewer 0.1.1
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/components/AnimatedObject.d.ts +22 -0
- package/dist/components/AnimatedObject.d.ts.map +1 -0
- package/dist/components/AnimatedObject.js +65 -0
- package/dist/components/Bubbles.d.ts +9 -0
- package/dist/components/Bubbles.d.ts.map +1 -0
- package/dist/components/Bubbles.js +105 -0
- package/dist/components/CameraController.d.ts +10 -0
- package/dist/components/CameraController.d.ts.map +1 -0
- package/dist/components/CameraController.js +158 -0
- package/dist/components/Clouds.d.ts +9 -0
- package/dist/components/Clouds.d.ts.map +1 -0
- package/dist/components/Clouds.js +278 -0
- package/dist/components/Corona.d.ts +18 -0
- package/dist/components/Corona.d.ts.map +1 -0
- package/dist/components/Corona.js +12 -0
- package/dist/components/CreatedObject.d.ts +14 -0
- package/dist/components/CreatedObject.d.ts.map +1 -0
- package/dist/components/CreatedObject.js +103 -0
- package/dist/components/CustomPrimitive.d.ts +12 -0
- package/dist/components/CustomPrimitive.d.ts.map +1 -0
- package/dist/components/CustomPrimitive.js +87 -0
- package/dist/components/Earth.d.ts +8 -0
- package/dist/components/Earth.d.ts.map +1 -0
- package/dist/components/Earth.js +38 -0
- package/dist/components/EffectsGenerator.d.ts +10 -0
- package/dist/components/EffectsGenerator.d.ts.map +1 -0
- package/dist/components/EffectsGenerator.js +71 -0
- package/dist/components/EffectsGroup.d.ts +8 -0
- package/dist/components/EffectsGroup.d.ts.map +1 -0
- package/dist/components/EffectsGroup.js +11 -0
- package/dist/components/EnvironmentManager.d.ts +9 -0
- package/dist/components/EnvironmentManager.d.ts.map +1 -0
- package/dist/components/EnvironmentManager.js +74 -0
- package/dist/components/EnvironmentObject.d.ts +8 -0
- package/dist/components/EnvironmentObject.d.ts.map +1 -0
- package/dist/components/EnvironmentObject.js +14 -0
- package/dist/components/Flares.d.ts +24 -0
- package/dist/components/Flares.d.ts.map +1 -0
- package/dist/components/Flares.js +134 -0
- package/dist/components/Frame.d.ts +23 -0
- package/dist/components/Frame.d.ts.map +1 -0
- package/dist/components/Frame.js +55 -0
- package/dist/components/FrameGeometry.d.ts +10 -0
- package/dist/components/FrameGeometry.d.ts.map +1 -0
- package/dist/components/FrameGeometry.js +17 -0
- package/dist/components/FrameImage.d.ts +2 -0
- package/dist/components/FrameImage.d.ts.map +1 -0
- package/dist/components/FrameImage.js +15 -0
- package/dist/components/Galaxy.d.ts +10 -0
- package/dist/components/Galaxy.d.ts.map +1 -0
- package/dist/components/Galaxy.js +29 -0
- package/dist/components/GalleryLayout.d.ts +12 -0
- package/dist/components/GalleryLayout.d.ts.map +1 -0
- package/dist/components/GalleryLayout.js +20 -0
- package/dist/components/GeometryShape.d.ts +54 -0
- package/dist/components/GeometryShape.d.ts.map +1 -0
- package/dist/components/GeometryShape.js +318 -0
- package/dist/components/Glyphs.d.ts +9 -0
- package/dist/components/Glyphs.d.ts.map +1 -0
- package/dist/components/Glyphs.js +58 -0
- package/dist/components/GridHelper.d.ts +23 -0
- package/dist/components/GridHelper.d.ts.map +1 -0
- package/dist/components/GridHelper.js +36 -0
- package/dist/components/GridsGenerator.d.ts +10 -0
- package/dist/components/GridsGenerator.d.ts.map +1 -0
- package/dist/components/GridsGenerator.js +14 -0
- package/dist/components/HdrPlaylistRenderer.d.ts +10 -0
- package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -0
- package/dist/components/HdrPlaylistRenderer.js +364 -0
- package/dist/components/ImageGeometry.d.ts +13 -0
- package/dist/components/ImageGeometry.d.ts.map +1 -0
- package/dist/components/ImageGeometry.js +62 -0
- package/dist/components/Lensflare.d.ts +12 -0
- package/dist/components/Lensflare.d.ts.map +1 -0
- package/dist/components/Lensflare.js +66 -0
- package/dist/components/Letter.d.ts +19 -0
- package/dist/components/Letter.d.ts.map +1 -0
- package/dist/components/Letter.js +83 -0
- package/dist/components/Letters.d.ts +16 -0
- package/dist/components/Letters.d.ts.map +1 -0
- package/dist/components/Letters.js +18 -0
- package/dist/components/LightObject.d.ts +8 -0
- package/dist/components/LightObject.d.ts.map +1 -0
- package/dist/components/LightObject.js +65 -0
- package/dist/components/LightsManager.d.ts +8 -0
- package/dist/components/LightsManager.d.ts.map +1 -0
- package/dist/components/LightsManager.js +104 -0
- package/dist/components/Lines.d.ts +9 -0
- package/dist/components/Lines.d.ts.map +1 -0
- package/dist/components/Lines.js +19 -0
- package/dist/components/LoadingIndicator.d.ts +10 -0
- package/dist/components/LoadingIndicator.d.ts.map +1 -0
- package/dist/components/LoadingIndicator.js +6 -0
- package/dist/components/MaterialLibrary.d.ts +9 -0
- package/dist/components/MaterialLibrary.d.ts.map +1 -0
- package/dist/components/MaterialLibrary.js +57 -0
- package/dist/components/Moon.d.ts +13 -0
- package/dist/components/Moon.d.ts.map +1 -0
- package/dist/components/Moon.js +66 -0
- package/dist/components/MyGrid.d.ts +15 -0
- package/dist/components/MyGrid.d.ts.map +1 -0
- package/dist/components/MyGrid.js +72 -0
- package/dist/components/ObjectNode.d.ts +13 -0
- package/dist/components/ObjectNode.d.ts.map +1 -0
- package/dist/components/ObjectNode.js +139 -0
- package/dist/components/ObjectNodeApi.d.ts +13 -0
- package/dist/components/ObjectNodeApi.d.ts.map +1 -0
- package/dist/components/ObjectNodeApi.js +18 -0
- package/dist/components/ObjectsRenderer.d.ts +15 -0
- package/dist/components/ObjectsRenderer.d.ts.map +1 -0
- package/dist/components/ObjectsRenderer.js +40 -0
- package/dist/components/ObjectsRendererApi.d.ts +31 -0
- package/dist/components/ObjectsRendererApi.d.ts.map +1 -0
- package/dist/components/ObjectsRendererApi.js +76 -0
- package/dist/components/Ocean.d.ts +8 -0
- package/dist/components/Ocean.d.ts.map +1 -0
- package/dist/components/Ocean.js +169 -0
- package/dist/components/Outline.d.ts +21 -0
- package/dist/components/Outline.d.ts.map +1 -0
- package/dist/components/Outline.js +14 -0
- package/dist/components/ParticlesR3f.d.ts +11 -0
- package/dist/components/ParticlesR3f.d.ts.map +1 -0
- package/dist/components/ParticlesR3f.js +110 -0
- package/dist/components/Path.d.ts +13 -0
- package/dist/components/Path.d.ts.map +1 -0
- package/dist/components/Path.js +41 -0
- package/dist/components/PathGeometry.d.ts +11 -0
- package/dist/components/PathGeometry.d.ts.map +1 -0
- package/dist/components/PathGeometry.js +109 -0
- package/dist/components/PathRenderer.d.ts +12 -0
- package/dist/components/PathRenderer.d.ts.map +1 -0
- package/dist/components/PathRenderer.js +36 -0
- package/dist/components/Planet.d.ts +16 -0
- package/dist/components/Planet.d.ts.map +1 -0
- package/dist/components/Planet.js +60 -0
- package/dist/components/PointCloud.d.ts +10 -0
- package/dist/components/PointCloud.d.ts.map +1 -0
- package/dist/components/PointCloud.js +113 -0
- package/dist/components/ProductionScene.d.ts +5 -0
- package/dist/components/ProductionScene.d.ts.map +1 -0
- package/dist/components/ProductionScene.js +7 -0
- package/dist/components/ProjectLoader.d.ts +16 -0
- package/dist/components/ProjectLoader.d.ts.map +1 -0
- package/dist/components/ProjectLoader.js +85 -0
- package/dist/components/Rain.d.ts +8 -0
- package/dist/components/Rain.d.ts.map +1 -0
- package/dist/components/Rain.js +259 -0
- package/dist/components/RiseLogo.d.ts +19 -0
- package/dist/components/RiseLogo.d.ts.map +1 -0
- package/dist/components/RiseLogo.js +75 -0
- package/dist/components/SceneBuilder.d.ts +5 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -0
- package/dist/components/SceneBuilder.js +133 -0
- package/dist/components/SceneFog.d.ts +8 -0
- package/dist/components/SceneFog.d.ts.map +1 -0
- package/dist/components/SceneFog.js +19 -0
- package/dist/components/Shape.d.ts +5 -0
- package/dist/components/Shape.d.ts.map +1 -0
- package/dist/components/Shape.js +11 -0
- package/dist/components/ShootingStar.d.ts +16 -0
- package/dist/components/ShootingStar.d.ts.map +1 -0
- package/dist/components/ShootingStar.js +92 -0
- package/dist/components/ShootingStars.d.ts +8 -0
- package/dist/components/ShootingStars.d.ts.map +1 -0
- package/dist/components/ShootingStars.js +41 -0
- package/dist/components/SkyController.d.ts +10 -0
- package/dist/components/SkyController.d.ts.map +1 -0
- package/dist/components/SkyController.js +208 -0
- package/dist/components/SkyMesh.d.ts +10 -0
- package/dist/components/SkyMesh.d.ts.map +1 -0
- package/dist/components/SkyMesh.js +36 -0
- package/dist/components/SkySystem.d.ts +32 -0
- package/dist/components/SkySystem.d.ts.map +1 -0
- package/dist/components/SkySystem.js +46 -0
- package/dist/components/Skybox.d.ts +12 -0
- package/dist/components/Skybox.d.ts.map +1 -0
- package/dist/components/Skybox.js +92 -0
- package/dist/components/SolarSystem.d.ts +8 -0
- package/dist/components/SolarSystem.d.ts.map +1 -0
- package/dist/components/SolarSystem.js +77 -0
- package/dist/components/SparklesBurst.d.ts +9 -0
- package/dist/components/SparklesBurst.d.ts.map +1 -0
- package/dist/components/SparklesBurst.js +62 -0
- package/dist/components/Stars.d.ts +15 -0
- package/dist/components/Stars.d.ts.map +1 -0
- package/dist/components/Stars.js +250 -0
- package/dist/components/Sun.d.ts +15 -0
- package/dist/components/Sun.d.ts.map +1 -0
- package/dist/components/Sun.js +7 -0
- package/dist/components/SunCore.d.ts +18 -0
- package/dist/components/SunCore.d.ts.map +1 -0
- package/dist/components/SunCore.js +14 -0
- package/dist/components/SunLight.d.ts +15 -0
- package/dist/components/SunLight.d.ts.map +1 -0
- package/dist/components/SunLight.js +57 -0
- package/dist/components/Text2D.d.ts +9 -0
- package/dist/components/Text2D.d.ts.map +1 -0
- package/dist/components/Text2D.js +56 -0
- package/dist/components/Text3D.d.ts +10 -0
- package/dist/components/Text3D.d.ts.map +1 -0
- package/dist/components/Text3D.js +8 -0
- package/dist/components/VolumePoints.d.ts +19 -0
- package/dist/components/VolumePoints.d.ts.map +1 -0
- package/dist/components/VolumePoints.js +8 -0
- package/dist/components/cursor/AuraCursor.d.ts +6 -0
- package/dist/components/cursor/AuraCursor.d.ts.map +1 -0
- package/dist/components/cursor/AuraCursor.js +30 -0
- package/dist/components/cursor/AuroraCursor.d.ts +6 -0
- package/dist/components/cursor/AuroraCursor.d.ts.map +1 -0
- package/dist/components/cursor/AuroraCursor.js +207 -0
- package/dist/components/cursor/BubblesCursor.d.ts +6 -0
- package/dist/components/cursor/BubblesCursor.d.ts.map +1 -0
- package/dist/components/cursor/BubblesCursor.js +184 -0
- package/dist/components/cursor/CometCursor.d.ts +6 -0
- package/dist/components/cursor/CometCursor.d.ts.map +1 -0
- package/dist/components/cursor/CometCursor.js +191 -0
- package/dist/components/cursor/CrosshairCursor.d.ts +6 -0
- package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -0
- package/dist/components/cursor/CrosshairCursor.js +142 -0
- package/dist/components/cursor/CursorActions.d.ts +8 -0
- package/dist/components/cursor/CursorActions.d.ts.map +1 -0
- package/dist/components/cursor/CursorActions.js +124 -0
- package/dist/components/cursor/CursorController.d.ts +10 -0
- package/dist/components/cursor/CursorController.d.ts.map +1 -0
- package/dist/components/cursor/CursorController.js +5 -0
- package/dist/components/cursor/CursorEffects.d.ts +16 -0
- package/dist/components/cursor/CursorEffects.d.ts.map +1 -0
- package/dist/components/cursor/CursorEffects.js +110 -0
- package/dist/components/cursor/FerrofluidCursor.d.ts +6 -0
- package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -0
- package/dist/components/cursor/FerrofluidCursor.js +102 -0
- package/dist/components/cursor/GlyphRingCursor.d.ts +6 -0
- package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -0
- package/dist/components/cursor/GlyphRingCursor.js +123 -0
- package/dist/components/cursor/LightningCursor.d.ts +6 -0
- package/dist/components/cursor/LightningCursor.d.ts.map +1 -0
- package/dist/components/cursor/LightningCursor.js +28 -0
- package/dist/components/cursor/LiquidMetalCursor.d.ts +6 -0
- package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -0
- package/dist/components/cursor/LiquidMetalCursor.js +61 -0
- package/dist/components/cursor/OrbCursor.d.ts +6 -0
- package/dist/components/cursor/OrbCursor.d.ts.map +1 -0
- package/dist/components/cursor/OrbCursor.js +32 -0
- package/dist/components/cursor/PlasmaWhipCursor.d.ts +6 -0
- package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -0
- package/dist/components/cursor/PlasmaWhipCursor.js +134 -0
- package/dist/components/cursor/SparklesCursor.d.ts +6 -0
- package/dist/components/cursor/SparklesCursor.d.ts.map +1 -0
- package/dist/components/cursor/SparklesCursor.js +151 -0
- package/dist/components/cursor/TeslaCursor.d.ts +6 -0
- package/dist/components/cursor/TeslaCursor.d.ts.map +1 -0
- package/dist/components/cursor/TeslaCursor.js +223 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.js +62 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +114 -0
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/ImplosionAction.js +93 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.js +71 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.js +98 -0
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/RealityTearAction.js +92 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.js +55 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.js +99 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.js +149 -0
- package/dist/components/effects/AuraEffect.d.ts +10 -0
- package/dist/components/effects/AuraEffect.d.ts.map +1 -0
- package/dist/components/effects/AuraEffect.js +127 -0
- package/dist/components/effects/AuroraEffect.d.ts +10 -0
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -0
- package/dist/components/effects/AuroraEffect.js +112 -0
- package/dist/components/effects/BlackHoleEffect.d.ts +10 -0
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -0
- package/dist/components/effects/BlackHoleEffect.js +193 -0
- package/dist/components/effects/ConstellationEffect.d.ts +10 -0
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -0
- package/dist/components/effects/ConstellationEffect.js +189 -0
- package/dist/components/effects/DataStreamEffect.d.ts +10 -0
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -0
- package/dist/components/effects/DataStreamEffect.js +138 -0
- package/dist/components/effects/DnaHelixEffect.d.ts +10 -0
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -0
- package/dist/components/effects/DnaHelixEffect.js +311 -0
- package/dist/components/effects/Fire.d.ts +20 -0
- package/dist/components/effects/Fire.d.ts.map +1 -0
- package/dist/components/effects/Fire.js +208 -0
- package/dist/components/effects/FireEffect.d.ts +10 -0
- package/dist/components/effects/FireEffect.d.ts.map +1 -0
- package/dist/components/effects/FireEffect.js +194 -0
- package/dist/components/effects/ForcefieldEffect.d.ts +10 -0
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -0
- package/dist/components/effects/ForcefieldEffect.js +132 -0
- package/dist/components/effects/HologramEffect.d.ts +10 -0
- package/dist/components/effects/HologramEffect.d.ts.map +1 -0
- package/dist/components/effects/HologramEffect.js +143 -0
- package/dist/components/effects/IceCrystalsEffect.d.ts +10 -0
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -0
- package/dist/components/effects/IceCrystalsEffect.js +190 -0
- package/dist/components/effects/LightningEffect.d.ts +10 -0
- package/dist/components/effects/LightningEffect.d.ts.map +1 -0
- package/dist/components/effects/LightningEffect.js +240 -0
- package/dist/components/effects/MoleculesEffect.d.ts +10 -0
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -0
- package/dist/components/effects/MoleculesEffect.js +173 -0
- package/dist/components/effects/NeuralNetworkEffect.d.ts +10 -0
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -0
- package/dist/components/effects/NeuralNetworkEffect.js +188 -0
- package/dist/components/effects/OrbEffect.d.ts +10 -0
- package/dist/components/effects/OrbEffect.d.ts.map +1 -0
- package/dist/components/effects/OrbEffect.js +291 -0
- package/dist/components/effects/PortalEffect.d.ts +10 -0
- package/dist/components/effects/PortalEffect.d.ts.map +1 -0
- package/dist/components/effects/PortalEffect.js +191 -0
- package/dist/components/effects/ShockwaveEffect.d.ts +10 -0
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -0
- package/dist/components/effects/ShockwaveEffect.js +160 -0
- package/dist/components/effects/SmokePlumeEffect.d.ts +10 -0
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -0
- package/dist/components/effects/SmokePlumeEffect.js +141 -0
- package/dist/components/effects/SmokeRibbon.d.ts +13 -0
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -0
- package/dist/components/effects/SmokeRibbon.js +69 -0
- package/dist/components/effects/SmokeRingEffect.d.ts +10 -0
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -0
- package/dist/components/effects/SmokeRingEffect.js +158 -0
- package/dist/components/effects/VolumetricFogEffect.d.ts +10 -0
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -0
- package/dist/components/effects/VolumetricFogEffect.js +111 -0
- package/dist/components/extractOutline.d.ts +18 -0
- package/dist/components/extractOutline.d.ts.map +1 -0
- package/dist/components/extractOutline.js +47 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +5 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use3driseShader.d.ts +17 -0
- package/dist/hooks/use3driseShader.d.ts.map +1 -0
- package/dist/hooks/use3driseShader.js +100 -0
- package/dist/hooks/useAnimationEvents.d.ts +10 -0
- package/dist/hooks/useAnimationEvents.d.ts.map +1 -0
- package/dist/hooks/useAnimationEvents.js +49 -0
- package/dist/hooks/useCameraAnimation.d.ts +35 -0
- package/dist/hooks/useCameraAnimation.d.ts.map +1 -0
- package/dist/hooks/useCameraAnimation.js +277 -0
- package/dist/hooks/useContinuousEffects.d.ts +15 -0
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -0
- package/dist/hooks/useContinuousEffects.js +177 -0
- package/dist/hooks/useCubeCamera.d.ts +18 -0
- package/dist/hooks/useCubeCamera.d.ts.map +1 -0
- package/dist/hooks/useCubeCamera.js +73 -0
- package/dist/hooks/useEnvironmentEffects.d.ts +12 -0
- package/dist/hooks/useEnvironmentEffects.d.ts.map +1 -0
- package/dist/hooks/useEnvironmentEffects.js +22 -0
- package/dist/hooks/useFrameAnimations.d.ts +24 -0
- package/dist/hooks/useFrameAnimations.d.ts.map +1 -0
- package/dist/hooks/useFrameAnimations.js +217 -0
- package/dist/hooks/useFrameEffects.d.ts +6 -0
- package/dist/hooks/useFrameEffects.d.ts.map +1 -0
- package/dist/hooks/useFrameEffects.js +19 -0
- package/dist/hooks/useGsapAnimation.d.ts +122 -0
- package/dist/hooks/useGsapAnimation.d.ts.map +1 -0
- package/dist/hooks/useGsapAnimation.js +316 -0
- package/dist/hooks/useInteraction.d.ts +12 -0
- package/dist/hooks/useInteraction.d.ts.map +1 -0
- package/dist/hooks/useInteraction.js +273 -0
- package/dist/hooks/useInteractionEffects.d.ts +11 -0
- package/dist/hooks/useInteractionEffects.d.ts.map +1 -0
- package/dist/hooks/useInteractionEffects.js +74 -0
- package/dist/hooks/useKey.d.ts +26 -0
- package/dist/hooks/useKey.d.ts.map +1 -0
- package/dist/hooks/useKey.js +73 -0
- package/dist/hooks/useLightAnimation.d.ts +10 -0
- package/dist/hooks/useLightAnimation.d.ts.map +1 -0
- package/dist/hooks/useLightAnimation.js +34 -0
- package/dist/hooks/useLightHandlers.d.ts +14 -0
- package/dist/hooks/useLightHandlers.d.ts.map +1 -0
- package/dist/hooks/useLightHandlers.js +116 -0
- package/dist/hooks/useLightMouseMove.d.ts +11 -0
- package/dist/hooks/useLightMouseMove.d.ts.map +1 -0
- package/dist/hooks/useLightMouseMove.js +27 -0
- package/dist/hooks/useLightShadow.d.ts +6 -0
- package/dist/hooks/useLightShadow.d.ts.map +1 -0
- package/dist/hooks/useLightShadow.js +63 -0
- package/dist/hooks/useMaterialApplication.d.ts +4 -0
- package/dist/hooks/useMaterialApplication.d.ts.map +1 -0
- package/dist/hooks/useMaterialApplication.js +157 -0
- package/dist/hooks/useMaterialOptions.d.ts +14 -0
- package/dist/hooks/useMaterialOptions.d.ts.map +1 -0
- package/dist/hooks/useMaterialOptions.js +118 -0
- package/dist/hooks/useMaterialUniforms.d.ts +18 -0
- package/dist/hooks/useMaterialUniforms.d.ts.map +1 -0
- package/dist/hooks/useMaterialUniforms.js +96 -0
- package/dist/hooks/useMeshController.d.ts +3 -0
- package/dist/hooks/useMeshController.d.ts.map +1 -0
- package/dist/hooks/useMeshController.js +168 -0
- package/dist/hooks/useMouseHandlers.d.ts +8 -0
- package/dist/hooks/useMouseHandlers.d.ts.map +1 -0
- package/dist/hooks/useMouseHandlers.js +47 -0
- package/dist/hooks/useNumericAnimation.d.ts +5 -0
- package/dist/hooks/useNumericAnimation.d.ts.map +1 -0
- package/dist/hooks/useNumericAnimation.js +42 -0
- package/dist/hooks/useObjectAnimation.d.ts +13 -0
- package/dist/hooks/useObjectAnimation.d.ts.map +1 -0
- package/dist/hooks/useObjectAnimation.js +35 -0
- package/dist/hooks/useObjectEdges.d.ts +3 -0
- package/dist/hooks/useObjectEdges.d.ts.map +1 -0
- package/dist/hooks/useObjectEdges.js +199 -0
- package/dist/hooks/useObjectEffects.d.ts +23 -0
- package/dist/hooks/useObjectEffects.d.ts.map +1 -0
- package/dist/hooks/useObjectEffects.js +162 -0
- package/dist/hooks/useOrbitControls.d.ts +7 -0
- package/dist/hooks/useOrbitControls.d.ts.map +1 -0
- package/dist/hooks/useOrbitControls.js +9 -0
- package/dist/hooks/useOutline.d.ts +9 -0
- package/dist/hooks/useOutline.d.ts.map +1 -0
- package/dist/hooks/useOutline.js +14 -0
- package/dist/hooks/useParticlePositions.d.ts +19 -0
- package/dist/hooks/useParticlePositions.d.ts.map +1 -0
- package/dist/hooks/useParticlePositions.js +56 -0
- package/dist/hooks/useParticlesColors.d.ts +14 -0
- package/dist/hooks/useParticlesColors.d.ts.map +1 -0
- package/dist/hooks/useParticlesColors.js +27 -0
- package/dist/hooks/useParticlesTextures.d.ts +10 -0
- package/dist/hooks/useParticlesTextures.d.ts.map +1 -0
- package/dist/hooks/useParticlesTextures.js +23 -0
- package/dist/hooks/usePathAnimation.d.ts +26 -0
- package/dist/hooks/usePathAnimation.d.ts.map +1 -0
- package/dist/hooks/usePathAnimation.js +130 -0
- package/dist/hooks/useSequenceAnimation.d.ts +14 -0
- package/dist/hooks/useSequenceAnimation.d.ts.map +1 -0
- package/dist/hooks/useSequenceAnimation.js +260 -0
- package/dist/hooks/useShadowApplication.d.ts +3 -0
- package/dist/hooks/useShadowApplication.d.ts.map +1 -0
- package/dist/hooks/useShadowApplication.js +31 -0
- package/dist/hooks/useShapeGeometry.d.ts +8 -0
- package/dist/hooks/useShapeGeometry.d.ts.map +1 -0
- package/dist/hooks/useShapeGeometry.js +12 -0
- package/dist/hooks/useSkyAnimation.d.ts +13 -0
- package/dist/hooks/useSkyAnimation.d.ts.map +1 -0
- package/dist/hooks/useSkyAnimation.js +36 -0
- package/dist/hooks/useSkySystem.d.ts +25 -0
- package/dist/hooks/useSkySystem.d.ts.map +1 -0
- package/dist/hooks/useSkySystem.js +59 -0
- package/dist/hooks/useSkyUniforms.d.ts +18 -0
- package/dist/hooks/useSkyUniforms.d.ts.map +1 -0
- package/dist/hooks/useSkyUniforms.js +71 -0
- package/dist/hooks/useTransformControls.d.ts +6 -0
- package/dist/hooks/useTransformControls.d.ts.map +1 -0
- package/dist/hooks/useTransformControls.js +111 -0
- package/dist/hooks/useVolumePoints.d.ts +9 -0
- package/dist/hooks/useVolumePoints.d.ts.map +1 -0
- package/dist/hooks/useVolumePoints.js +22 -0
- package/dist/hooks/useWaterEnvironment.d.ts +5 -0
- package/dist/hooks/useWaterEnvironment.d.ts.map +1 -0
- package/dist/hooks/useWaterEnvironment.js +27 -0
- package/dist/hooks/useWaterReflections.d.ts +18 -0
- package/dist/hooks/useWaterReflections.d.ts.map +1 -0
- package/dist/hooks/useWaterReflections.js +84 -0
- package/dist/index.d.ts +146 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/services/AnimationsManager.d.ts +33 -0
- package/dist/services/AnimationsManager.d.ts.map +1 -0
- package/dist/services/AnimationsManager.js +58 -0
- package/dist/services/FontManager.d.ts +32 -0
- package/dist/services/FontManager.d.ts.map +1 -0
- package/dist/services/FontManager.js +76 -0
- package/dist/services/TexturesManager.d.ts +17 -0
- package/dist/services/TexturesManager.d.ts.map +1 -0
- package/dist/services/TexturesManager.js +48 -0
- package/dist/shaders/RainMaterial.d.ts +34 -0
- package/dist/shaders/RainMaterial.d.ts.map +1 -0
- package/dist/shaders/RainMaterial.js +56 -0
- package/dist/shaders/ShaderEffectsMaterial.d.ts +228 -0
- package/dist/shaders/ShaderEffectsMaterial.d.ts.map +1 -0
- package/dist/shaders/ShaderEffectsMaterial.js +233 -0
- package/dist/shaders/ShootingStarMaterial.d.ts +14 -0
- package/dist/shaders/ShootingStarMaterial.d.ts.map +1 -0
- package/dist/shaders/ShootingStarMaterial.js +33 -0
- package/dist/shaders/SkyboxMaterial.d.ts +38 -0
- package/dist/shaders/SkyboxMaterial.d.ts.map +1 -0
- package/dist/shaders/SkyboxMaterial.js +57 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts +2 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts.map +1 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.js +115 -0
- package/dist/utils/CameraSingleton.d.ts +43 -0
- package/dist/utils/CameraSingleton.d.ts.map +1 -0
- package/dist/utils/CameraSingleton.js +199 -0
- package/dist/utils/anchorUtils.d.ts +10 -0
- package/dist/utils/anchorUtils.d.ts.map +1 -0
- package/dist/utils/anchorUtils.js +13 -0
- package/dist/utils/cursorPicking.d.ts +8 -0
- package/dist/utils/cursorPicking.d.ts.map +1 -0
- package/dist/utils/cursorPicking.js +35 -0
- package/dist/utils/extractOutline.d.ts +18 -0
- package/dist/utils/extractOutline.d.ts.map +1 -0
- package/dist/utils/extractOutline.js +47 -0
- package/dist/utils/frameAnimations.d.ts +49 -0
- package/dist/utils/frameAnimations.d.ts.map +1 -0
- package/dist/utils/frameAnimations.js +213 -0
- package/dist/utils/handleGenerativeEffectsAnimations.d.ts +5 -0
- package/dist/utils/handleGenerativeEffectsAnimations.d.ts.map +1 -0
- package/dist/utils/handleGenerativeEffectsAnimations.js +268 -0
- package/dist/utils/hasHoverAnimation.d.ts +3 -0
- package/dist/utils/hasHoverAnimation.d.ts.map +1 -0
- package/dist/utils/hasHoverAnimation.js +15 -0
- package/dist/utils/materialUtils.d.ts +23 -0
- package/dist/utils/materialUtils.d.ts.map +1 -0
- package/dist/utils/materialUtils.js +81 -0
- package/dist/utils/particleAnimations.d.ts +3 -0
- package/dist/utils/particleAnimations.d.ts.map +1 -0
- package/dist/utils/particleAnimations.js +17 -0
- package/dist/utils/sampleVolume.d.ts +21 -0
- package/dist/utils/sampleVolume.d.ts.map +1 -0
- package/dist/utils/sampleVolume.js +44 -0
- package/dist/utils/sceneQuery.d.ts +9 -0
- package/dist/utils/sceneQuery.d.ts.map +1 -0
- package/dist/utils/sceneQuery.js +22 -0
- package/dist/utils/shaderUtils.d.ts +6 -0
- package/dist/utils/shaderUtils.d.ts.map +1 -0
- package/dist/utils/shaderUtils.js +151 -0
- package/dist/utils/shapes.d.ts +74 -0
- package/dist/utils/shapes.d.ts.map +1 -0
- package/dist/utils/shapes.js +443 -0
- package/dist/utils/textEffects.d.ts +31 -0
- package/dist/utils/textEffects.d.ts.map +1 -0
- package/dist/utils/textEffects.js +61 -0
- package/dist/utils/utils3d.d.ts +7 -0
- package/dist/utils/utils3d.d.ts.map +1 -0
- package/dist/utils/utils3d.js +34 -0
- package/package.json +44 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { useFrame } from '@react-three/fiber';
|
|
3
|
+
import { AnimationsManager, findById } from '@3driseai/3drise-core';
|
|
4
|
+
import { useAnimationEvents } from './useAnimationEvents.js';
|
|
5
|
+
import { usePathAnimation } from './usePathAnimation.js';
|
|
6
|
+
import { snapshotMaterialValues, interpolateMaterialProps } from '../utils/materialUtils.js';
|
|
7
|
+
const DEBUG_SEQUENCE_ANIMATION = true;
|
|
8
|
+
const debugLog = (...args) => {
|
|
9
|
+
if (DEBUG_SEQUENCE_ANIMATION) {
|
|
10
|
+
console.log('[useSequenceAnimation]', ...args);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
// Helpers
|
|
15
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
16
|
+
const TRANSFORM_KEYS = new Set(['position', 'rotation', 'scale', 'visible']);
|
|
17
|
+
function lerp(a, b, t) {
|
|
18
|
+
return a + (b - a) * t;
|
|
19
|
+
}
|
|
20
|
+
function lerpVec3(a, b, t) {
|
|
21
|
+
return [lerp(a[0], b[0], t), lerp(a[1], b[1], t), lerp(a[2], b[2], t)];
|
|
22
|
+
}
|
|
23
|
+
/** Get material-related properties from a transition properties record */
|
|
24
|
+
function extractMaterialProps(props) {
|
|
25
|
+
if (!props)
|
|
26
|
+
return {};
|
|
27
|
+
return Object.fromEntries(Object.entries(props).filter(([k]) => !TRANSFORM_KEYS.has(k)));
|
|
28
|
+
}
|
|
29
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
30
|
+
// Hook
|
|
31
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
32
|
+
/**
|
|
33
|
+
* useSequenceAnimation
|
|
34
|
+
*
|
|
35
|
+
* Subscribes to AnimationsManager step events and, for each frame while a step
|
|
36
|
+
* is active, interpolates both transform AND material properties on the given
|
|
37
|
+
* object. Path-based transitions are delegated to usePathAnimation.
|
|
38
|
+
*
|
|
39
|
+
* Designed to be called inside useObjectAnimation so that AnimatedObject stays
|
|
40
|
+
* a thin group wrapper.
|
|
41
|
+
*/
|
|
42
|
+
export const useSequenceAnimation = (objectId, objectRef) => {
|
|
43
|
+
const { startPathAnimation, updatePathAnimation, stopPathAnimation, isAnimating: isPathAnimating } = usePathAnimation();
|
|
44
|
+
const resolveObject = () => {
|
|
45
|
+
const resolved = objectRef ?? (objectId ? findById(objectId) : null);
|
|
46
|
+
// console.log('Resolved object for sequence animation', {
|
|
47
|
+
// objectId,
|
|
48
|
+
// hasRefArg: !!objectRef,
|
|
49
|
+
// resolved: resolved ? { name: resolved.name, id: resolved.userData?.id } : null,
|
|
50
|
+
// });
|
|
51
|
+
return resolved;
|
|
52
|
+
};
|
|
53
|
+
// Active step state. Null = no sequence step currently animating.
|
|
54
|
+
const stepRef = useRef(null);
|
|
55
|
+
// Progress 0-1; flips to 1 when done so useFrame short-circuits
|
|
56
|
+
const progressRef = useRef(1);
|
|
57
|
+
const updateProgressRef = (p) => {
|
|
58
|
+
progressRef.current = p;
|
|
59
|
+
// console.log('Progress update', { objectId, progress: p });
|
|
60
|
+
};
|
|
61
|
+
const updateStepRef = (state) => {
|
|
62
|
+
stepRef.current = state;
|
|
63
|
+
};
|
|
64
|
+
// ── Event listener ──────────────────────────────────────────────────────────
|
|
65
|
+
useAnimationEvents({
|
|
66
|
+
onStepStart: (event) => {
|
|
67
|
+
if (!objectId || !event.step?.transitions) {
|
|
68
|
+
// debugLog('stepStart ignored: missing objectId or transitions', {
|
|
69
|
+
// objectId,
|
|
70
|
+
// hasTransitions: !!event.step?.transitions,
|
|
71
|
+
// sequenceId: event.sequenceId,
|
|
72
|
+
// stepIndex: event.stepIndex,
|
|
73
|
+
// });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// debugLog('stepStart received', {
|
|
77
|
+
// objectId,
|
|
78
|
+
// sequenceId: event.sequenceId,
|
|
79
|
+
// stepIndex: event.stepIndex,
|
|
80
|
+
// transitionStates: event.step.transitions.map(t => t.state),
|
|
81
|
+
// resolvedObject: resolvedObject ? {
|
|
82
|
+
// name: resolvedObject.name,
|
|
83
|
+
// id: resolvedObject.userData?.id,
|
|
84
|
+
// } : null,
|
|
85
|
+
// });
|
|
86
|
+
// Find the transition targeting this object
|
|
87
|
+
const transitionIndex = event.step.transitions.findIndex(t => t.state === objectId);
|
|
88
|
+
if (transitionIndex === -1) {
|
|
89
|
+
// debugLog('no matching transition for objectId', {
|
|
90
|
+
// objectId,
|
|
91
|
+
// availableStates: event.step.transitions.map(t => t.state),
|
|
92
|
+
// });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
console.log('TRANSTITION START', objectId);
|
|
96
|
+
const resolvedObject = resolveObject();
|
|
97
|
+
console.log(objectId, resolvedObject?.name);
|
|
98
|
+
const transition = event.step.transitions[transitionIndex];
|
|
99
|
+
const stagger = event.step.stagger || 0;
|
|
100
|
+
const staggerOffsetMs = transitionIndex * stagger * 1000;
|
|
101
|
+
const d = event.step.duration || 1;
|
|
102
|
+
const ease = event.step.ease || 'linear';
|
|
103
|
+
const { properties, pathId = null } = transition;
|
|
104
|
+
console.log('Starting sequence step', resolvedObject?.name, properties);
|
|
105
|
+
// debugLog('matched transition', {
|
|
106
|
+
// objectId,
|
|
107
|
+
// pathId,
|
|
108
|
+
// duration: d,
|
|
109
|
+
// ease,
|
|
110
|
+
// fromKeys: Object.keys(properties.from || {}),
|
|
111
|
+
// toKeys: Object.keys(properties.to || {}),
|
|
112
|
+
// });
|
|
113
|
+
// Visibility shortcut
|
|
114
|
+
if (properties.to?.visible === false) {
|
|
115
|
+
if (resolvedObject)
|
|
116
|
+
resolvedObject.visible = false;
|
|
117
|
+
// updateStepRef(null);
|
|
118
|
+
updateProgressRef(1);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
if (resolvedObject)
|
|
123
|
+
resolvedObject.visible = true;
|
|
124
|
+
}
|
|
125
|
+
// if (resolvedObject) resolvedObject.visible = true;
|
|
126
|
+
// Snapshot current object transform as defaults
|
|
127
|
+
const cur = resolvedObject;
|
|
128
|
+
const curPos = cur
|
|
129
|
+
? [cur.position.x, cur.position.y, cur.position.z]
|
|
130
|
+
: [0, 0, 0];
|
|
131
|
+
const curRot = cur
|
|
132
|
+
? [cur.rotation.x, cur.rotation.y, cur.rotation.z]
|
|
133
|
+
: [0, 0, 0];
|
|
134
|
+
const curSca = cur
|
|
135
|
+
? [cur.scale.x, cur.scale.y, cur.scale.z]
|
|
136
|
+
: [1, 1, 1];
|
|
137
|
+
const fp = properties.from;
|
|
138
|
+
const tp = properties.to;
|
|
139
|
+
// Build material from/to — snapshot live values for any key missing a `from`
|
|
140
|
+
// so interpolation always has a defined baseline instead of snapping.
|
|
141
|
+
const materialToProps = extractMaterialProps(tp);
|
|
142
|
+
const materialFromExplicit = extractMaterialProps(fp);
|
|
143
|
+
const missingFromKeys = Object.keys(materialToProps).filter(k => !(k in materialFromExplicit));
|
|
144
|
+
const snapshotted = (resolvedObject && missingFromKeys.length > 0)
|
|
145
|
+
? snapshotMaterialValues(resolvedObject, missingFromKeys)
|
|
146
|
+
: {};
|
|
147
|
+
const materialFrom = { ...materialFromExplicit };
|
|
148
|
+
// debugLog('material from/to', {
|
|
149
|
+
// objectId,
|
|
150
|
+
// materialFromExplicit,
|
|
151
|
+
// snapshotted,
|
|
152
|
+
// materialFrom,
|
|
153
|
+
// materialToProps,
|
|
154
|
+
// });
|
|
155
|
+
updateStepRef({
|
|
156
|
+
startTime: performance.now() + staggerOffsetMs,
|
|
157
|
+
duration: d,
|
|
158
|
+
ease,
|
|
159
|
+
fromPosition: (fp?.position ?? curPos),
|
|
160
|
+
toPosition: (tp?.position ?? curPos),
|
|
161
|
+
fromRotation: (fp?.rotation ?? curRot),
|
|
162
|
+
toRotation: (tp?.rotation ?? curRot),
|
|
163
|
+
fromScale: (fp?.scale ?? curSca),
|
|
164
|
+
toScale: (tp?.scale ?? curSca),
|
|
165
|
+
materialFrom,
|
|
166
|
+
materialTo: materialToProps,
|
|
167
|
+
visibilityOverride: null,
|
|
168
|
+
pathId,
|
|
169
|
+
});
|
|
170
|
+
// console.log(stepRef.current)
|
|
171
|
+
updateProgressRef(0);
|
|
172
|
+
if (pathId) {
|
|
173
|
+
debugLog('starting path animation', { objectId, pathId, duration: d, ease });
|
|
174
|
+
startPathAnimation(pathId, d, { ease });
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
stopPathAnimation();
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
onStepEnd: (event) => {
|
|
181
|
+
// Only clear state if this step end targets this object
|
|
182
|
+
if (!objectId || !event.step?.transitions)
|
|
183
|
+
return;
|
|
184
|
+
const isForThisObject = event.step.transitions.some(t => t.state === objectId);
|
|
185
|
+
if (!isForThisObject)
|
|
186
|
+
return;
|
|
187
|
+
// debugLog('stepEnd received', {
|
|
188
|
+
// objectId,
|
|
189
|
+
// sequenceId: event.sequenceId,
|
|
190
|
+
// stepIndex: event.stepIndex,
|
|
191
|
+
// });
|
|
192
|
+
// Let useFrame finish the last frame at p=1 naturally; just clear step
|
|
193
|
+
// after a microtask so the final interpolated position is applied.
|
|
194
|
+
// Promise.resolve().then(() => {
|
|
195
|
+
// updateStepRef(null);
|
|
196
|
+
// updateProgressRef(1);
|
|
197
|
+
// });
|
|
198
|
+
},
|
|
199
|
+
onSequenceEnd: (event) => {
|
|
200
|
+
// Clear any lingering step state when the sequence ends, which is a good
|
|
201
|
+
// safety measure in case of any timing issues with step end events.
|
|
202
|
+
if (!objectId)
|
|
203
|
+
return;
|
|
204
|
+
const isForThisObject = event.sequence.steps.some(s => s.transitions.some(t => t.state === objectId));
|
|
205
|
+
if (!isForThisObject)
|
|
206
|
+
return;
|
|
207
|
+
debugLog('sequenceEnd received', { objectId, sequenceId: event.sequenceId });
|
|
208
|
+
updateStepRef(null);
|
|
209
|
+
updateProgressRef(1);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
// ── Per-frame interpolation ─────────────────────────────────────────────────
|
|
213
|
+
useFrame((_state, delta) => {
|
|
214
|
+
const resolvedObject = resolveObject();
|
|
215
|
+
// Only skip if truly finished (p>=1). During stagger wait, p=0 and we still need to apply fromPosition.
|
|
216
|
+
// console.log(stepRef.current)
|
|
217
|
+
if (!stepRef.current || !resolvedObject)
|
|
218
|
+
return;
|
|
219
|
+
const step = stepRef.current;
|
|
220
|
+
// Time-based progress drives property interpolation regardless of transform mode.
|
|
221
|
+
const p = AnimationsManager.getProgressFromTime(step.startTime, step.duration, step.ease);
|
|
222
|
+
// console.log(p)
|
|
223
|
+
// updateProgressRef(p);
|
|
224
|
+
// Path-based: delegate to usePathAnimation
|
|
225
|
+
if (step.pathId) {
|
|
226
|
+
const still = updatePathAnimation(delta, resolvedObject);
|
|
227
|
+
if (!still) {
|
|
228
|
+
updateProgressRef(1);
|
|
229
|
+
updateStepRef(null);
|
|
230
|
+
}
|
|
231
|
+
// Keep scale interpolation active while path controls position/rotation.
|
|
232
|
+
const sca = lerpVec3(step.fromScale, step.toScale, p);
|
|
233
|
+
resolvedObject.scale.set(...sca);
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
// — Transform —
|
|
237
|
+
const pos = lerpVec3(step.fromPosition, step.toPosition, p);
|
|
238
|
+
const rot = lerpVec3(step.fromRotation, step.toRotation, p);
|
|
239
|
+
const sca = lerpVec3(step.fromScale, step.toScale, p);
|
|
240
|
+
resolvedObject.position.set(...pos);
|
|
241
|
+
resolvedObject.rotation.set(...rot);
|
|
242
|
+
resolvedObject.scale.set(...sca);
|
|
243
|
+
}
|
|
244
|
+
if (p === 0 || p >= 0.99) {
|
|
245
|
+
// debugLog('frame progress', {
|
|
246
|
+
// objectId,
|
|
247
|
+
// progress: p,
|
|
248
|
+
// materialKeys: Object.keys(step.materialTo),
|
|
249
|
+
// pathId: step.pathId,
|
|
250
|
+
// });
|
|
251
|
+
}
|
|
252
|
+
// — Material properties —
|
|
253
|
+
interpolateMaterialProps(resolvedObject, step.materialFrom, step.materialTo, p);
|
|
254
|
+
if (p >= 1) {
|
|
255
|
+
updateProgressRef(1);
|
|
256
|
+
// updateStepRef(null);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
export default useSequenceAnimation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShadowApplication.d.ts","sourceRoot":"","sources":["../../src/hooks/useShadowApplication.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,eAAO,MAAM,oBAAoB,GAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,SAAS,EAAE,YAAY,OAAO,GAAG,SAAS,EAAE,eAAe,OAAO,GAAG,SAAS,EAAE,aAAa,OAAO,KAAG,IAalK,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// useShadowApplication — applies castShadow / receiveShadow to a subtree
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Traverses the wrapper Object3D and sets `castShadow` / `receiveShadow` on
|
|
6
|
+
// every mesh descendant. Re-runs when the wrapper ref, castShadow, or
|
|
7
|
+
// receiveShadow value changes.
|
|
8
|
+
//
|
|
9
|
+
// Note on lazy-loaded models: GLTF children mount asynchronously after the
|
|
10
|
+
// wrapper ref is bound. Since `obj` (meshRef.current) is the same reference
|
|
11
|
+
// before and after load, the effect won't re-run on its own when those
|
|
12
|
+
// children appear. Callers can pass `triggerKey` (e.g. a mount-completion
|
|
13
|
+
// counter from the model loader) to force re-application when async meshes
|
|
14
|
+
// arrive.
|
|
15
|
+
//
|
|
16
|
+
import { useEffect } from 'react';
|
|
17
|
+
import { traverseSkippingEdgesAndEffects } from '@3driseai/3drise-core';
|
|
18
|
+
export const useShadowApplication = (obj, castShadow, receiveShadow, triggerKey) => {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!obj)
|
|
21
|
+
return;
|
|
22
|
+
const cast = castShadow ?? false;
|
|
23
|
+
const receive = receiveShadow ?? false;
|
|
24
|
+
traverseSkippingEdgesAndEffects(obj, true, (child) => {
|
|
25
|
+
if (child.isMesh) {
|
|
26
|
+
child.castShadow = cast;
|
|
27
|
+
child.receiveShadow = receive;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}, [obj, castShadow, receiveShadow, triggerKey]);
|
|
31
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ShapeName, ShapeOptions } from '../utils//shapes';
|
|
2
|
+
import { BufferGeometry } from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Build (and memoize) a normalized geometry for a registered shape.
|
|
5
|
+
* The previous geometry is disposed whenever inputs change or on unmount.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useShapeGeometry(shape: ShapeName, options: ShapeOptions): BufferGeometry;
|
|
8
|
+
//# sourceMappingURL=useShapeGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShapeGeometry.d.ts","sourceRoot":"","sources":["../../src/hooks/useShapeGeometry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,GAAG,cAAc,CAKxF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect, useMemo } from 'react';
|
|
2
|
+
import { shapeGenerators } from '../utils//shapes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build (and memoize) a normalized geometry for a registered shape.
|
|
5
|
+
* The previous geometry is disposed whenever inputs change or on unmount.
|
|
6
|
+
*/
|
|
7
|
+
export function useShapeGeometry(shape, options) {
|
|
8
|
+
// const { curveSegments, subdivisions, points, outer, inner, bevelThickness, bevelSize, bevelSegments, sides } = options;
|
|
9
|
+
const geometry = useMemo(() => shapeGenerators[shape](options), [shape, options]);
|
|
10
|
+
useEffect(() => () => geometry.dispose(), [geometry]);
|
|
11
|
+
return geometry;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SkySettings } from "@3driseai/3drise-core";
|
|
2
|
+
export interface SkyAnimValues {
|
|
3
|
+
turbidity?: number;
|
|
4
|
+
rayleigh?: number;
|
|
5
|
+
mieCoefficient?: number;
|
|
6
|
+
mieDirectionalG?: number;
|
|
7
|
+
elevation?: number;
|
|
8
|
+
azimuth?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function useSkyAnimation(): {
|
|
11
|
+
animateSkyTransition: (from: SkyAnimValues, to: SkyAnimValues, onUpdate: (s: Partial<SkySettings>) => void, onComplete: (s: SkyAnimValues) => void, duration?: number) => void;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useSkyAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSkyAnimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyAnimation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,MAAM,WAAW,aAAa;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,eAAe,IAAI;IAC3B,oBAAoB,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAClL,CA8BJ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
import { useFrame } from '@react-three/fiber';
|
|
3
|
+
const SKY_NUMERIC_KEYS = [
|
|
4
|
+
'turbidity', 'rayleigh', 'mieCoefficient', 'mieDirectionalG', 'elevation', 'azimuth',
|
|
5
|
+
];
|
|
6
|
+
export function useSkyAnimation() {
|
|
7
|
+
const animRef = useRef(null);
|
|
8
|
+
useFrame((_, delta) => {
|
|
9
|
+
if (!animRef.current)
|
|
10
|
+
return;
|
|
11
|
+
const anim = animRef.current;
|
|
12
|
+
anim.elapsed += delta;
|
|
13
|
+
const t = Math.min(1, anim.elapsed / anim.duration);
|
|
14
|
+
const st = t * t * (3 - 2 * t); // smoothstep
|
|
15
|
+
const lerp = (a, b) => a + (b - a) * st;
|
|
16
|
+
// Only interpolate keys that are present in `to` — avoids NaN on undefined
|
|
17
|
+
const update = {};
|
|
18
|
+
for (const key of SKY_NUMERIC_KEYS) {
|
|
19
|
+
const toVal = anim.to[key];
|
|
20
|
+
if (toVal === undefined)
|
|
21
|
+
continue;
|
|
22
|
+
const fromVal = anim.from[key];
|
|
23
|
+
update[key] = fromVal !== undefined ? lerp(fromVal, toVal) : toVal;
|
|
24
|
+
}
|
|
25
|
+
anim.onUpdate(update);
|
|
26
|
+
if (t >= 1) {
|
|
27
|
+
anim.onComplete(anim.to);
|
|
28
|
+
animRef.current = null;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const animateSkyTransition = useCallback((from, to, onUpdate, onComplete, duration = 3) => {
|
|
32
|
+
console.log('Initiating sky animation', { from, to, duration });
|
|
33
|
+
animRef.current = { from, to, duration, elapsed: 0, onUpdate, onComplete };
|
|
34
|
+
}, []);
|
|
35
|
+
return { animateSkyTransition };
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
import type { SkyTimeState, TimeOfDayLabel, TimeSettings } from '@3driseai/3drise-core';
|
|
3
|
+
export type { SkyTimeState, TimeOfDayLabel };
|
|
4
|
+
export interface UseSkySystemOptions {
|
|
5
|
+
timeSettings: TimeSettings;
|
|
6
|
+
onTimeUpdate?: (state: SkyTimeState) => void;
|
|
7
|
+
onTimeOfDayChange?: (timeOfDay: string, elapsedTime: number) => void;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseSkySystemReturn {
|
|
11
|
+
timeInHours: number;
|
|
12
|
+
normalizedTime: number;
|
|
13
|
+
isDaytime: boolean;
|
|
14
|
+
timeOfDay: string;
|
|
15
|
+
sunElevation: number;
|
|
16
|
+
sunAzimuth: number;
|
|
17
|
+
sunDirection: THREE.Vector3;
|
|
18
|
+
setTime: (hours: number, minutes?: number) => void;
|
|
19
|
+
getTime: () => Date;
|
|
20
|
+
getTimeOfDay: () => string;
|
|
21
|
+
getSunDirection: () => THREE.Vector3;
|
|
22
|
+
}
|
|
23
|
+
export declare function useSkySystem(options: UseSkySystemOptions): UseSkySystemReturn;
|
|
24
|
+
export default useSkySystem;
|
|
25
|
+
//# sourceMappingURL=useSkySystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSkySystem.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkySystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACxF,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE7C,MAAM,WAAW,mBAAmB;IAChC,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC;IAC5B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;CACxC;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAsD7E;AACD,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useRef, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
2
|
+
import { useFrame } from '@react-three/fiber';
|
|
3
|
+
import { skySystemManager } from '@3driseai/3drise-core';
|
|
4
|
+
export function useSkySystem(options) {
|
|
5
|
+
const { timeSettings, onTimeUpdate, onTimeOfDayChange, enabled = true } = options;
|
|
6
|
+
const previousTimeOfDayRef = useRef(null);
|
|
7
|
+
// Sync time settings to the manager whenever they change.
|
|
8
|
+
// useLayoutEffect ensures the manager is registered before useFrame's
|
|
9
|
+
// first rAF callback runs (regular useEffect runs after paint, too late).
|
|
10
|
+
useLayoutEffect(() => {
|
|
11
|
+
skySystemManager.setTimeSettings(timeSettings);
|
|
12
|
+
}, [timeSettings]);
|
|
13
|
+
// Manual time mode: respond immediately when timeOfDay changes
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!enabled || !timeSettings.enabled || timeSettings.autoAnimate)
|
|
16
|
+
return;
|
|
17
|
+
const state = skySystemManager.getStateByTime(timeSettings.timeOfDay);
|
|
18
|
+
if (previousTimeOfDayRef.current !== null &&
|
|
19
|
+
previousTimeOfDayRef.current !== state.timeOfDay) {
|
|
20
|
+
onTimeOfDayChange?.(state.timeOfDay, state.elapsedTime);
|
|
21
|
+
}
|
|
22
|
+
previousTimeOfDayRef.current = state.timeOfDay;
|
|
23
|
+
onTimeUpdate?.(state);
|
|
24
|
+
}, [timeSettings.timeOfDay, timeSettings.enabled, timeSettings.autoAnimate, enabled, onTimeUpdate, onTimeOfDayChange]);
|
|
25
|
+
// Auto-animate mode: read state every frame (SkySystem or user is responsible for ticking)
|
|
26
|
+
useFrame(() => {
|
|
27
|
+
if (!enabled || !timeSettings.enabled || !timeSettings.autoAnimate)
|
|
28
|
+
return;
|
|
29
|
+
const state = skySystemManager.getState();
|
|
30
|
+
// console.log(state.timeInHours)
|
|
31
|
+
if (previousTimeOfDayRef.current !== null &&
|
|
32
|
+
previousTimeOfDayRef.current !== state.timeOfDay) {
|
|
33
|
+
onTimeOfDayChange?.(state.timeOfDay, state.elapsedTime);
|
|
34
|
+
}
|
|
35
|
+
previousTimeOfDayRef.current = state.timeOfDay;
|
|
36
|
+
onTimeUpdate?.(state);
|
|
37
|
+
});
|
|
38
|
+
const setTime = useCallback((hours, minutes = 0) => {
|
|
39
|
+
skySystemManager.setTime(hours, minutes);
|
|
40
|
+
}, []);
|
|
41
|
+
const getTime = useCallback(() => skySystemManager.getTime(), []);
|
|
42
|
+
const getTimeOfDay = useCallback(() => skySystemManager.getTimeOfDay(), []);
|
|
43
|
+
const getSunDirection = useCallback(() => skySystemManager.getSunDirection(), []);
|
|
44
|
+
const state = skySystemManager.getState();
|
|
45
|
+
return {
|
|
46
|
+
timeInHours: state.timeInHours,
|
|
47
|
+
normalizedTime: state.normalizedTime,
|
|
48
|
+
isDaytime: state.isDaytime,
|
|
49
|
+
timeOfDay: state.timeOfDay,
|
|
50
|
+
sunElevation: state.sunElevation,
|
|
51
|
+
sunAzimuth: state.sunAzimuth,
|
|
52
|
+
sunDirection: state.sunDirection,
|
|
53
|
+
setTime,
|
|
54
|
+
getTime,
|
|
55
|
+
getTimeOfDay,
|
|
56
|
+
getSunDirection,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export default useSkySystem;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SkySettings } from '@3driseai/3drise-core';
|
|
2
|
+
import { Vector3 } from "three";
|
|
3
|
+
export declare function useSkyUniforms(): {
|
|
4
|
+
updateUniforms: (settings: Partial<SkySettings>) => void;
|
|
5
|
+
getCurrentValues: () => {
|
|
6
|
+
elevation: number;
|
|
7
|
+
azimuth: number;
|
|
8
|
+
turbidity: any;
|
|
9
|
+
rayleigh: any;
|
|
10
|
+
mieCoefficient: any;
|
|
11
|
+
mieDirectionalG: any;
|
|
12
|
+
} | null;
|
|
13
|
+
getElevationAndAzimuth: (sunPosition: Vector3) => {
|
|
14
|
+
elevation: number;
|
|
15
|
+
azimuth: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useSkyUniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSkyUniforms.d.ts","sourceRoot":"","sources":["../../src/hooks/useSkyUniforms.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,wBAAgB,cAAc,IAAI;IAC1B,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,gBAAgB,EAAE,MAAM;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,GAAG,CAAC;QACf,QAAQ,EAAE,GAAG,CAAC;QACd,cAAc,EAAE,GAAG,CAAC;QACpB,eAAe,EAAE,GAAG,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,sBAAsB,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK;QAC9C,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;CACL,CAmEJ"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
import { createSunPosition } from '../utils/utils3d.js';
|
|
3
|
+
import { findById } from '@3driseai/3drise-core';
|
|
4
|
+
export function useSkyUniforms() {
|
|
5
|
+
const skyMeshRef = useRef(null);
|
|
6
|
+
const getSkyRef = useCallback(() => {
|
|
7
|
+
if (skyMeshRef.current)
|
|
8
|
+
return skyMeshRef.current;
|
|
9
|
+
// let found: Mesh | null = null;
|
|
10
|
+
// scene.traverse((obj) => {
|
|
11
|
+
// if (!found && obj.userData?.id === '3drise-sky') {
|
|
12
|
+
// found = obj as Mesh;
|
|
13
|
+
// }
|
|
14
|
+
// });
|
|
15
|
+
skyMeshRef.current = findById('3drise-sky') || null;
|
|
16
|
+
return skyMeshRef.current;
|
|
17
|
+
}, []);
|
|
18
|
+
const getElevationAndAzimuth = useCallback((sunPosition) => {
|
|
19
|
+
const { x, y, z } = sunPosition;
|
|
20
|
+
const r = Math.sqrt(x * x + y * y + z * z);
|
|
21
|
+
const phi = Math.acos(y / r);
|
|
22
|
+
const theta = Math.atan2(z, x);
|
|
23
|
+
return {
|
|
24
|
+
elevation: 90 - phi * (180 / Math.PI),
|
|
25
|
+
azimuth: theta * (180 / Math.PI),
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
const updateUniforms = useCallback((settings) => {
|
|
29
|
+
const skyRef = getSkyRef();
|
|
30
|
+
if (!skyRef?.material)
|
|
31
|
+
return;
|
|
32
|
+
const uniforms = skyRef.material.uniforms;
|
|
33
|
+
if (!uniforms)
|
|
34
|
+
return;
|
|
35
|
+
if (settings.turbidity !== undefined)
|
|
36
|
+
uniforms.turbidity.value = settings.turbidity;
|
|
37
|
+
if (settings.rayleigh !== undefined)
|
|
38
|
+
uniforms.rayleigh.value = settings.rayleigh;
|
|
39
|
+
if (settings.mieCoefficient !== undefined)
|
|
40
|
+
uniforms.mieCoefficient.value = settings.mieCoefficient;
|
|
41
|
+
if (settings.mieDirectionalG !== undefined)
|
|
42
|
+
uniforms.mieDirectionalG.value = settings.mieDirectionalG;
|
|
43
|
+
// Only update sun position when at least one sun-related property is explicitly provided.
|
|
44
|
+
// Fall back to current uniform value for the axis that wasn't specified.
|
|
45
|
+
if (settings.elevation !== undefined || settings.azimuth !== undefined) {
|
|
46
|
+
const current = uniforms.sunPosition
|
|
47
|
+
? getElevationAndAzimuth(uniforms.sunPosition.value)
|
|
48
|
+
: { elevation: 0, azimuth: 0 };
|
|
49
|
+
const elevation = settings.elevation ?? current.elevation;
|
|
50
|
+
const azimuth = settings.azimuth ?? current.azimuth;
|
|
51
|
+
const sunPosition = createSunPosition(elevation, azimuth);
|
|
52
|
+
uniforms.sunPosition.value.copy(sunPosition);
|
|
53
|
+
}
|
|
54
|
+
}, [getSkyRef, getElevationAndAzimuth]);
|
|
55
|
+
const getCurrentValues = useCallback(() => {
|
|
56
|
+
const skyRef = getSkyRef();
|
|
57
|
+
if (!skyRef?.material)
|
|
58
|
+
return null;
|
|
59
|
+
const uniforms = skyRef.material.uniforms;
|
|
60
|
+
if (!uniforms)
|
|
61
|
+
return null;
|
|
62
|
+
return {
|
|
63
|
+
turbidity: uniforms.turbidity.value,
|
|
64
|
+
rayleigh: uniforms.rayleigh.value,
|
|
65
|
+
mieCoefficient: uniforms.mieCoefficient.value,
|
|
66
|
+
mieDirectionalG: uniforms.mieDirectionalG.value,
|
|
67
|
+
...getElevationAndAzimuth(uniforms.sunPosition.value),
|
|
68
|
+
};
|
|
69
|
+
}, [getSkyRef, getElevationAndAzimuth]);
|
|
70
|
+
return { updateUniforms, getCurrentValues, getElevationAndAzimuth };
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTransformControls.d.ts","sourceRoot":"","sources":["../../src/hooks/useTransformControls.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;CA2GhC,CAAC"}
|