@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,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ShootingStarProps {
|
|
3
|
+
position?: [number, number, number];
|
|
4
|
+
direction?: [number, number, number];
|
|
5
|
+
speed?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
trailLength?: number;
|
|
8
|
+
size?: number;
|
|
9
|
+
opacity?: number;
|
|
10
|
+
onComplete?: () => void;
|
|
11
|
+
maxDistance?: number;
|
|
12
|
+
followMouse?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const ShootingStar: React.FC<ShootingStarProps>;
|
|
15
|
+
export default ShootingStar;
|
|
16
|
+
//# sourceMappingURL=ShootingStar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShootingStar.d.ts","sourceRoot":"","sources":["../../src/components/ShootingStar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAGD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqF7C,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo, useEffect } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import { Vector3, BufferGeometry, BufferAttribute, AdditiveBlending, Color } from 'three';
|
|
5
|
+
import { ShootingStarMaterial } from '@3driseai/3drise-core';
|
|
6
|
+
const ShootingStar = ({ position = [0, 0, 0], direction = [1, -1, 0], speed = 0.05, color = '#ffffff', trailLength = 30, size = 0.1, opacity = 1.0, onComplete, maxDistance = 50, followMouse = true, }) => {
|
|
7
|
+
const starRef = useRef(null);
|
|
8
|
+
const glowRef = useRef(null);
|
|
9
|
+
const trailRef = useRef(null);
|
|
10
|
+
const materialRef = useRef(null);
|
|
11
|
+
const starMaterialRef = useRef(null);
|
|
12
|
+
const glowMaterialRef = useRef(null);
|
|
13
|
+
const trailPositions = useRef([]);
|
|
14
|
+
const currentPosition = useRef(new Vector3(...position));
|
|
15
|
+
const directionVector = useRef(new Vector3(...direction).normalize());
|
|
16
|
+
const distanceTraveled = useRef(0);
|
|
17
|
+
const fadeInDistance = maxDistance * 0.15;
|
|
18
|
+
const fadeOutDistance = maxDistance * 0.15;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const validTrailLength = Math.max(2, trailLength);
|
|
21
|
+
trailPositions.current = Array(validTrailLength).fill(null).map(() => currentPosition.current.clone());
|
|
22
|
+
currentPosition.current.set(...position);
|
|
23
|
+
directionVector.current.set(...direction).normalize();
|
|
24
|
+
distanceTraveled.current = 0;
|
|
25
|
+
if (starRef.current)
|
|
26
|
+
starRef.current.position.set(...position);
|
|
27
|
+
}, [trailLength, position, direction]);
|
|
28
|
+
const trailGeometry = useMemo(() => {
|
|
29
|
+
const validTrailLength = Math.max(2, trailLength);
|
|
30
|
+
const geometry = new BufferGeometry();
|
|
31
|
+
const positions = new Float32Array(validTrailLength * 3);
|
|
32
|
+
const progress = new Float32Array(validTrailLength);
|
|
33
|
+
const indices = [];
|
|
34
|
+
for (let i = 0; i < validTrailLength - 1; i++)
|
|
35
|
+
indices.push(i, i + 1);
|
|
36
|
+
for (let i = 0; i < validTrailLength; i++) {
|
|
37
|
+
positions[i * 3] = position[0];
|
|
38
|
+
positions[i * 3 + 1] = position[1];
|
|
39
|
+
positions[i * 3 + 2] = position[2];
|
|
40
|
+
progress[i] = i / (validTrailLength - 1);
|
|
41
|
+
}
|
|
42
|
+
geometry.setAttribute('position', new BufferAttribute(positions, 3));
|
|
43
|
+
geometry.setAttribute('progress', new BufferAttribute(progress, 1));
|
|
44
|
+
geometry.setIndex(indices);
|
|
45
|
+
return geometry;
|
|
46
|
+
}, [trailLength, position]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
return () => {
|
|
49
|
+
trailGeometry.dispose();
|
|
50
|
+
materialRef.current?.dispose();
|
|
51
|
+
starMaterialRef.current?.dispose();
|
|
52
|
+
glowMaterialRef.current?.dispose();
|
|
53
|
+
};
|
|
54
|
+
}, [trailGeometry]);
|
|
55
|
+
useFrame((state, delta) => {
|
|
56
|
+
if (!trailRef.current || !starRef.current)
|
|
57
|
+
return;
|
|
58
|
+
if (followMouse) {
|
|
59
|
+
directionVector.current.set(-state.pointer.x, state.pointer.y, direction[2]).normalize();
|
|
60
|
+
}
|
|
61
|
+
const movement = directionVector.current.clone().multiplyScalar(speed);
|
|
62
|
+
currentPosition.current.add(movement);
|
|
63
|
+
distanceTraveled.current += speed;
|
|
64
|
+
let starOpacity = opacity;
|
|
65
|
+
if (distanceTraveled.current < fadeInDistance) {
|
|
66
|
+
starOpacity = opacity * (distanceTraveled.current / fadeInDistance);
|
|
67
|
+
}
|
|
68
|
+
else if (distanceTraveled.current > maxDistance - fadeOutDistance) {
|
|
69
|
+
starOpacity = opacity * ((maxDistance - distanceTraveled.current) / fadeOutDistance);
|
|
70
|
+
}
|
|
71
|
+
starRef.current.position.copy(currentPosition.current);
|
|
72
|
+
if (starMaterialRef.current)
|
|
73
|
+
starMaterialRef.current.opacity = starOpacity;
|
|
74
|
+
if (glowMaterialRef.current)
|
|
75
|
+
glowMaterialRef.current.opacity = starOpacity * 0.3;
|
|
76
|
+
if (materialRef.current)
|
|
77
|
+
materialRef.current.opacity = starOpacity;
|
|
78
|
+
trailPositions.current.unshift(currentPosition.current.clone());
|
|
79
|
+
if (trailPositions.current.length > trailLength)
|
|
80
|
+
trailPositions.current.pop();
|
|
81
|
+
const posAttr = trailGeometry.getAttribute('position');
|
|
82
|
+
for (let i = 0; i < trailPositions.current.length; i++) {
|
|
83
|
+
const pos = trailPositions.current[i];
|
|
84
|
+
posAttr.setXYZ(i, pos.x, pos.y, pos.z);
|
|
85
|
+
}
|
|
86
|
+
posAttr.needsUpdate = true;
|
|
87
|
+
if (distanceTraveled.current > maxDistance)
|
|
88
|
+
onComplete?.();
|
|
89
|
+
});
|
|
90
|
+
return (_jsxs("group", { children: [_jsx("lineSegments", { ref: trailRef, geometry: trailGeometry, children: _jsx("shootingStarMaterial", { ref: materialRef, attach: "material", transparent: true, blending: AdditiveBlending, depthWrite: false, color: new Color(color), opacity: opacity }, ShootingStarMaterial.key) }), _jsxs("mesh", { ref: starRef, children: [_jsx("sphereGeometry", { args: [size, 8, 8] }), _jsx("meshBasicMaterial", { ref: starMaterialRef, color: color, transparent: true, opacity: opacity, blending: AdditiveBlending, depthWrite: false }), _jsxs("mesh", { ref: glowRef, children: [_jsx("sphereGeometry", { args: [size * 2, 8, 8] }), _jsx("meshBasicMaterial", { ref: glowMaterialRef, color: color, transparent: true, opacity: opacity * 0.3, blending: AdditiveBlending, depthWrite: false })] })] })] }));
|
|
91
|
+
};
|
|
92
|
+
export default ShootingStar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ShootingStarsSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface ShootingStarsProps {
|
|
4
|
+
settings: ShootingStarsSettings;
|
|
5
|
+
}
|
|
6
|
+
declare const ShootingStars: React.FC<ShootingStarsProps>;
|
|
7
|
+
export default ShootingStars;
|
|
8
|
+
//# sourceMappingURL=ShootingStars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShootingStars.d.ts","sourceRoot":"","sources":["../../src/components/ShootingStars.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,qBAAqB,CAAC;CACnC;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmC/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import { generateShootingStar, generateShootingStars } from '@3driseai/3drise-core';
|
|
4
|
+
import ShootingStar from './ShootingStar.js';
|
|
5
|
+
const ShootingStars = ({ settings }) => {
|
|
6
|
+
const [shootingStars, setShootingStars] = useState(() => {
|
|
7
|
+
if (settings?.enabled)
|
|
8
|
+
return generateShootingStars(settings.count, settings);
|
|
9
|
+
return [];
|
|
10
|
+
});
|
|
11
|
+
const nextIdRef = useRef(settings?.count || 0);
|
|
12
|
+
const settingsRef = useRef(settings);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
settingsRef.current = settings;
|
|
15
|
+
}, [settings]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const currentCount = shootingStars.length;
|
|
18
|
+
const targetCount = settings?.count || 0;
|
|
19
|
+
if (settings?.enabled && currentCount !== targetCount) {
|
|
20
|
+
setShootingStars(generateShootingStars(targetCount, settings));
|
|
21
|
+
nextIdRef.current = targetCount;
|
|
22
|
+
}
|
|
23
|
+
else if (!settings?.enabled && currentCount > 0) {
|
|
24
|
+
setShootingStars([]);
|
|
25
|
+
}
|
|
26
|
+
}, [settings?.enabled, settings?.count]);
|
|
27
|
+
const handleComplete = useCallback((starId) => {
|
|
28
|
+
const s = settingsRef.current;
|
|
29
|
+
if (!s)
|
|
30
|
+
return;
|
|
31
|
+
setShootingStars(prev => {
|
|
32
|
+
const newStar = generateShootingStar(nextIdRef.current++, s);
|
|
33
|
+
return prev.map(star => star.id === starId ? newStar : star);
|
|
34
|
+
});
|
|
35
|
+
}, []);
|
|
36
|
+
if (!settings?.enabled)
|
|
37
|
+
return null;
|
|
38
|
+
console.log("Rendering ShootingStars with settings:", settings, "and shootingStars:", shootingStars);
|
|
39
|
+
return (_jsx(_Fragment, { children: shootingStars.map(star => (_jsx(ShootingStar, { position: star.position, direction: star.direction, speed: star.speed, color: star.color, trailLength: star.trailLength, size: 0.08, opacity: 0.9, maxDistance: star.length, onComplete: () => handleComplete(star.id), followMouse: settings.followMouse }, star.id))) }));
|
|
40
|
+
};
|
|
41
|
+
export default ShootingStars;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SkySettings, TimeSettings } from '@3driseai/3drise-core';
|
|
2
|
+
export interface SkyControllerProps {
|
|
3
|
+
settings: SkySettings;
|
|
4
|
+
timeSettings: TimeSettings;
|
|
5
|
+
scale?: number;
|
|
6
|
+
onSettingsChange?: (settings: SkySettings) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function SkyController({ settings, timeSettings, scale, onSettingsChange, }: SkyControllerProps): any;
|
|
9
|
+
export default SkyController;
|
|
10
|
+
//# sourceMappingURL=SkyController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkyController.d.ts","sourceRoot":"","sources":["../../src/components/SkyController.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,WAAW,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CACtD;AAED,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAY,EAAE,gBAAgB,GAAG,EAAE,kBAAkB,GAuKyH,GAAG,CACjO;AA6BD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect, useCallback } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
5
|
+
import { useSkyUniforms } from '../hooks/useSkyUniforms.js';
|
|
6
|
+
import { useSkyAnimation } from '../hooks/useSkyAnimation.js';
|
|
7
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
8
|
+
import { findById } from '../utils/sceneQuery.js';
|
|
9
|
+
import { cubeCameraManager } from '@3driseai/3drise-core';
|
|
10
|
+
import SkyMesh from './SkyMesh.js';
|
|
11
|
+
function SkyController({ settings, timeSettings, scale = 1000, onSettingsChange, }) {
|
|
12
|
+
const skyRef = useRef(null);
|
|
13
|
+
const sunLightRef = useRef(null);
|
|
14
|
+
const isAnimatingRef = useRef(false);
|
|
15
|
+
const previousSettings = useRef(null);
|
|
16
|
+
// const cubeCameraManager = CubeCameraManager.getInstance();
|
|
17
|
+
const { updateUniforms, getCurrentValues } = useSkyUniforms();
|
|
18
|
+
const { animateSkyTransition } = useSkyAnimation();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
return () => {
|
|
21
|
+
sunLightRef.current?.shadow?.map?.dispose();
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
handleSettings(settings);
|
|
26
|
+
}, [settings]);
|
|
27
|
+
useAnimationEvents({
|
|
28
|
+
onStepStart: (event) => {
|
|
29
|
+
if (!event.step?.transitions)
|
|
30
|
+
return;
|
|
31
|
+
event.step.transitions.forEach((transition) => {
|
|
32
|
+
if (transition.state === 'sky' && skyRef.current) {
|
|
33
|
+
console.log('Starting sky transition animation', { transition }, skyRef.current.visible);
|
|
34
|
+
const toProps = transition.properties.to || {};
|
|
35
|
+
const fromProps = transition.properties.from || {};
|
|
36
|
+
// Handle `visible` as an immediate boolean switch — not animated
|
|
37
|
+
if (toProps.visible !== undefined) {
|
|
38
|
+
toggleSky(toProps.visible);
|
|
39
|
+
}
|
|
40
|
+
else if (fromProps.visible !== undefined) {
|
|
41
|
+
toggleSky(fromProps.visible);
|
|
42
|
+
}
|
|
43
|
+
if (!skyRef.current.visible)
|
|
44
|
+
return;
|
|
45
|
+
// Only animate numeric sky uniform properties
|
|
46
|
+
const SKY_KEYS = ['turbidity', 'rayleigh', 'mieCoefficient', 'mieDirectionalG', 'elevation', 'azimuth'];
|
|
47
|
+
const hasNumericTarget = SKY_KEYS.some((k) => toProps[k] !== undefined);
|
|
48
|
+
if (!hasNumericTarget)
|
|
49
|
+
return;
|
|
50
|
+
// Build `from`: current live values as baseline, overridden by explicit fromProps
|
|
51
|
+
const liveValues = getCurrentValues() || {};
|
|
52
|
+
const from = {};
|
|
53
|
+
const to = {};
|
|
54
|
+
for (const key of SKY_KEYS) {
|
|
55
|
+
if (toProps[key] === undefined)
|
|
56
|
+
continue;
|
|
57
|
+
to[key] = toProps[key];
|
|
58
|
+
from[key] = fromProps[key] ?? liveValues[key] ?? toProps[key];
|
|
59
|
+
}
|
|
60
|
+
isAnimatingRef.current = true;
|
|
61
|
+
animateSkyTransition(from, to, updateUniforms, handleCompletedUniforms, event.step?.duration);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
const handleTimeUpdate = useCallback((state) => {
|
|
67
|
+
const { sunAzimuth, sunElevation, timeInHours } = state;
|
|
68
|
+
// console.log('SkyController - Time update:', { sunAzimuth, sunElevation, timeInHours });
|
|
69
|
+
const atmosphericParams = calculateSkyParamsForTime(timeInHours);
|
|
70
|
+
const newSettings = {
|
|
71
|
+
...settings,
|
|
72
|
+
elevation: sunElevation,
|
|
73
|
+
azimuth: sunAzimuth,
|
|
74
|
+
...atmosphericParams,
|
|
75
|
+
};
|
|
76
|
+
handleSettings(newSettings);
|
|
77
|
+
if (!state.autoAnimate) {
|
|
78
|
+
onSettingsChange?.(newSettings);
|
|
79
|
+
}
|
|
80
|
+
}, [settings, onSettingsChange]);
|
|
81
|
+
useSkySystem({
|
|
82
|
+
timeSettings,
|
|
83
|
+
onTimeUpdate: handleTimeUpdate,
|
|
84
|
+
enabled: settings.visible && timeSettings.enabled,
|
|
85
|
+
});
|
|
86
|
+
const handleMeshReady = useCallback((mesh) => {
|
|
87
|
+
skyRef.current = mesh;
|
|
88
|
+
updateUniforms(settings);
|
|
89
|
+
previousSettings.current = { ...settings };
|
|
90
|
+
}, [settings, updateUniforms]);
|
|
91
|
+
const toggleSky = useCallback((show) => {
|
|
92
|
+
if (!skyRef.current)
|
|
93
|
+
return;
|
|
94
|
+
skyRef.current.visible = show;
|
|
95
|
+
if (sunLightRef.current)
|
|
96
|
+
sunLightRef.current.visible = show;
|
|
97
|
+
if (!show) {
|
|
98
|
+
cubeCameraManager.dispose();
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
cubeCameraManager.updateEnvironment();
|
|
102
|
+
}
|
|
103
|
+
}, []);
|
|
104
|
+
const updateSun = useCallback(() => {
|
|
105
|
+
if (!skyRef.current?.material || !sunLightRef.current)
|
|
106
|
+
return;
|
|
107
|
+
const uniforms = skyRef.current.material.uniforms;
|
|
108
|
+
if (!uniforms?.sunPosition)
|
|
109
|
+
return;
|
|
110
|
+
const distance = 100;
|
|
111
|
+
const sp = uniforms.sunPosition.value;
|
|
112
|
+
sunLightRef.current.position.set(sp.x * distance, sp.y * distance, sp.z * distance);
|
|
113
|
+
sunLightRef.current.shadow.camera.updateProjectionMatrix();
|
|
114
|
+
const moon = findById('3drise-moon');
|
|
115
|
+
if (moon)
|
|
116
|
+
moon.position.set(sp.x * scale, sp.y * scale, sp.z * scale);
|
|
117
|
+
}, [scale]);
|
|
118
|
+
const hasActualChanges = useCallback((next, prev) => {
|
|
119
|
+
if (!prev)
|
|
120
|
+
return true;
|
|
121
|
+
return (next.visible !== prev.visible ||
|
|
122
|
+
Math.abs(next.turbidity - prev.turbidity) > 0.01 ||
|
|
123
|
+
Math.abs(next.rayleigh - prev.rayleigh) > 0.01 ||
|
|
124
|
+
Math.abs(next.mieCoefficient - prev.mieCoefficient) > 0.001 ||
|
|
125
|
+
Math.abs(next.mieDirectionalG - prev.mieDirectionalG) > 0.001 ||
|
|
126
|
+
Math.abs(next.elevation - prev.elevation) > 0.1 ||
|
|
127
|
+
Math.abs(next.azimuth - prev.azimuth) > 0.1);
|
|
128
|
+
}, []);
|
|
129
|
+
const handleCompletedUniforms = (_finalValues) => {
|
|
130
|
+
isAnimatingRef.current = false;
|
|
131
|
+
cubeCameraManager.updateEnvironment();
|
|
132
|
+
};
|
|
133
|
+
const handleSettings = (newSettings) => {
|
|
134
|
+
if (!skyRef.current || isAnimatingRef.current || !newSettings)
|
|
135
|
+
return;
|
|
136
|
+
if (!hasActualChanges(newSettings, previousSettings.current))
|
|
137
|
+
return;
|
|
138
|
+
if (previousSettings.current?.visible !== newSettings.visible) {
|
|
139
|
+
toggleSky(newSettings.visible);
|
|
140
|
+
}
|
|
141
|
+
if (!skyRef.current.visible) {
|
|
142
|
+
previousSettings.current = { ...newSettings };
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
updateUniforms(newSettings);
|
|
146
|
+
updateSun();
|
|
147
|
+
cubeCameraManager.updateEnvironment();
|
|
148
|
+
previousSettings.current = { ...newSettings };
|
|
149
|
+
};
|
|
150
|
+
const handleMouseMove = (mouse) => {
|
|
151
|
+
// console.log(skyRef.current.visible)
|
|
152
|
+
const handlers = settings.handlers;
|
|
153
|
+
if (!handlers || isAnimatingRef.current || !skyRef.current)
|
|
154
|
+
return;
|
|
155
|
+
if (!handlers.onMouseMove?.enabled)
|
|
156
|
+
return;
|
|
157
|
+
let updated = { ...settings };
|
|
158
|
+
handlers.onMouseMove.properties.forEach((propConfig) => {
|
|
159
|
+
const { property } = propConfig;
|
|
160
|
+
const { sensitivity, min: minVal, max: maxVal, axis } = propConfig.propertySettings;
|
|
161
|
+
let movement = axis === 'x' ? mouse.x * sensitivity
|
|
162
|
+
: axis === 'y' ? mouse.y * sensitivity
|
|
163
|
+
: (mouse.x + mouse.y) * 0.5 * sensitivity;
|
|
164
|
+
if (movement !== 0) {
|
|
165
|
+
let newVal = updated[property] + movement;
|
|
166
|
+
if (typeof minVal === 'number')
|
|
167
|
+
newVal = Math.max(newVal, minVal);
|
|
168
|
+
if (typeof maxVal === 'number')
|
|
169
|
+
newVal = Math.min(newVal, maxVal);
|
|
170
|
+
updated[property] = newVal;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
handleSettings(updated);
|
|
174
|
+
};
|
|
175
|
+
useFrame((state) => {
|
|
176
|
+
handleMouseMove({ x: state.pointer.x, y: state.pointer.y });
|
|
177
|
+
});
|
|
178
|
+
return (_jsxs(_Fragment, { children: [_jsx(SkyMesh, { ref: skyRef, settings: settings, scale: scale, onMeshReady: handleMeshReady }), settings.visible && (_jsx("directionalLight", { ref: sunLightRef, color: "#ffffff", intensity: 1, castShadow: true }))] }));
|
|
179
|
+
}
|
|
180
|
+
// ─── Atmospheric parameter calculation ───────────────────────────────────────
|
|
181
|
+
function calculateSkyParamsForTime(timeInHours) {
|
|
182
|
+
const nightParams = { turbidity: 0.5, rayleigh: 0.1, mieCoefficient: 0.001, mieDirectionalG: 0.8 };
|
|
183
|
+
const sunriseParams = { turbidity: 4, rayleigh: 3, mieCoefficient: 0.01, mieDirectionalG: 0.9 };
|
|
184
|
+
const dayParams = { turbidity: 0.7, rayleigh: 0.54, mieCoefficient: 0.005, mieDirectionalG: 0.7 };
|
|
185
|
+
const sunsetParams = { turbidity: 4.5, rayleigh: 3.5, mieCoefficient: 0.012, mieDirectionalG: 0.92 };
|
|
186
|
+
const lerp = (a, b, t) => a + (b - a) * Math.max(0, Math.min(1, t));
|
|
187
|
+
const ss = (t) => t * t * (3 - 2 * t);
|
|
188
|
+
const lerpP = (from, to, t) => ({
|
|
189
|
+
turbidity: lerp(from.turbidity, to.turbidity, ss(t)),
|
|
190
|
+
rayleigh: lerp(from.rayleigh, to.rayleigh, ss(t)),
|
|
191
|
+
mieCoefficient: lerp(from.mieCoefficient, to.mieCoefficient, ss(t)),
|
|
192
|
+
mieDirectionalG: lerp(from.mieDirectionalG, to.mieDirectionalG, ss(t)),
|
|
193
|
+
});
|
|
194
|
+
if (timeInHours < 5)
|
|
195
|
+
return nightParams;
|
|
196
|
+
if (timeInHours < 6.5)
|
|
197
|
+
return lerpP(nightParams, sunriseParams, (timeInHours - 5) / 1.5);
|
|
198
|
+
if (timeInHours < 8)
|
|
199
|
+
return lerpP(sunriseParams, dayParams, (timeInHours - 6.5) / 1.5);
|
|
200
|
+
if (timeInHours < 17)
|
|
201
|
+
return dayParams;
|
|
202
|
+
if (timeInHours < 19)
|
|
203
|
+
return lerpP(dayParams, sunsetParams, (timeInHours - 17) / 2);
|
|
204
|
+
if (timeInHours < 21)
|
|
205
|
+
return lerpP(sunsetParams, nightParams, (timeInHours - 19) / 2);
|
|
206
|
+
return nightParams;
|
|
207
|
+
}
|
|
208
|
+
export default SkyController;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Mesh } from "three";
|
|
2
|
+
import type { SkySettings } from "@3driseai/3drise-core";
|
|
3
|
+
export interface SkyMeshProps {
|
|
4
|
+
settings: SkySettings;
|
|
5
|
+
scale?: number;
|
|
6
|
+
onMeshReady?: (mesh: Mesh) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const SkyMesh: any;
|
|
9
|
+
export default SkyMesh;
|
|
10
|
+
//# sourceMappingURL=SkyMesh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkyMesh.d.ts","sourceRoot":"","sources":["../../src/components/SkyMesh.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACtC;AAGD,QAAA,MAAM,OAAO,EA8BP,GAAI,CAAC;AAEX,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useRef, useMemo, useEffect } from 'react';
|
|
3
|
+
import { Sky } from 'three/examples/jsm/objects/Sky.js';
|
|
4
|
+
const SkyMesh = React.forwardRef(({ settings, scale = 1000, onMeshReady }, ref) => {
|
|
5
|
+
const meshRef = useRef(null);
|
|
6
|
+
const skyObject = useMemo(() => {
|
|
7
|
+
const sky = new Sky();
|
|
8
|
+
sky.scale.setScalar(scale);
|
|
9
|
+
return sky;
|
|
10
|
+
}, [scale]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
return () => {
|
|
13
|
+
skyObject.geometry?.dispose();
|
|
14
|
+
if (Array.isArray(skyObject.material)) {
|
|
15
|
+
skyObject.material.forEach(m => m.dispose());
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
skyObject.material?.dispose();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}, [skyObject]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (meshRef.current && onMeshReady)
|
|
24
|
+
onMeshReady(meshRef.current);
|
|
25
|
+
}, [onMeshReady]);
|
|
26
|
+
const combinedRef = (node) => {
|
|
27
|
+
meshRef.current = node;
|
|
28
|
+
if (typeof ref === 'function')
|
|
29
|
+
ref(node);
|
|
30
|
+
else if (ref)
|
|
31
|
+
ref.current = node;
|
|
32
|
+
};
|
|
33
|
+
return (_jsx("primitive", { ref: combinedRef, object: skyObject, visible: settings.visible, scale: scale, userData: { id: '3drise-sky' } }));
|
|
34
|
+
});
|
|
35
|
+
SkyMesh.displayName = 'SkyMesh';
|
|
36
|
+
export default SkyMesh;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { TimeSettings, StarsSettings, CloudsSettings, SkySettings, RainSettings, FogSettings, MaterialSettings } from '@3driseai/3drise-core';
|
|
3
|
+
import React from "react";
|
|
4
|
+
export interface SkySystemRef {
|
|
5
|
+
setTime: (hours: number, minutes?: number) => void;
|
|
6
|
+
getTime: () => Date;
|
|
7
|
+
getTimeOfDay: () => string;
|
|
8
|
+
getSunDirection: () => THREE.Vector3;
|
|
9
|
+
}
|
|
10
|
+
export interface SkySystemProps {
|
|
11
|
+
timeSettings: TimeSettings;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
sunSystemVisible?: boolean;
|
|
14
|
+
sunSize?: number;
|
|
15
|
+
moonSize?: number;
|
|
16
|
+
skyboxScale?: number;
|
|
17
|
+
sunIntensity?: number;
|
|
18
|
+
castShadow?: boolean;
|
|
19
|
+
shadowMapSize?: number;
|
|
20
|
+
playerPosition?: THREE.Vector3;
|
|
21
|
+
starsSettings?: StarsSettings;
|
|
22
|
+
cloudsSettings?: CloudsSettings;
|
|
23
|
+
cloudsMaterialSettings?: MaterialSettings;
|
|
24
|
+
skyControllerSettings?: SkySettings;
|
|
25
|
+
rainSettings?: RainSettings;
|
|
26
|
+
fogSettings?: FogSettings;
|
|
27
|
+
onTimeOfDayChange?: (timeOfDay: string, elapsedTime: number) => void;
|
|
28
|
+
onTimeUpdate?: (timeOfDay: number) => void;
|
|
29
|
+
}
|
|
30
|
+
declare const SkySystem: React.ForwardRefExoticComponent<SkySystemProps & React.RefAttributes<SkySystemRef>>;
|
|
31
|
+
export default SkySystem;
|
|
32
|
+
//# sourceMappingURL=SkySystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkySystem.d.ts","sourceRoot":"","sources":["../../src/components/SkySystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMnJ,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,YAAY;IACzB,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,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,sBAAsB,CAAC,EAAE,gBAAgB,CAAC;IAC1C,qBAAqB,CAAC,EAAE,WAAW,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAGD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,yBAAyB,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAiCjG,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { skySystemManager } from '@3driseai/3drise-core';
|
|
6
|
+
import Skybox from './Skybox.js';
|
|
7
|
+
import Lensflare from './Lensflare.js';
|
|
8
|
+
import SunLight from './SunLight.js';
|
|
9
|
+
import SkyController from './SkyController.js';
|
|
10
|
+
import SceneFog from './SceneFog.js';
|
|
11
|
+
const SkySystem = forwardRef(({ timeSettings, visible = true, sunSystemVisible = false, sunSize = 1, moonSize = 1, skyboxScale = 1000, sunIntensity = 1, castShadow = true, shadowMapSize = 2048, playerPosition = new THREE.Vector3(0, 0, 0), starsSettings, cloudsSettings, cloudsMaterialSettings, skyControllerSettings, rainSettings, fogSettings, onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
12
|
+
const previousTimeOfDayRef = useRef(null);
|
|
13
|
+
useImperativeHandle(ref, () => ({
|
|
14
|
+
setTime: (h, m) => skySystemManager.setTime(h, m),
|
|
15
|
+
getTime: () => skySystemManager.getTime(),
|
|
16
|
+
getTimeOfDay: () => skySystemManager.getTimeOfDay(),
|
|
17
|
+
getSunDirection: () => skySystemManager.getSunDirection(),
|
|
18
|
+
}));
|
|
19
|
+
// useLayoutEffect so the manager is registered before useFrame's first
|
|
20
|
+
// rAF callback (regular useEffect runs after paint, too late).
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
skySystemManager.setTimeSettings(timeSettings);
|
|
23
|
+
}, [timeSettings]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!onTimeUpdate)
|
|
26
|
+
return;
|
|
27
|
+
skySystemManager.setOnTimeSync(onTimeUpdate);
|
|
28
|
+
return () => { skySystemManager.setOnTimeSync(null); };
|
|
29
|
+
}, [onTimeUpdate]);
|
|
30
|
+
useFrame((_, delta) => {
|
|
31
|
+
if (!timeSettings.enabled || !timeSettings.autoAnimate)
|
|
32
|
+
return;
|
|
33
|
+
skySystemManager.tick(delta);
|
|
34
|
+
const current = skySystemManager.getTimeOfDay();
|
|
35
|
+
if (previousTimeOfDayRef.current !== null && previousTimeOfDayRef.current !== current) {
|
|
36
|
+
const state = skySystemManager.getState();
|
|
37
|
+
onTimeOfDayChange?.(current, state.elapsedTime);
|
|
38
|
+
}
|
|
39
|
+
previousTimeOfDayRef.current = current;
|
|
40
|
+
});
|
|
41
|
+
if (!visible)
|
|
42
|
+
return null;
|
|
43
|
+
return (_jsxs("group", { children: [skyControllerSettings && !sunSystemVisible && (_jsx(SkyController, { settings: skyControllerSettings, timeSettings: timeSettings, scale: skyboxScale })), sunSystemVisible && (_jsxs(_Fragment, { children: [_jsx(Skybox, { visible: true, scale: skyboxScale, sunSize: sunSize, moonSize: moonSize, timeSettings: timeSettings }), _jsx(Lensflare, { visible: true, intensity: sunIntensity, timeSettings: timeSettings }), _jsx(SunLight, { visible: true, timeSettings: timeSettings, targetPosition: playerPosition, intensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize })] })), fogSettings && (_jsx(SceneFog, { fog: fogSettings }))] }));
|
|
44
|
+
});
|
|
45
|
+
SkySystem.displayName = 'SkySystem';
|
|
46
|
+
export default SkySystem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TimeSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface SkyboxProps {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
scale?: number;
|
|
6
|
+
sunSize?: number;
|
|
7
|
+
moonSize?: number;
|
|
8
|
+
timeSettings: TimeSettings;
|
|
9
|
+
}
|
|
10
|
+
declare const Skybox: React.FC<SkyboxProps>;
|
|
11
|
+
export default Skybox;
|
|
12
|
+
//# sourceMappingURL=Skybox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skybox.d.ts","sourceRoot":"","sources":["../../src/components/Skybox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC9B;AAkDD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAoCjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
5
|
+
import { SkyboxMaterial } from '@3driseai/3drise-core';
|
|
6
|
+
// Extend R3F with skyboxMaterial
|
|
7
|
+
import { extend } from '@react-three/fiber';
|
|
8
|
+
extend({ SkyboxMaterial });
|
|
9
|
+
const COLORS = {
|
|
10
|
+
white: new THREE.Color(0xffffff),
|
|
11
|
+
orange: new THREE.Color(0xff4500),
|
|
12
|
+
yellow: new THREE.Color(0xffd700),
|
|
13
|
+
red: new THREE.Color(0xff6347),
|
|
14
|
+
darkRed: new THREE.Color(0xd32f2f),
|
|
15
|
+
skyBlue: new THREE.Color(0x87ceeb),
|
|
16
|
+
darkSky: new THREE.Color(0x0d1321),
|
|
17
|
+
nightSky: new THREE.Color(0x1c2331),
|
|
18
|
+
moon: new THREE.Color(0xe6e8fa),
|
|
19
|
+
};
|
|
20
|
+
const MOON_GLOW = COLORS.moon.clone().multiplyScalar(1.8);
|
|
21
|
+
const SKY_KEYFRAMES = [
|
|
22
|
+
{ t: 0, horizon: COLORS.darkSky, high: COLORS.nightSky, sun: MOON_GLOW },
|
|
23
|
+
{ t: 5, horizon: COLORS.darkSky, high: COLORS.nightSky, sun: MOON_GLOW },
|
|
24
|
+
{ t: 5.7, horizon: COLORS.darkRed, high: COLORS.darkSky, sun: COLORS.orange },
|
|
25
|
+
{ t: 6.3, horizon: COLORS.red, high: COLORS.darkSky, sun: COLORS.orange },
|
|
26
|
+
{ t: 6.8, horizon: COLORS.yellow, high: COLORS.darkSky, sun: COLORS.yellow },
|
|
27
|
+
{ t: 8, horizon: COLORS.skyBlue, high: COLORS.skyBlue, sun: COLORS.white },
|
|
28
|
+
{ t: 12, horizon: COLORS.skyBlue, high: COLORS.darkSky, sun: COLORS.white },
|
|
29
|
+
{ t: 16, horizon: COLORS.skyBlue, high: COLORS.skyBlue, sun: COLORS.white },
|
|
30
|
+
{ t: 19, horizon: COLORS.yellow, high: COLORS.skyBlue, sun: COLORS.yellow },
|
|
31
|
+
{ t: 20, horizon: COLORS.red, high: COLORS.darkRed, sun: COLORS.orange },
|
|
32
|
+
{ t: 20.7, horizon: COLORS.darkRed, high: COLORS.darkSky, sun: COLORS.orange },
|
|
33
|
+
{ t: 22, horizon: COLORS.darkSky, high: COLORS.nightSky, sun: MOON_GLOW },
|
|
34
|
+
{ t: 24, horizon: COLORS.darkSky, high: COLORS.nightSky, sun: MOON_GLOW },
|
|
35
|
+
];
|
|
36
|
+
function sampleSkyKeyframes(timeInHours, outHorizon, outHigh, outSun) {
|
|
37
|
+
const wrapped = ((timeInHours % 24) + 24) % 24;
|
|
38
|
+
for (let i = 0; i < SKY_KEYFRAMES.length - 1; i++) {
|
|
39
|
+
const k0 = SKY_KEYFRAMES[i];
|
|
40
|
+
const k1 = SKY_KEYFRAMES[i + 1];
|
|
41
|
+
if (wrapped <= k1.t) {
|
|
42
|
+
const span = k1.t - k0.t;
|
|
43
|
+
const t = span === 0 ? 0 : (wrapped - k0.t) / span;
|
|
44
|
+
outHorizon.lerpColors(k0.horizon, k1.horizon, t);
|
|
45
|
+
outHigh.lerpColors(k0.high, k1.high, t);
|
|
46
|
+
outSun.lerpColors(k0.sun, k1.sun, t);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const last = SKY_KEYFRAMES[SKY_KEYFRAMES.length - 1];
|
|
51
|
+
outHorizon.copy(last.horizon);
|
|
52
|
+
outHigh.copy(last.high);
|
|
53
|
+
outSun.copy(last.sun);
|
|
54
|
+
}
|
|
55
|
+
const Skybox = ({ visible = true, scale = 100000, sunSize = 1, moonSize = 1, timeSettings, }) => {
|
|
56
|
+
const materialRef = useRef(null);
|
|
57
|
+
const sunColorRef = useRef(new THREE.Color(0xffe5b0));
|
|
58
|
+
const skyColorLowRef = useRef(new THREE.Color(0x6fa2ef));
|
|
59
|
+
const skyColorHighRef = useRef(new THREE.Color(0x2053ff));
|
|
60
|
+
const targetSunColorRef = useRef(new THREE.Color(0xffe5b0));
|
|
61
|
+
const targetSkyColorLowRef = useRef(new THREE.Color(0x6fa2ef));
|
|
62
|
+
const targetSkyColorHighRef = useRef(new THREE.Color(0x2053ff));
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
materialRef.current.uSunSize = sunSize;
|
|
65
|
+
}, [sunSize, moonSize]);
|
|
66
|
+
const handleTimeUpdate = useCallback((state) => {
|
|
67
|
+
const { timeInHours, isDaytime, sunElevation, sunAzimuth, delta } = state;
|
|
68
|
+
sampleSkyKeyframes(timeInHours, targetSkyColorLowRef.current, targetSkyColorHighRef.current, targetSunColorRef.current);
|
|
69
|
+
const colorLerpSpeed = Math.min(1, 2.0 * (delta !== 0 ? delta : 1));
|
|
70
|
+
sunColorRef.current.lerp(targetSunColorRef.current, colorLerpSpeed);
|
|
71
|
+
skyColorLowRef.current.lerp(targetSkyColorLowRef.current, colorLerpSpeed);
|
|
72
|
+
skyColorHighRef.current.lerp(targetSkyColorHighRef.current, colorLerpSpeed);
|
|
73
|
+
if (materialRef.current) {
|
|
74
|
+
materialRef.current.uSunAzimuth = sunAzimuth;
|
|
75
|
+
materialRef.current.uSunElevation = sunElevation;
|
|
76
|
+
materialRef.current.uSunColor = sunColorRef.current;
|
|
77
|
+
materialRef.current.uSkyColorLow = skyColorLowRef.current;
|
|
78
|
+
materialRef.current.uSkyColorHigh = skyColorHighRef.current;
|
|
79
|
+
materialRef.current.uSunSize = isDaytime ? sunSize : moonSize;
|
|
80
|
+
}
|
|
81
|
+
}, [sunSize, moonSize]);
|
|
82
|
+
useSkySystem({
|
|
83
|
+
timeSettings,
|
|
84
|
+
onTimeUpdate: handleTimeUpdate,
|
|
85
|
+
enabled: visible,
|
|
86
|
+
});
|
|
87
|
+
if (!visible)
|
|
88
|
+
return null;
|
|
89
|
+
// console.log(sunSize)
|
|
90
|
+
return (_jsxs("mesh", { scale: scale, children: [_jsx("boxGeometry", { args: [1, 1, 1] }), _jsx("skyboxMaterial", { ref: materialRef, side: THREE.BackSide, depthWrite: false, fog: false })] }));
|
|
91
|
+
};
|
|
92
|
+
export default Skybox;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Group } from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { SolarSystemConfig } from "@3driseai/3drise-core";
|
|
4
|
+
declare const SolarSystem: React.FC<SolarSystemConfig & {
|
|
5
|
+
onObjectReady?: (ref: Group) => void;
|
|
6
|
+
}>;
|
|
7
|
+
export default SolarSystem;
|
|
8
|
+
//# sourceMappingURL=SolarSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolarSystem.d.ts","sourceRoot":"","sources":["../../src/components/SolarSystem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAKnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAiD1D,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG;IACpC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;CACxC,CAoBR,CAAC;AAEF,eAAe,WAAW,CAAC"}
|