@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,173 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { getShaderByName } from '@3driseai/3drise-core';
|
|
6
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
7
|
+
// Glowing node points at each atom position
|
|
8
|
+
// const nodeVertShader = /* glsl */`
|
|
9
|
+
// attribute float aPhase;
|
|
10
|
+
// attribute float aSize;
|
|
11
|
+
// uniform float u_time;
|
|
12
|
+
// uniform float uPointSize;
|
|
13
|
+
// uniform float uIntensity;
|
|
14
|
+
// varying float vAlpha;
|
|
15
|
+
// varying vec3 vColor;
|
|
16
|
+
// vec3 hsv2rgb(float h, float s, float v){
|
|
17
|
+
// vec3 rgb=clamp(abs(mod(h*6.+vec3(0.,4.,2.),6.)-3.)-1.,0.,1.);
|
|
18
|
+
// return v*mix(vec3(1.),rgb,s);
|
|
19
|
+
// }
|
|
20
|
+
// void main() {
|
|
21
|
+
// // Each node has independent color + pulse
|
|
22
|
+
// float hue = mod(aPhase + u_time * 0.08, 1.0);
|
|
23
|
+
// float pulse = 0.5 + 0.5 * sin(u_time * 2.5 + aPhase * 6.28);
|
|
24
|
+
// vColor = hsv2rgb(hue, 0.85, 1.0);
|
|
25
|
+
// vAlpha = 0.55 + 0.45 * pulse;
|
|
26
|
+
// vec4 mv = modelViewMatrix * vec4(position, 1.0);
|
|
27
|
+
// gl_PointSize = uPointSize * aSize * (0.6 + 0.4 * pulse) * uIntensity * (250.0 / -mv.z);
|
|
28
|
+
// gl_Position = projectionMatrix * mv;
|
|
29
|
+
// }
|
|
30
|
+
// `;
|
|
31
|
+
// const nodeFragShader = /* glsl */`
|
|
32
|
+
// varying float vAlpha;
|
|
33
|
+
// varying vec3 vColor;
|
|
34
|
+
// uniform float uOpacity;
|
|
35
|
+
// void main() {
|
|
36
|
+
// vec2 coord = gl_PointCoord - vec2(0.5);
|
|
37
|
+
// float dist = length(coord);
|
|
38
|
+
// if (dist > 0.5) discard;
|
|
39
|
+
// // Gaussian core glow
|
|
40
|
+
// float glow = exp(-dist * dist * 8.0);
|
|
41
|
+
// // Four-point diffraction spike (like a bright star)
|
|
42
|
+
// float cx = exp(-abs(coord.x) * 20.0) * exp(-coord.y*coord.y * 36.0);
|
|
43
|
+
// float cy = exp(-abs(coord.y) * 20.0) * exp(-coord.x*coord.x * 36.0);
|
|
44
|
+
// float spike = (cx + cy) * 0.5;
|
|
45
|
+
// // White-hot centre
|
|
46
|
+
// float core = exp(-dist * dist * 80.0);
|
|
47
|
+
// vec3 col = mix(vColor, vec3(1.0), core * 0.8 + spike * 0.2);
|
|
48
|
+
// gl_FragColor = vec4(col, vAlpha * uOpacity * (glow + spike * 0.6 + core));
|
|
49
|
+
// }
|
|
50
|
+
// `;
|
|
51
|
+
const MoleculesEffect = ({ boundingRadius, config, animations }) => {
|
|
52
|
+
const { atomCount, orbitRadius, atomSize, showBonds, opacity, speed, intensity } = config;
|
|
53
|
+
const startValuesCacheRef = useRef({});
|
|
54
|
+
const shaderData = getShaderByName('Molecules');
|
|
55
|
+
const tRef = useRef(new Float32Array(atomCount));
|
|
56
|
+
const r = boundingRadius * orbitRadius;
|
|
57
|
+
const PHI = 1.6180339887;
|
|
58
|
+
// 3D Lissajous frequency ratios per atom
|
|
59
|
+
const orbitalParams = useMemo(() => {
|
|
60
|
+
const pairs = [
|
|
61
|
+
[1, 2, 3], [2, 3, 1], [3, 1, 2], [1, 3, 2], [2, 1, 3], [3, 2, 1],
|
|
62
|
+
[1, 1, 2], [2, 2, 1], [1, 2, 2], [2, 1, 1], [3, 3, 2], [2, 3, 3],
|
|
63
|
+
];
|
|
64
|
+
return Array.from({ length: atomCount }, (_, i) => {
|
|
65
|
+
const [fx, fy, fz] = pairs[i % pairs.length];
|
|
66
|
+
return {
|
|
67
|
+
fx, fy, fz,
|
|
68
|
+
px: (i * PHI * Math.PI) % (Math.PI * 2),
|
|
69
|
+
py: (i * PHI * PHI * Math.PI) % (Math.PI * 2),
|
|
70
|
+
pz: (i * PHI ** 3 * Math.PI) % (Math.PI * 2),
|
|
71
|
+
hueBase: i / Math.max(atomCount - 1, 1),
|
|
72
|
+
speedMult: 0.65 + (i % 7) * 0.07,
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
}, [atomCount]);
|
|
76
|
+
// Resize tRef and spread initial times so atoms don't cluster at cycle start
|
|
77
|
+
useMemo(() => {
|
|
78
|
+
tRef.current = new Float32Array(atomCount);
|
|
79
|
+
for (let i = 0; i < atomCount; i++)
|
|
80
|
+
tRef.current[i] = (i / atomCount) * Math.PI * 2;
|
|
81
|
+
}, [atomCount]);
|
|
82
|
+
// ── Node (point) geometry ──────────────────────────────────────────────────
|
|
83
|
+
const { nodeGeo, nodeMat } = useMemo(() => {
|
|
84
|
+
const phases = new Float32Array(atomCount);
|
|
85
|
+
const sizes = new Float32Array(atomCount);
|
|
86
|
+
for (let i = 0; i < atomCount; i++) {
|
|
87
|
+
phases[i] = i / atomCount; // 0..1 → hue spread
|
|
88
|
+
sizes[i] = 0.8 + Math.random() * 0.6; // slight size variation
|
|
89
|
+
}
|
|
90
|
+
const geo = new THREE.BufferGeometry();
|
|
91
|
+
geo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(atomCount * 3), 3));
|
|
92
|
+
geo.setAttribute('aPhase', new THREE.BufferAttribute(phases, 1));
|
|
93
|
+
geo.setAttribute('aSize', new THREE.BufferAttribute(sizes, 1));
|
|
94
|
+
const mat = new THREE.ShaderMaterial({
|
|
95
|
+
vertexShader: shaderData.vertex,
|
|
96
|
+
fragmentShader: shaderData.fragment,
|
|
97
|
+
uniforms: {
|
|
98
|
+
u_time: { value: 0 },
|
|
99
|
+
uPointSize: { value: atomSize * 200 },
|
|
100
|
+
uIntensity: { value: intensity },
|
|
101
|
+
uOpacity: { value: opacity },
|
|
102
|
+
},
|
|
103
|
+
transparent: true,
|
|
104
|
+
depthWrite: false,
|
|
105
|
+
blending: THREE.AdditiveBlending,
|
|
106
|
+
});
|
|
107
|
+
return { nodeGeo: geo, nodeMat: mat };
|
|
108
|
+
}, [atomCount, atomSize, intensity, opacity]);
|
|
109
|
+
// ── Bond (line) geometry with per-vertex color ─────────────────────────────
|
|
110
|
+
const { bondGeo, bondMat } = useMemo(() => {
|
|
111
|
+
const vertCount = atomCount * 2; // each bond = 2 verts
|
|
112
|
+
const geo = new THREE.BufferGeometry();
|
|
113
|
+
const positions = new Float32Array(vertCount * 3);
|
|
114
|
+
const colors = new Float32Array(vertCount * 3);
|
|
115
|
+
geo.setAttribute('position', new THREE.BufferAttribute(positions, 3));
|
|
116
|
+
geo.setAttribute('color', new THREE.BufferAttribute(colors, 3));
|
|
117
|
+
const mat = new THREE.LineBasicMaterial({
|
|
118
|
+
vertexColors: true,
|
|
119
|
+
transparent: true,
|
|
120
|
+
opacity: opacity * 0.7,
|
|
121
|
+
depthWrite: false,
|
|
122
|
+
blending: THREE.AdditiveBlending,
|
|
123
|
+
});
|
|
124
|
+
return { bondGeo: geo, bondMat: mat };
|
|
125
|
+
}, [atomCount, opacity]);
|
|
126
|
+
const atomPos = useRef([]);
|
|
127
|
+
useMemo(() => {
|
|
128
|
+
atomPos.current = Array.from({ length: atomCount }, () => new THREE.Vector3());
|
|
129
|
+
}, [atomCount]);
|
|
130
|
+
const tmpCol = useMemo(() => new THREE.Color(), []);
|
|
131
|
+
useFrame((state, delta) => {
|
|
132
|
+
const t = state.clock.getElapsedTime();
|
|
133
|
+
nodeMat.uniforms.u_time.value = t;
|
|
134
|
+
const nodePos = nodeGeo.attributes.position;
|
|
135
|
+
for (let i = 0; i < atomCount; i++) {
|
|
136
|
+
tRef.current[i] += delta * speed * orbitalParams[i].speedMult;
|
|
137
|
+
const a = tRef.current[i];
|
|
138
|
+
const p = orbitalParams[i];
|
|
139
|
+
// 3D Lissajous position
|
|
140
|
+
const x = Math.cos(p.fx * a + p.px) * r;
|
|
141
|
+
const y = Math.sin(p.fy * a + p.py) * r * 0.75;
|
|
142
|
+
const z = Math.sin(p.fz * a + p.pz) * r;
|
|
143
|
+
atomPos.current[i].set(x, y, z);
|
|
144
|
+
nodePos.setXYZ(i, x, y, z);
|
|
145
|
+
}
|
|
146
|
+
nodePos.needsUpdate = true;
|
|
147
|
+
// Update bond geometry + animated per-vertex color
|
|
148
|
+
if (showBonds) {
|
|
149
|
+
const bondPos = bondGeo.attributes.position;
|
|
150
|
+
const bondCol = bondGeo.attributes.color;
|
|
151
|
+
for (let i = 0; i < atomCount; i++) {
|
|
152
|
+
const curr = atomPos.current[i];
|
|
153
|
+
const next = atomPos.current[(i + 1) % atomCount];
|
|
154
|
+
bondPos.setXYZ(i * 2, curr.x, curr.y, curr.z);
|
|
155
|
+
bondPos.setXYZ(i * 2 + 1, next.x, next.y, next.z);
|
|
156
|
+
// Color: each vertex gets a hue based on its atom's phase + time
|
|
157
|
+
const hue0 = (orbitalParams[i].hueBase + t * 0.07) % 1;
|
|
158
|
+
const hue1 = (orbitalParams[(i + 1) % atomCount].hueBase + t * 0.07) % 1;
|
|
159
|
+
tmpCol.setHSL(hue0, 1.0, 0.6);
|
|
160
|
+
bondCol.setXYZ(i * 2, tmpCol.r, tmpCol.g, tmpCol.b);
|
|
161
|
+
tmpCol.setHSL(hue1, 1.0, 0.6);
|
|
162
|
+
bondCol.setXYZ(i * 2 + 1, tmpCol.r, tmpCol.g, tmpCol.b);
|
|
163
|
+
}
|
|
164
|
+
bondPos.needsUpdate = true;
|
|
165
|
+
bondCol.needsUpdate = true;
|
|
166
|
+
}
|
|
167
|
+
if (animations?.length) {
|
|
168
|
+
applyGenerativeAnimations([nodeMat, bondMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
return (_jsxs("group", { name: "MoleculesEffect", children: [_jsx("points", { geometry: nodeGeo, material: nodeMat }), showBonds && (_jsx("lineSegments", { geometry: bondGeo, material: bondMat }))] }));
|
|
172
|
+
};
|
|
173
|
+
export default MoleculesEffect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { NeuralNetworkConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
+
interface NeuralNetworkEffectProps {
|
|
4
|
+
boundingRadius: number;
|
|
5
|
+
config: NeuralNetworkConfig;
|
|
6
|
+
animations?: AnimationOptions[];
|
|
7
|
+
}
|
|
8
|
+
declare const NeuralNetworkEffect: React.FC<NeuralNetworkEffectProps>;
|
|
9
|
+
export default NeuralNetworkEffect;
|
|
10
|
+
//# sourceMappingURL=NeuralNetworkEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NeuralNetworkEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/NeuralNetworkEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACnF,UAAU,wBAAwB;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA6BD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA2J3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
// Glow sprite for pulse signals and node flashes
|
|
7
|
+
const pulseVert = /* glsl */ `
|
|
8
|
+
attribute float aBright;
|
|
9
|
+
uniform float uSize;
|
|
10
|
+
varying float vB;
|
|
11
|
+
void main() {
|
|
12
|
+
vB = aBright;
|
|
13
|
+
if (vB < 0.01) { gl_PointSize = 0.0; gl_Position = vec4(0); return; }
|
|
14
|
+
vec4 mv = modelViewMatrix * vec4(position, 1.0);
|
|
15
|
+
gl_PointSize = uSize * vB * (200.0 / -mv.z);
|
|
16
|
+
gl_Position = projectionMatrix * mv;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
const pulseFrag = /* glsl */ `
|
|
20
|
+
uniform vec3 uColor;
|
|
21
|
+
uniform float uOpacity;
|
|
22
|
+
varying float vB;
|
|
23
|
+
void main() {
|
|
24
|
+
if (vB < 0.01) discard;
|
|
25
|
+
vec2 c = gl_PointCoord - 0.5;
|
|
26
|
+
if (length(c) > 0.5) discard;
|
|
27
|
+
float g = exp(-dot(c, c) * 5.5);
|
|
28
|
+
gl_FragColor = vec4(uColor, g * vB * uOpacity);
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
const MAX_PULSES = 4;
|
|
32
|
+
const NeuralNetworkEffect = ({ boundingRadius, config, animations }) => {
|
|
33
|
+
const { nodeCount, signalSpeed, nodeColor, pulseColor, orbitSpeed, opacity, speed, intensity } = config;
|
|
34
|
+
const startValuesCacheRef = useRef({});
|
|
35
|
+
const groupRef = useRef(null);
|
|
36
|
+
// Node orbit state
|
|
37
|
+
const orbitAngles = useRef(new Float32Array(0));
|
|
38
|
+
const pulses = useRef([]);
|
|
39
|
+
const nextPulse = useRef(0);
|
|
40
|
+
const r = boundingRadius * 1.35;
|
|
41
|
+
const N = Math.max(8, Math.min(nodeCount, 40));
|
|
42
|
+
const scene = useMemo(() => {
|
|
43
|
+
// ── Node positions on Fibonacci sphere ────────────────────────────────
|
|
44
|
+
const basePos = [];
|
|
45
|
+
const goldenAngle = Math.PI * (3 - Math.sqrt(5));
|
|
46
|
+
for (let i = 0; i < N; i++) {
|
|
47
|
+
const y = 1 - (i / (N - 1)) * 2;
|
|
48
|
+
const rad = Math.sqrt(1 - y * y) * r;
|
|
49
|
+
const phi = i * goldenAngle;
|
|
50
|
+
basePos.push(new THREE.Vector3(Math.cos(phi) * rad, y * r, Math.sin(phi) * rad));
|
|
51
|
+
}
|
|
52
|
+
// Orbit axes — random unit vectors
|
|
53
|
+
const orbitAxes = Array.from({ length: N }, () => new THREE.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5).normalize());
|
|
54
|
+
const orbitSpeeds = Array.from({ length: N }, () => 0.4 + Math.random() * 0.6);
|
|
55
|
+
const angles = new Float32Array(N).map((_, i) => i * 0.7);
|
|
56
|
+
orbitAngles.current = angles;
|
|
57
|
+
// ── Edges — connect nearby pairs ─────────────────────────────────────
|
|
58
|
+
const MAX_DIST = r * 0.85;
|
|
59
|
+
const edges = [];
|
|
60
|
+
const degree = new Int32Array(N);
|
|
61
|
+
for (let i = 0; i < N; i++) {
|
|
62
|
+
for (let j = i + 1; j < N; j++) {
|
|
63
|
+
if (degree[i] >= 3 || degree[j] >= 3)
|
|
64
|
+
continue;
|
|
65
|
+
if (basePos[i].distanceTo(basePos[j]) < MAX_DIST) {
|
|
66
|
+
edges.push([i, j]);
|
|
67
|
+
degree[i]++;
|
|
68
|
+
degree[j]++;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const edgeVerts = new Float32Array(edges.length * 6);
|
|
73
|
+
const edgeCols = new Float32Array(edges.length * 6);
|
|
74
|
+
const nc = new THREE.Color(nodeColor);
|
|
75
|
+
const DIM = 0.06;
|
|
76
|
+
for (let e = 0; e < edges.length; e++) {
|
|
77
|
+
const [a, b] = edges[e];
|
|
78
|
+
edgeVerts.set([basePos[a].x, basePos[a].y, basePos[a].z, basePos[b].x, basePos[b].y, basePos[b].z], e * 6);
|
|
79
|
+
edgeCols.set([nc.r * DIM, nc.g * DIM, nc.b * DIM, nc.r * DIM, nc.g * DIM, nc.b * DIM], e * 6);
|
|
80
|
+
}
|
|
81
|
+
const edgeGeo = new THREE.BufferGeometry();
|
|
82
|
+
edgeGeo.setAttribute('position', new THREE.BufferAttribute(edgeVerts, 3));
|
|
83
|
+
edgeGeo.setAttribute('color', new THREE.BufferAttribute(edgeCols, 3));
|
|
84
|
+
const edgeMat = new THREE.LineBasicMaterial({
|
|
85
|
+
vertexColors: true, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
86
|
+
});
|
|
87
|
+
// ── Node instanced mesh ───────────────────────────────────────────────
|
|
88
|
+
const nodeGeo = new THREE.SphereGeometry(0.055 * intensity, 8, 8);
|
|
89
|
+
const nc2 = new THREE.Color(nodeColor);
|
|
90
|
+
const nodeMat = new THREE.MeshBasicMaterial({
|
|
91
|
+
color: nc2, transparent: true, opacity: opacity * 0.55,
|
|
92
|
+
depthWrite: false, blending: THREE.AdditiveBlending,
|
|
93
|
+
});
|
|
94
|
+
const nodeMesh = new THREE.InstancedMesh(nodeGeo, nodeMat, N);
|
|
95
|
+
nodeMesh.instanceMatrix.setUsage(THREE.DynamicDrawUsage);
|
|
96
|
+
// ── Pulse sprites ─────────────────────────────────────────────────────
|
|
97
|
+
const pulsePos = new Float32Array(MAX_PULSES * 3);
|
|
98
|
+
const pulseBright = new Float32Array(MAX_PULSES);
|
|
99
|
+
const pulseGeo = new THREE.BufferGeometry();
|
|
100
|
+
pulseGeo.setAttribute('position', new THREE.BufferAttribute(pulsePos, 3));
|
|
101
|
+
pulseGeo.setAttribute('aBright', new THREE.BufferAttribute(pulseBright, 1));
|
|
102
|
+
const pc = new THREE.Color(pulseColor);
|
|
103
|
+
const pulseMat = new THREE.ShaderMaterial({
|
|
104
|
+
vertexShader: pulseVert, fragmentShader: pulseFrag,
|
|
105
|
+
uniforms: {
|
|
106
|
+
uSize: { value: 20 * intensity },
|
|
107
|
+
uColor: { value: new THREE.Vector3(pc.r, pc.g, pc.b) },
|
|
108
|
+
uOpacity: { value: opacity },
|
|
109
|
+
},
|
|
110
|
+
transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
111
|
+
});
|
|
112
|
+
// Initialise pulse states
|
|
113
|
+
pulses.current = Array.from({ length: MAX_PULSES }, () => ({
|
|
114
|
+
fromIdx: 0, toIdx: 1, progress: 0, active: false,
|
|
115
|
+
}));
|
|
116
|
+
return { basePos, orbitAxes, orbitSpeeds, edges, edgeGeo, edgeMat, nodeMesh, pulseGeo, pulseMat };
|
|
117
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
|
+
}, [N, r, nodeColor, pulseColor, opacity, intensity]);
|
|
119
|
+
const tmpMat = useMemo(() => new THREE.Matrix4(), []);
|
|
120
|
+
const tmpQuat = useMemo(() => new THREE.Quaternion(), []);
|
|
121
|
+
const tmpVec = useMemo(() => new THREE.Vector3(), []);
|
|
122
|
+
useFrame((_, delta) => {
|
|
123
|
+
if (!groupRef.current)
|
|
124
|
+
return;
|
|
125
|
+
const dt = delta * speed;
|
|
126
|
+
const { basePos, orbitAxes, orbitSpeeds, edges, edgeGeo, nodeMesh, pulseGeo, pulseMat } = scene;
|
|
127
|
+
// Rotate nodes around their individual axes
|
|
128
|
+
const angles = orbitAngles.current;
|
|
129
|
+
const curPos = [];
|
|
130
|
+
for (let i = 0; i < N; i++) {
|
|
131
|
+
angles[i] += dt * orbitSpeed * orbitSpeeds[i] * 0.4;
|
|
132
|
+
const base = basePos[i];
|
|
133
|
+
const axis = orbitAxes[i];
|
|
134
|
+
const ang = angles[i];
|
|
135
|
+
// Rodrigues rotation of base position around axis
|
|
136
|
+
const cosA = Math.cos(ang), sinA = Math.sin(ang);
|
|
137
|
+
const dot = base.dot(axis);
|
|
138
|
+
tmpVec.set(base.x * cosA + (axis.y * base.z - axis.z * base.y) * sinA + axis.x * dot * (1 - cosA), base.y * cosA + (axis.z * base.x - axis.x * base.z) * sinA + axis.y * dot * (1 - cosA), base.z * cosA + (axis.x * base.y - axis.y * base.x) * sinA + axis.z * dot * (1 - cosA));
|
|
139
|
+
curPos.push(tmpVec.clone());
|
|
140
|
+
tmpMat.compose(tmpVec, tmpQuat, new THREE.Vector3(1, 1, 1));
|
|
141
|
+
nodeMesh.setMatrixAt(i, tmpMat);
|
|
142
|
+
}
|
|
143
|
+
nodeMesh.instanceMatrix.needsUpdate = true;
|
|
144
|
+
// Update edge positions
|
|
145
|
+
const edgePosAttr = edgeGeo.attributes.position;
|
|
146
|
+
for (let e = 0; e < edges.length; e++) {
|
|
147
|
+
const [a, b] = edges[e];
|
|
148
|
+
edgePosAttr.setXYZ(e * 2, curPos[a].x, curPos[a].y, curPos[a].z);
|
|
149
|
+
edgePosAttr.setXYZ(e * 2 + 1, curPos[b].x, curPos[b].y, curPos[b].z);
|
|
150
|
+
}
|
|
151
|
+
edgePosAttr.needsUpdate = true;
|
|
152
|
+
// Pulse signals along edges
|
|
153
|
+
nextPulse.current -= delta;
|
|
154
|
+
if (nextPulse.current <= 0 && edges.length > 0) {
|
|
155
|
+
nextPulse.current = 0.4 / speed;
|
|
156
|
+
const idle = pulses.current.findIndex(p => !p.active);
|
|
157
|
+
if (idle >= 0) {
|
|
158
|
+
const e = Math.floor(Math.random() * edges.length);
|
|
159
|
+
pulses.current[idle] = { fromIdx: edges[e][0], toIdx: edges[e][1], progress: 0, active: true };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const ptPos = pulseGeo.attributes.position;
|
|
163
|
+
const ptBright = pulseGeo.attributes.aBright;
|
|
164
|
+
pulses.current.forEach((p, pi) => {
|
|
165
|
+
if (!p.active) {
|
|
166
|
+
ptBright.setX(pi, 0);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
p.progress += dt * signalSpeed * 0.9;
|
|
170
|
+
if (p.progress >= 1) {
|
|
171
|
+
p.active = false;
|
|
172
|
+
ptBright.setX(pi, 0);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const pos = curPos[p.fromIdx].clone().lerp(curPos[p.toIdx], p.progress);
|
|
176
|
+
ptPos.setXYZ(pi, pos.x, pos.y, pos.z);
|
|
177
|
+
ptBright.setX(pi, 0.7 + 0.3 * Math.sin(p.progress * Math.PI));
|
|
178
|
+
});
|
|
179
|
+
ptPos.needsUpdate = true;
|
|
180
|
+
ptBright.needsUpdate = true;
|
|
181
|
+
pulseMat.uniforms.uSize.value = 20 * intensity;
|
|
182
|
+
if (animations?.length) {
|
|
183
|
+
applyGenerativeAnimations([pulseMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
return (_jsxs("group", { ref: groupRef, children: [_jsx("lineSegments", { geometry: scene.edgeGeo, material: scene.edgeMat }), _jsx("primitive", { object: scene.nodeMesh }), _jsx("points", { geometry: scene.pulseGeo, material: scene.pulseMat })] }));
|
|
187
|
+
};
|
|
188
|
+
export default NeuralNetworkEffect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { OrbConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
+
interface OrbEffectProps {
|
|
4
|
+
boundingRadius: number;
|
|
5
|
+
config: OrbConfig;
|
|
6
|
+
animations?: AnimationOptions[];
|
|
7
|
+
}
|
|
8
|
+
declare const OrbEffect: React.FC<OrbEffectProps>;
|
|
9
|
+
export default OrbEffect;
|
|
10
|
+
//# sourceMappingURL=OrbEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrbEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/OrbEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzE,UAAU,cAAc;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqLD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0GvC,CAAC;AACF,eAAe,SAAS,CAAC"}
|