@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,77 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo, useState, useCallback } from 'react';
|
|
3
|
+
import { BufferGeometry, BufferAttribute, Vector3 } from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import Planet from './Planet.js';
|
|
6
|
+
import Earth from './Earth.js';
|
|
7
|
+
import Sun from './Sun.js';
|
|
8
|
+
// Stylized constants — distances compressed, sizes exaggerated for legibility.
|
|
9
|
+
const PLANETS = [
|
|
10
|
+
{ body: { name: 'mercury', kind: 'planet', type: 'mercury' }, radius: 0.6, orbitRadius: 18, periodYears: 0.24, axialTilt: 0.03, spinRate: 1.0, initialPhase: 0.2 },
|
|
11
|
+
{ body: { name: 'venus', kind: 'planet', type: 'venus' }, radius: 1.2, orbitRadius: 26, periodYears: 0.62, axialTilt: 3.10, spinRate: -0.4, initialPhase: 1.1 },
|
|
12
|
+
{ body: { name: 'earth', kind: 'earth' }, radius: 1.3, orbitRadius: 36, periodYears: 1.00, axialTilt: 0.41, spinRate: 1.0, initialPhase: 2.3 },
|
|
13
|
+
{ body: { name: 'mars', kind: 'planet', type: 'mars' }, radius: 0.9, orbitRadius: 46, periodYears: 1.88, axialTilt: 0.44, spinRate: 0.97, initialPhase: 3.7 },
|
|
14
|
+
{ body: { name: 'jupiter', kind: 'planet', type: 'jupiter' }, radius: 3.6, orbitRadius: 70, periodYears: 11.86, axialTilt: 0.05, spinRate: 2.4, initialPhase: 0.8 },
|
|
15
|
+
{ body: { name: 'saturn', kind: 'planet', type: 'saturn' }, radius: 3.2, orbitRadius: 92, periodYears: 29.46, axialTilt: 0.47, spinRate: 2.2, initialPhase: 4.2 },
|
|
16
|
+
{ body: { name: 'uranus', kind: 'planet', type: 'uranus' }, radius: 2.0, orbitRadius: 114, periodYears: 84.0, axialTilt: 1.71, spinRate: 1.4, initialPhase: 5.5 },
|
|
17
|
+
{ body: { name: 'neptune', kind: 'planet', type: 'neptune' }, radius: 2.0, orbitRadius: 134, periodYears: 164.8, axialTilt: 0.49, spinRate: 1.5, initialPhase: 1.9 },
|
|
18
|
+
];
|
|
19
|
+
// Default: one Earth-year = 8 scene-seconds.
|
|
20
|
+
const EARTH_YEAR_SECONDS = 8;
|
|
21
|
+
const OrbitRing = ({ radius, color, opacity }) => {
|
|
22
|
+
const geometry = useMemo(() => {
|
|
23
|
+
const segments = 128;
|
|
24
|
+
const points = new Float32Array((segments + 1) * 3);
|
|
25
|
+
for (let i = 0; i <= segments; i++) {
|
|
26
|
+
const t = (i / segments) * Math.PI * 2;
|
|
27
|
+
points[i * 3 + 0] = Math.cos(t) * radius;
|
|
28
|
+
points[i * 3 + 1] = 0;
|
|
29
|
+
points[i * 3 + 2] = Math.sin(t) * radius;
|
|
30
|
+
}
|
|
31
|
+
const geom = new BufferGeometry();
|
|
32
|
+
geom.setAttribute('position', new BufferAttribute(points, 3));
|
|
33
|
+
return geom;
|
|
34
|
+
}, [radius]);
|
|
35
|
+
return (_jsx("lineLoop", { geometry: geometry, children: _jsx("lineBasicMaterial", { color: color, transparent: true, opacity: opacity, depthWrite: false }) }));
|
|
36
|
+
};
|
|
37
|
+
const OrbitedBody = ({ orbitRadius, orbitSpeed, spinSpeed, axialTilt, enableOrbit, enableSelfRotation, initialPhase, onWorldPositionChange, children, }) => {
|
|
38
|
+
const orbitRef = useRef(null);
|
|
39
|
+
const spinRef = useRef(null);
|
|
40
|
+
const worldPosRef = useRef(new Vector3());
|
|
41
|
+
useFrame((_, delta) => {
|
|
42
|
+
if (enableOrbit && orbitRef.current) {
|
|
43
|
+
orbitRef.current.rotation.y += delta * orbitSpeed;
|
|
44
|
+
}
|
|
45
|
+
if (enableSelfRotation && spinRef.current) {
|
|
46
|
+
spinRef.current.rotation.y += delta * spinSpeed;
|
|
47
|
+
}
|
|
48
|
+
if (onWorldPositionChange && spinRef.current) {
|
|
49
|
+
spinRef.current.getWorldPosition(worldPosRef.current);
|
|
50
|
+
onWorldPositionChange(worldPosRef.current);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return (_jsx("group", { ref: orbitRef, "rotation-y": initialPhase, children: _jsx("group", { position: [orbitRadius, 0, 0], "rotation-z": axialTilt, children: _jsx("group", { ref: spinRef, children: children }) }) }));
|
|
54
|
+
};
|
|
55
|
+
const SolarSystem = ({ enableOrbit = true, enableSelfRotation = true, showOrbitRings = true, orbitSpeedMultiplier = 1, sunColor = '#ffd27a', sunRadius = 8, sunIntensity = 3, orbitRingColor = '#444444', orbitRingOpacity = 0.35, }) => {
|
|
56
|
+
const [earthSunPos, setEarthSunPos] = useState([1, 0, 0]);
|
|
57
|
+
const lastEarthSyncRef = useRef(0);
|
|
58
|
+
const ref = useRef(null);
|
|
59
|
+
const handleEarthWorld = useCallback((p) => {
|
|
60
|
+
const now = performance.now();
|
|
61
|
+
if (now - lastEarthSyncRef.current < 100)
|
|
62
|
+
return;
|
|
63
|
+
lastEarthSyncRef.current = now;
|
|
64
|
+
setEarthSunPos([-p.x, -p.y, -p.z]);
|
|
65
|
+
}, []);
|
|
66
|
+
return (_jsxs("group", { userData: { id: '3drise-solar-system' }, ref: ref, children: [_jsx(Sun, { radius: sunRadius }), showOrbitRings &&
|
|
67
|
+
PLANETS.map((p) => (_jsx(OrbitRing, { radius: p.orbitRadius, color: orbitRingColor, opacity: orbitRingOpacity }, `ring-${p.body.name}`))), PLANETS.map((p) => {
|
|
68
|
+
const orbitSpeed = ((2 * Math.PI) / (p.periodYears * EARTH_YEAR_SECONDS)) * orbitSpeedMultiplier;
|
|
69
|
+
const spinSpeed = p.spinRate * orbitSpeedMultiplier;
|
|
70
|
+
if (p.body.kind === 'earth') {
|
|
71
|
+
return (_jsx(OrbitedBody, { orbitRadius: p.orbitRadius, orbitSpeed: orbitSpeed, spinSpeed: spinSpeed, axialTilt: p.axialTilt, enableOrbit: enableOrbit, enableSelfRotation: enableSelfRotation, initialPhase: p.initialPhase, onWorldPositionChange: handleEarthWorld, children: _jsx(Earth, { radius: p.radius, sunPosition: earthSunPos, atmosphereDayColor: "#6db3f2", atmosphereTwilightColor: "#d97e54" }) }, "earth"));
|
|
72
|
+
}
|
|
73
|
+
return (_jsx(OrbitedBody, { orbitRadius: p.orbitRadius, orbitSpeed: orbitSpeed, spinSpeed: spinSpeed, axialTilt: p.axialTilt, enableOrbit: enableOrbit, enableSelfRotation: enableSelfRotation, initialPhase: p.initialPhase, children: _jsx(Planet, { type: p.body.type, scale: p.radius }) }, p.body.name));
|
|
74
|
+
})] }));
|
|
75
|
+
};
|
|
76
|
+
SolarSystem.displayName = 'SolarSystem';
|
|
77
|
+
export default SolarSystem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SparklesBurstConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface SparklesBurstProps {
|
|
4
|
+
config: SparklesBurstConfig;
|
|
5
|
+
boundingRadius?: number;
|
|
6
|
+
}
|
|
7
|
+
declare const SparklesBurst: React.FC<SparklesBurstProps>;
|
|
8
|
+
export default SparklesBurst;
|
|
9
|
+
//# sourceMappingURL=SparklesBurst.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparklesBurst.d.ts","sourceRoot":"","sources":["../../src/components/SparklesBurst.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuD/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { SparklesBurstMaterial } from '@3driseai/3drise-core';
|
|
6
|
+
const SparklesBurst = ({ config, boundingRadius }) => {
|
|
7
|
+
// console.log("Rendering SparklesBurst with config:", config, "and boundingRadius:", boundingRadius);
|
|
8
|
+
const planeSize = useMemo(() => Math.max(0.05, config.scale ?? 2.5), [config.scale]);
|
|
9
|
+
const geometry = useMemo(() => new THREE.PlaneGeometry(planeSize, planeSize, 1, 1), [planeSize]);
|
|
10
|
+
const material = useMemo(() => {
|
|
11
|
+
const m = new SparklesBurstMaterial();
|
|
12
|
+
m.transparent = true;
|
|
13
|
+
m.depthWrite = false;
|
|
14
|
+
m.side = THREE.DoubleSide;
|
|
15
|
+
m.blending = THREE.AdditiveBlending;
|
|
16
|
+
return m;
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const u = material.uniforms;
|
|
20
|
+
u.uCoreColor.value.set(config.coreColor ?? '#ffffff');
|
|
21
|
+
u.uBurstColor.value.set(config.burstColor ?? '#ffaa00');
|
|
22
|
+
u.uRayCount.value = Math.max(3, config.rayCount ?? 8);
|
|
23
|
+
u.uIntensity.value = config.intensity ?? 1.0;
|
|
24
|
+
u.uOpacity.value = config.opacity ?? 1.0;
|
|
25
|
+
u.uHoverColor.value.set(config.hoverColor ?? '#ffffff');
|
|
26
|
+
u.uHoverRadius.value = config.hoverRadius ?? 0.3;
|
|
27
|
+
u.uHoverIntensity.value = config.hoverIntensity ?? 0.0;
|
|
28
|
+
}, [
|
|
29
|
+
config.coreColor,
|
|
30
|
+
config.burstColor,
|
|
31
|
+
config.rayCount,
|
|
32
|
+
config.intensity,
|
|
33
|
+
config.opacity,
|
|
34
|
+
config.hoverColor,
|
|
35
|
+
config.hoverRadius,
|
|
36
|
+
config.hoverIntensity,
|
|
37
|
+
material,
|
|
38
|
+
]);
|
|
39
|
+
useEffect(() => () => { geometry.dispose(); material.dispose(); }, [geometry, material]);
|
|
40
|
+
// Track elapsed time JS-side so loop on/off toggles cleanly without
|
|
41
|
+
// depending on the global clock for the progress phase.
|
|
42
|
+
const startRef = useRef(null);
|
|
43
|
+
// Reset start when loop toggles so behaviour is predictable.
|
|
44
|
+
useEffect(() => { startRef.current = null; }, [config.loop, config.durationMs]);
|
|
45
|
+
useFrame((state) => {
|
|
46
|
+
const now = state.clock.getElapsedTime();
|
|
47
|
+
if (startRef.current === null)
|
|
48
|
+
startRef.current = now;
|
|
49
|
+
const elapsedMs = (now - startRef.current) * 1000;
|
|
50
|
+
const duration = Math.max(1, config.durationMs ?? 1500);
|
|
51
|
+
const loop = config.loop ?? true;
|
|
52
|
+
const progress = loop
|
|
53
|
+
? (elapsedMs % duration) / duration
|
|
54
|
+
: Math.min(elapsedMs / duration, 1);
|
|
55
|
+
material.uniforms.uProgress.value = progress;
|
|
56
|
+
material.uniforms.uTime.value = now;
|
|
57
|
+
});
|
|
58
|
+
if (!config.enabled)
|
|
59
|
+
return null;
|
|
60
|
+
return _jsx("mesh", { geometry: geometry, material: material, frustumCulled: false });
|
|
61
|
+
};
|
|
62
|
+
export default SparklesBurst;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BufferGeometry } from 'three';
|
|
2
|
+
import type { Object3D } from 'three';
|
|
3
|
+
import React from "react";
|
|
4
|
+
import type { CreatedObjectSettings } from "@3driseai/3drise-core";
|
|
5
|
+
import type { TimeSettings } from "@3driseai/3drise-core";
|
|
6
|
+
export interface StarsProps {
|
|
7
|
+
settings: CreatedObjectSettings;
|
|
8
|
+
timeSettings?: TimeSettings;
|
|
9
|
+
sunSystemEnabled?: boolean;
|
|
10
|
+
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function generateStarsGeometry(count: number): BufferGeometry;
|
|
13
|
+
declare const Stars: React.FC<StarsProps>;
|
|
14
|
+
export default Stars;
|
|
15
|
+
//# sourceMappingURL=Stars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stars.d.ts","sourceRoot":"","sources":["../../src/components/Stars.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAA4C,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC1E;AAOD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAuDnE;AAYD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwK/B,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo, useCallback, useState, useEffect } from 'react';
|
|
3
|
+
import { BufferGeometry, BufferAttribute, AdditiveBlending, Color } from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
6
|
+
import { useParticlesColors } from '../hooks/useParticlesColors.js';
|
|
7
|
+
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
8
|
+
import { useNumericAnimation } from '../hooks/useNumericAnimation.js';
|
|
9
|
+
import { useMouseHandlers } from '../hooks/useMouseHandlers.js';
|
|
10
|
+
const STARS_SHADER_UNIFORM_MAP = {
|
|
11
|
+
color: 'uColor',
|
|
12
|
+
opacity: 'opacity',
|
|
13
|
+
};
|
|
14
|
+
export function generateStarsGeometry(count) {
|
|
15
|
+
const halfCount = Math.floor(count / 2);
|
|
16
|
+
const geometry = new BufferGeometry();
|
|
17
|
+
const topPositions = new Float32Array(halfCount * 3);
|
|
18
|
+
for (let i = 0; i < halfCount; i++) {
|
|
19
|
+
const u = Math.random();
|
|
20
|
+
const v = Math.random() * 0.5 + 0.5;
|
|
21
|
+
const theta = 2 * Math.PI * u;
|
|
22
|
+
const phi = Math.acos(2 * v - 1);
|
|
23
|
+
topPositions.set([
|
|
24
|
+
Math.sin(phi) * Math.cos(theta),
|
|
25
|
+
Math.cos(phi),
|
|
26
|
+
Math.sin(phi) * Math.sin(theta),
|
|
27
|
+
], i * 3);
|
|
28
|
+
}
|
|
29
|
+
const positions = new Float32Array(halfCount * 6);
|
|
30
|
+
positions.set(topPositions, 0);
|
|
31
|
+
for (let i = 0; i < halfCount; i++) {
|
|
32
|
+
positions.set([topPositions[i * 3], -topPositions[i * 3 + 1], topPositions[i * 3 + 2]], (i + halfCount) * 3);
|
|
33
|
+
}
|
|
34
|
+
const colors = new Float32Array(halfCount * 3);
|
|
35
|
+
for (let i = 0; i < halfCount; i++) {
|
|
36
|
+
const v = Math.random();
|
|
37
|
+
const c = v < 0.15 ? [0.8, 0.85, 1.0] : v < 0.3 ? [1.0, 0.95, 0.8] : [1.0, 1.0, 1.0];
|
|
38
|
+
colors.set(c, i * 3);
|
|
39
|
+
}
|
|
40
|
+
const mirroredColors = new Float32Array(halfCount * 6);
|
|
41
|
+
mirroredColors.set(colors, 0);
|
|
42
|
+
mirroredColors.set(colors, colors.length);
|
|
43
|
+
const sizes = new Float32Array(halfCount);
|
|
44
|
+
for (let i = 0; i < halfCount; i++) {
|
|
45
|
+
const v = Math.random();
|
|
46
|
+
sizes[i] = v < 0.01 ? 40 + Math.random() * 20 : v < 0.05 ? 25 + Math.random() * 15 : v < 0.2 ? 15 + Math.random() * 10 : 5 + Math.random() * 5;
|
|
47
|
+
}
|
|
48
|
+
const mirroredSizes = new Float32Array(halfCount * 2);
|
|
49
|
+
mirroredSizes.set(sizes, 0);
|
|
50
|
+
mirroredSizes.set(sizes, sizes.length);
|
|
51
|
+
const phases = new Float32Array(halfCount);
|
|
52
|
+
for (let i = 0; i < halfCount; i++)
|
|
53
|
+
phases[i] = Math.random() * Math.PI * 2;
|
|
54
|
+
const mirroredPhases = new Float32Array(halfCount * 2);
|
|
55
|
+
mirroredPhases.set(phases, 0);
|
|
56
|
+
mirroredPhases.set(phases, phases.length);
|
|
57
|
+
const freqs = new Float32Array(halfCount);
|
|
58
|
+
for (let i = 0; i < halfCount; i++)
|
|
59
|
+
freqs[i] = 1.0 + Math.random() * 2.0;
|
|
60
|
+
const mirroredFreqs = new Float32Array(halfCount * 2);
|
|
61
|
+
mirroredFreqs.set(freqs, 0);
|
|
62
|
+
mirroredFreqs.set(freqs, freqs.length);
|
|
63
|
+
geometry.setAttribute('position', new BufferAttribute(positions, 3));
|
|
64
|
+
geometry.setAttribute('color', new BufferAttribute(mirroredColors, 3));
|
|
65
|
+
geometry.setAttribute('size', new BufferAttribute(mirroredSizes, 1));
|
|
66
|
+
geometry.setAttribute('phase', new BufferAttribute(mirroredPhases, 1));
|
|
67
|
+
geometry.setAttribute('freq', new BufferAttribute(mirroredFreqs, 1));
|
|
68
|
+
return geometry;
|
|
69
|
+
}
|
|
70
|
+
// Module-scoped so the reference is stable across renders. A new object per
|
|
71
|
+
// render would make useSkySystem's [timeSettings] effect re-fire on every
|
|
72
|
+
// Stars re-render (its useFrame calls setIsVisible), stomping
|
|
73
|
+
// skySystemManager.enabled back to false between parent ticks.
|
|
74
|
+
const DEFAULT_TIME_SETTINGS = {
|
|
75
|
+
enabled: false,
|
|
76
|
+
timeOfDay: 12,
|
|
77
|
+
timescale: 60,
|
|
78
|
+
autoAnimate: false,
|
|
79
|
+
syncWithRealTime: false,
|
|
80
|
+
};
|
|
81
|
+
const Stars = ({ settings, timeSettings, sunSystemEnabled = false, onObjectReady }) => {
|
|
82
|
+
const pointsRef = useRef(null);
|
|
83
|
+
const materialRef = useRef(null);
|
|
84
|
+
const { meshSettings, config, animations, mouseMove } = settings;
|
|
85
|
+
const { position, rotation, scale, visible } = meshSettings;
|
|
86
|
+
const { count = 1000, color = '#ffffff', opacity = 1, rotateSpeed } = config;
|
|
87
|
+
const opacityRef = useRef(1);
|
|
88
|
+
const targetOpacityRef = useRef(1);
|
|
89
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
90
|
+
const [visibleOverride, setVisibleOverride] = useState(null);
|
|
91
|
+
const numericOverrideRef = useRef(null);
|
|
92
|
+
const mouseOverrideRef = useRef({});
|
|
93
|
+
const { interpolateProperty } = useMouseHandlers();
|
|
94
|
+
const [animatedTransform, setAnimatedTransform] = useState({
|
|
95
|
+
position, rotation, scale, targetPosition: position, targetRotation: rotation, targetScale: scale,
|
|
96
|
+
});
|
|
97
|
+
const [duration, setDuration] = useState(1);
|
|
98
|
+
const [colors, setColors] = useState({ baseColor: color, targetColor: color });
|
|
99
|
+
const { baseColorRef, targetColorRef, colorAnimationProgress } = useParticlesColors({
|
|
100
|
+
color: colors.baseColor,
|
|
101
|
+
targetColor: colors.targetColor,
|
|
102
|
+
});
|
|
103
|
+
const geometry = useMemo(() => generateStarsGeometry(count), [count]);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
onObjectReady && onObjectReady(settings, pointsRef.current);
|
|
106
|
+
return () => { geometry.dispose(); };
|
|
107
|
+
}, [geometry]);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
setAnimatedTransform({ position, rotation, scale });
|
|
110
|
+
}, [position, rotation, scale]);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
setColors(prev => ({ ...prev, baseColor: color, targetColor: color }));
|
|
113
|
+
}, [color]);
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (!sunSystemEnabled) {
|
|
116
|
+
setIsVisible(true);
|
|
117
|
+
opacityRef.current = 1;
|
|
118
|
+
targetOpacityRef.current = 1;
|
|
119
|
+
}
|
|
120
|
+
}, [sunSystemEnabled]);
|
|
121
|
+
const { animateNumeric } = useNumericAnimation();
|
|
122
|
+
useAnimationEvents({
|
|
123
|
+
onStepStart: (event) => {
|
|
124
|
+
if (!event.step?.transitions)
|
|
125
|
+
return;
|
|
126
|
+
for (const transition of event.step.transitions) {
|
|
127
|
+
if (transition.state !== 'stars' && !pointsRef.current)
|
|
128
|
+
continue;
|
|
129
|
+
const toProps = transition.properties.to || {};
|
|
130
|
+
const fromProps = transition.properties.from || {};
|
|
131
|
+
// visible — immediate boolean switch
|
|
132
|
+
if (toProps.visible !== undefined && pointsRef.current) {
|
|
133
|
+
// setVisibleOverride(toProps.visible);
|
|
134
|
+
pointsRef.current.visible = toProps.visible;
|
|
135
|
+
}
|
|
136
|
+
// color — existing path
|
|
137
|
+
setDuration(event.step.duration);
|
|
138
|
+
if (toProps.color !== undefined) {
|
|
139
|
+
setColors({
|
|
140
|
+
baseColor: fromProps.color,
|
|
141
|
+
targetColor: toProps.color,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// numeric: rotateSpeed, size
|
|
145
|
+
const STARS_NUMERIC_KEYS = ['rotateSpeed', 'size'];
|
|
146
|
+
const from = {};
|
|
147
|
+
const to = {};
|
|
148
|
+
for (const key of STARS_NUMERIC_KEYS) {
|
|
149
|
+
const toVal = toProps[key];
|
|
150
|
+
if (toVal === undefined)
|
|
151
|
+
continue;
|
|
152
|
+
to[key] = toVal;
|
|
153
|
+
from[key] = fromProps[key] ?? settings[key] ?? toVal;
|
|
154
|
+
}
|
|
155
|
+
if (Object.keys(to).length > 0) {
|
|
156
|
+
animateNumeric(from, to, (updated) => {
|
|
157
|
+
numericOverrideRef.current = { ...numericOverrideRef.current, ...updated };
|
|
158
|
+
}, () => {
|
|
159
|
+
numericOverrideRef.current = null;
|
|
160
|
+
// setVisibleOverride(null);
|
|
161
|
+
}, event.step?.duration);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
const handleTimeUpdate = useCallback((state) => {
|
|
167
|
+
const { normalizedTime, isDaytime, elapsedTime, delta, autoAnimate } = state;
|
|
168
|
+
if (!autoAnimate || !sunSystemEnabled)
|
|
169
|
+
return;
|
|
170
|
+
if (!isDaytime) {
|
|
171
|
+
targetOpacityRef.current = 1;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const sunriseEnd = 0.15;
|
|
175
|
+
const sunsetStart = 0.85;
|
|
176
|
+
if (normalizedTime <= sunriseEnd) {
|
|
177
|
+
targetOpacityRef.current = 1 - normalizedTime / sunriseEnd;
|
|
178
|
+
}
|
|
179
|
+
else if (normalizedTime >= sunsetStart) {
|
|
180
|
+
targetOpacityRef.current = (normalizedTime - sunsetStart) / (1 - sunsetStart);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
targetOpacityRef.current = 0;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const opacityLerpSpeed = Math.min(1, 1.5 * (delta !== 0 ? delta : 1));
|
|
187
|
+
opacityRef.current += (targetOpacityRef.current - opacityRef.current) * opacityLerpSpeed;
|
|
188
|
+
const shouldBeVisible = opacityRef.current > 0.01;
|
|
189
|
+
if (shouldBeVisible !== isVisible)
|
|
190
|
+
setIsVisible(shouldBeVisible);
|
|
191
|
+
if (materialRef.current) {
|
|
192
|
+
materialRef.current.uTime = elapsedTime;
|
|
193
|
+
materialRef.current.uOpacity = opacityRef.current;
|
|
194
|
+
}
|
|
195
|
+
}, [isVisible, sunSystemEnabled]);
|
|
196
|
+
useSkySystem({
|
|
197
|
+
timeSettings: timeSettings ?? DEFAULT_TIME_SETTINGS,
|
|
198
|
+
onTimeUpdate: handleTimeUpdate,
|
|
199
|
+
enabled: sunSystemEnabled && !!timeSettings,
|
|
200
|
+
});
|
|
201
|
+
const speed = 1 / duration;
|
|
202
|
+
const handleMouseMove = (mouse) => {
|
|
203
|
+
// if (!handlers?.onMouseMove?.enabled) return;
|
|
204
|
+
// if (!handlers.onMouseMove.properties.length) return;
|
|
205
|
+
// if (!materialRef.current || !pointsRef.current) return;
|
|
206
|
+
// handlers.onMouseMove.properties.forEach((cfg: any) => {
|
|
207
|
+
// const { property, propertySettings } = cfg;
|
|
208
|
+
// const { min: minValue, max: maxValue, axis, sensitivity = 1, inverted = false } = propertySettings;
|
|
209
|
+
// const baseValue = (settings as any)[property];
|
|
210
|
+
// if (baseValue === undefined) return;
|
|
211
|
+
// const interpolated = interpolateProperty(
|
|
212
|
+
// baseValue, minValue, maxValue, mouse, axis, sensitivity, inverted,
|
|
213
|
+
// );
|
|
214
|
+
// const uniformName = STARS_SHADER_UNIFORM_MAP[property];
|
|
215
|
+
// if (uniformName) {
|
|
216
|
+
// applySingleProperty(materialRef.current, uniformName, interpolated);
|
|
217
|
+
// return;
|
|
218
|
+
// }
|
|
219
|
+
// if (property === 'rotateSpeed' || property === 'size') {
|
|
220
|
+
// const key: 'rotateSpeed' | 'size' = property;
|
|
221
|
+
// mouseOverrideRef.current[key] = interpolated as number;
|
|
222
|
+
// }
|
|
223
|
+
// });
|
|
224
|
+
};
|
|
225
|
+
useFrame((state, delta) => {
|
|
226
|
+
if (!pointsRef.current)
|
|
227
|
+
return;
|
|
228
|
+
if (pointsRef.current.visible === false)
|
|
229
|
+
return;
|
|
230
|
+
const effectiveRotateSpeed = numericOverrideRef.current?.rotateSpeed
|
|
231
|
+
?? mouseOverrideRef.current.rotateSpeed
|
|
232
|
+
?? rotateSpeed;
|
|
233
|
+
pointsRef.current.rotation.y += effectiveRotateSpeed * 0.01;
|
|
234
|
+
const effectiveSize = numericOverrideRef.current?.size
|
|
235
|
+
?? mouseOverrideRef.current.size;
|
|
236
|
+
if (effectiveSize !== undefined && materialRef.current) {
|
|
237
|
+
materialRef.current.size = effectiveSize;
|
|
238
|
+
}
|
|
239
|
+
if (materialRef.current && colors.targetColor !== colors.baseColor) {
|
|
240
|
+
colorAnimationProgress.current = Math.min(1, colorAnimationProgress.current + (delta || 1) * speed);
|
|
241
|
+
materialRef.current.colorMix = colorAnimationProgress.current;
|
|
242
|
+
materialRef.current.uColor = baseColorRef.current;
|
|
243
|
+
materialRef.current.targetColor = targetColorRef.current;
|
|
244
|
+
}
|
|
245
|
+
handleMouseMove(state.pointer);
|
|
246
|
+
});
|
|
247
|
+
// if (!(visibleOverride ?? visible) || !isVisible) return null;
|
|
248
|
+
return (_jsx("points", { ref: pointsRef, geometry: geometry, scale: typeof scale === 'number' ? scale : scale[0], renderOrder: -1, frustumCulled: false, userData: { id: '3drise-stars' }, visible: visible, children: _jsx("starsMaterial", { ref: materialRef, transparent: true, depthWrite: false, depthTest: true, blending: AdditiveBlending, uColor: new Color(color), uOpacity: opacity, targetColor: new Color(colors.targetColor), colorMix: 0 }) }));
|
|
249
|
+
};
|
|
250
|
+
export default Stars;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type SunProps = {
|
|
2
|
+
/** Radius of the sun core. Default 1. */
|
|
3
|
+
radius?: number;
|
|
4
|
+
/** Corona shell size relative to the core. Default 1.25. */
|
|
5
|
+
coronaScale?: number;
|
|
6
|
+
/** Uniform overrides for SunCoreMaterial. */
|
|
7
|
+
coreUniforms?: Record<string, any>;
|
|
8
|
+
/** Uniform overrides for SunCoronaMaterial. */
|
|
9
|
+
coronaUniforms?: Record<string, any>;
|
|
10
|
+
/** Uniform overrides for SunFlareMaterial. */
|
|
11
|
+
flareUniforms?: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
export default function Sun({ radius, coronaScale, coreUniforms, coronaUniforms, flareUniforms, }: SunProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=Sun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sun.d.ts","sourceRoot":"","sources":["../../src/components/Sun.tsx"],"names":[],"mappings":"AAGA,KAAK,QAAQ,GAAG;IACZ,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,MAAU,EAAE,WAAkB,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,GAAG,EAAE,QAAQ,+BAErH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// import { ReactNode } from "react";
|
|
3
|
+
import SunCore from "./SunCore.js";
|
|
4
|
+
import Corona from "./Corona.js";
|
|
5
|
+
export default function Sun({ radius = 1, coronaScale = 1.25, coreUniforms, coronaUniforms, flareUniforms, }) {
|
|
6
|
+
return (_jsxs("group", { children: [_jsx(SunCore, { radius: radius, uniforms: coreUniforms }), _jsx(Corona, { radius: radius, shellScale: coronaScale, uniforms: coronaUniforms }), _jsx("pointLight", { color: "#ffa544", intensity: 6, distance: 60, decay: 1.6 })] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
sunCoreMaterial: any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export type SunCoreProps = {
|
|
10
|
+
/** Radius of the core. Default 1. */
|
|
11
|
+
radius?: number;
|
|
12
|
+
/** Self-rotation speed in rad/s. Default 0.02. */
|
|
13
|
+
rotationSpeed?: number;
|
|
14
|
+
/** Uniform overrides for SunCoreMaterial (u_speed, u_cellScale, u_color1..5, ...). */
|
|
15
|
+
uniforms?: Record<string, number | THREE.Vector3 | number[]>;
|
|
16
|
+
};
|
|
17
|
+
export default function SunCore({ radius, rotationSpeed, uniforms }: SunCoreProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=SunCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SunCore.d.ts","sourceRoot":"","sources":["../../src/components/SunCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,GAAG,CAAC;QACV,UAAU,iBAAiB;YACvB,eAAe,EAAE,GAAG,CAAC;SACxB;KACJ;CACJ;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,MAAU,EAAE,aAAoB,EAAE,QAAQ,EAAE,EAAE,YAAY,+BAU3F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { useFrame } from "@react-three/fiber";
|
|
4
|
+
export default function SunCore({ radius = 1, rotationSpeed = 0.02, uniforms }) {
|
|
5
|
+
const meshRef = useRef(null);
|
|
6
|
+
// drei's shaderMaterial exposes each uniform as a property on the instance.
|
|
7
|
+
const matRef = useRef(null);
|
|
8
|
+
useFrame((_, delta) => {
|
|
9
|
+
if (matRef.current)
|
|
10
|
+
matRef.current.u_time += delta;
|
|
11
|
+
// if (meshRef.current) meshRef.current.rotation.y += delta * rotationSpeed;
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs("mesh", { ref: meshRef, scale: radius, children: [_jsx("icosahedronGeometry", { args: [1, 64] }), _jsx("lavaMaterial", { ref: matRef, ...uniforms })] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { TimeSettings } from "@3driseai/3drise-core";
|
|
4
|
+
export interface SunLightProps {
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
timeSettings: TimeSettings;
|
|
7
|
+
targetPosition?: THREE.Vector3;
|
|
8
|
+
shadowDistance?: number;
|
|
9
|
+
intensity?: number;
|
|
10
|
+
castShadow?: boolean;
|
|
11
|
+
shadowMapSize?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const SunLight: React.FC<SunLightProps>;
|
|
14
|
+
export default SunLight;
|
|
15
|
+
//# sourceMappingURL=SunLight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SunLight.d.ts","sourceRoot":"","sources":["../../src/components/SunLight.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAaD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAyCrC,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useCallback } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
5
|
+
const COLORS = {
|
|
6
|
+
white: new THREE.Color(0xffffff),
|
|
7
|
+
orange: new THREE.Color(0xff4500),
|
|
8
|
+
moon: new THREE.Color(0xe6e8fa),
|
|
9
|
+
};
|
|
10
|
+
const MAX_ELEVATION = 42;
|
|
11
|
+
const SUNRISE = 6;
|
|
12
|
+
const SUNSET = 21;
|
|
13
|
+
const DARKNESS_START = 20.42;
|
|
14
|
+
const DARKNESS_END = 6.58;
|
|
15
|
+
const SunLight = ({ visible = true, timeSettings, targetPosition = new THREE.Vector3(0, 0, 0), shadowDistance = 300, intensity: intensityMultiplier = 1, castShadow = true, shadowMapSize = 2048, }) => {
|
|
16
|
+
const lightRef = useRef(null);
|
|
17
|
+
const colorRef = useRef(new THREE.Color(0xffe5b0));
|
|
18
|
+
const targetColorRef = useRef(new THREE.Color(0xffe5b0));
|
|
19
|
+
const intensityRef = useRef(1);
|
|
20
|
+
const targetIntensityRef = useRef(1);
|
|
21
|
+
const handleTimeUpdate = useCallback((state) => {
|
|
22
|
+
const { timeInHours, normalizedTime, isDaytime, sunDirection, sunElevation } = state;
|
|
23
|
+
const isInDarkTransition = (timeInHours >= DARKNESS_START && timeInHours <= SUNSET) ||
|
|
24
|
+
(timeInHours >= SUNRISE && timeInHours <= DARKNESS_END);
|
|
25
|
+
if (isDaytime) {
|
|
26
|
+
const normalizedElevation = Math.min(sunElevation / MAX_ELEVATION, 1);
|
|
27
|
+
const t = Math.pow(1 - normalizedElevation, 3);
|
|
28
|
+
targetColorRef.current.lerpColors(COLORS.white, COLORS.orange, t);
|
|
29
|
+
targetIntensityRef.current = isInDarkTransition
|
|
30
|
+
? 0.1
|
|
31
|
+
: Math.min(40, Math.pow(normalizedElevation, 1.2) * 4);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
targetColorRef.current.copy(COLORS.moon).multiplyScalar(1.8);
|
|
35
|
+
targetIntensityRef.current = 0.5;
|
|
36
|
+
}
|
|
37
|
+
const lerpSpeed = Math.min(1, 2.0 * (state.delta || 1));
|
|
38
|
+
colorRef.current.lerp(targetColorRef.current, lerpSpeed);
|
|
39
|
+
intensityRef.current += (targetIntensityRef.current - intensityRef.current) * lerpSpeed;
|
|
40
|
+
if (lightRef.current) {
|
|
41
|
+
lightRef.current.position.set(targetPosition.x + sunDirection.x * shadowDistance, targetPosition.y + sunDirection.y * shadowDistance, targetPosition.z + sunDirection.z * shadowDistance);
|
|
42
|
+
lightRef.current.target.position.copy(targetPosition);
|
|
43
|
+
lightRef.current.target.updateMatrixWorld();
|
|
44
|
+
lightRef.current.intensity = intensityRef.current * intensityMultiplier;
|
|
45
|
+
lightRef.current.color.copy(colorRef.current);
|
|
46
|
+
}
|
|
47
|
+
}, [targetPosition, shadowDistance, intensityMultiplier]);
|
|
48
|
+
useSkySystem({
|
|
49
|
+
timeSettings,
|
|
50
|
+
onTimeUpdate: handleTimeUpdate,
|
|
51
|
+
enabled: visible,
|
|
52
|
+
});
|
|
53
|
+
if (!visible)
|
|
54
|
+
return null;
|
|
55
|
+
return (_jsx("directionalLight", { ref: lightRef, castShadow: castShadow, "shadow-mapSize-width": shadowMapSize, "shadow-mapSize-height": shadowMapSize, "shadow-camera-left": -50, "shadow-camera-right": 50, "shadow-camera-top": 50, "shadow-camera-bottom": -50, "shadow-camera-near": 0.5, "shadow-camera-far": 1000, "shadow-normalBias": 0.02, "shadow-bias": 0.000002, "shadow-radius": 2 }));
|
|
56
|
+
};
|
|
57
|
+
export default SunLight;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TextSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface Text2DProps {
|
|
4
|
+
textSettings: TextSettings;
|
|
5
|
+
onTextClick?: (textSettings: TextSettings) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const Text2D: React.FC<Text2DProps>;
|
|
8
|
+
export default Text2D;
|
|
9
|
+
//# sourceMappingURL=Text2D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text2D.d.ts","sourceRoot":"","sources":["../../src/components/Text2D.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAW;IACxB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACtD;AAGD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+CjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useCallback, useMemo } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import { Text, useCursor } from '@react-three/drei';
|
|
5
|
+
import { createDefaultEffectState, applyTransformEffects } from '@3driseai/3drise-core';
|
|
6
|
+
import { fontManager } from '@3driseai/3drise-core';
|
|
7
|
+
import { getTextEffectProps } from '../utils/textEffects.js';
|
|
8
|
+
const Text2D = ({ textSettings, onTextClick }) => {
|
|
9
|
+
const groupRef = useRef(null);
|
|
10
|
+
const textRef = useRef(null);
|
|
11
|
+
const [hovered, setHovered] = useState(false);
|
|
12
|
+
const [clicked, setClicked] = useState(false);
|
|
13
|
+
const effectStateRef = useRef(null);
|
|
14
|
+
const { config, materialSettings } = textSettings;
|
|
15
|
+
const text2DConfig = config;
|
|
16
|
+
const { text } = text2DConfig;
|
|
17
|
+
const { fontSize = 0.5, lineHeight = 1.2, letterSpacing = 0, textAlign = 'center', anchorX = 'center', anchorY = 'middle', font, maxWidth, } = text2DConfig;
|
|
18
|
+
const fontInfo = font ? fontManager.getFont(font) : null;
|
|
19
|
+
const fontUrl = fontInfo?.googleFont;
|
|
20
|
+
const color = 'color' in materialSettings ? materialSettings.color : '#ffffff';
|
|
21
|
+
const opacity = 'opacity' in materialSettings ? materialSettings.opacity : 1;
|
|
22
|
+
const transformEffects = textSettings.animations?.transform?.effects || [];
|
|
23
|
+
const defaultHoverSettings = { sensitivity: 0.5, applyToChildren: true };
|
|
24
|
+
const { sensitivity = 0.5 } = defaultHoverSettings;
|
|
25
|
+
useCursor(hovered);
|
|
26
|
+
const handlePointerEnter = useCallback((e) => {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
setHovered(true);
|
|
29
|
+
}, []);
|
|
30
|
+
const handlePointerLeave = useCallback(() => {
|
|
31
|
+
setHovered(false);
|
|
32
|
+
}, []);
|
|
33
|
+
const handleClick = useCallback((e) => {
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
onTextClick?.(textSettings);
|
|
36
|
+
}, [onTextClick, textSettings]);
|
|
37
|
+
useFrame((state, dt) => {
|
|
38
|
+
if (!groupRef.current)
|
|
39
|
+
return;
|
|
40
|
+
const time = state.clock.elapsedTime;
|
|
41
|
+
if (!effectStateRef.current) {
|
|
42
|
+
effectStateRef.current = createDefaultEffectState(groupRef.current);
|
|
43
|
+
}
|
|
44
|
+
if (transformEffects.length > 0) {
|
|
45
|
+
const enabledEffects = transformEffects.filter(e => e.enabled !== false);
|
|
46
|
+
if (enabledEffects.length > 0) {
|
|
47
|
+
applyTransformEffects(groupRef.current, enabledEffects, time, dt, effectStateRef.current, hovered, clicked, sensitivity);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const hasFadeEffect = transformEffects.some(e => e.type === 'fade' && e.enabled !== false);
|
|
52
|
+
const finalOpacity = hasFadeEffect ? opacity : opacity;
|
|
53
|
+
const effectProps = useMemo(() => getTextEffectProps([]), []);
|
|
54
|
+
return (_jsx("group", { ref: groupRef, name: `text2d-${textSettings.name}`, userData: { textSettings }, children: _jsx(Text, { ref: textRef, fontSize: fontSize, color: color, maxWidth: maxWidth, lineHeight: lineHeight, letterSpacing: letterSpacing, textAlign: textAlign, anchorX: anchorX, anchorY: anchorY, font: fontUrl || undefined, fillOpacity: finalOpacity, onPointerEnter: handlePointerEnter, onPointerLeave: handlePointerLeave, onClick: handleClick, ...effectProps, children: text }) }));
|
|
55
|
+
};
|
|
56
|
+
export default Text2D;
|