@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,20 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
import { AnimationOptions, FireConfig } from "@3driseai/3drise-core";
|
|
3
|
+
export interface FireProps {
|
|
4
|
+
/**
|
|
5
|
+
* Host object to wrap. When provided, the fire auto-fits the host's
|
|
6
|
+
* bounding sphere. mode 'wrap' scatters flame tongues across the host's
|
|
7
|
+
* surface; mode 'crown' keeps a single flame sitting on top.
|
|
8
|
+
*
|
|
9
|
+
* The host may live anywhere in the scene graph at any position — the fit
|
|
10
|
+
* is computed in world space and converted into this component's parent
|
|
11
|
+
* frame, so <Fire /> works as a sibling, child, or distant relative of
|
|
12
|
+
* the host.
|
|
13
|
+
*/
|
|
14
|
+
hostRef?: Object3D | null;
|
|
15
|
+
config: FireConfig;
|
|
16
|
+
animations?: AnimationOptions[];
|
|
17
|
+
}
|
|
18
|
+
declare const Fire: ({ hostRef, config, animations }: FireProps) => import("react").JSX.Element;
|
|
19
|
+
export default Fire;
|
|
20
|
+
//# sourceMappingURL=Fire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fire.d.ts","sourceRoot":"","sources":["../../../src/components/effects/Fire.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,MAAM,WAAW,SAAS;IACtB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqFD,QAAA,MAAM,IAAI,GAAI,iCAAiC,SAAS,gCAwHvD,CAAC;AACF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box3, Sphere, Color, Vector3, Matrix4, PlaneGeometry, InstancedBufferGeometry, InstancedBufferAttribute, } from 'three';
|
|
3
|
+
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
// Add to FireConfig in 3drize-core:
|
|
6
|
+
// mode?: 'crown' | 'wrap' // wrap scatters tongues over the host surface
|
|
7
|
+
// coverage?: number // 0..1 — how far down the host burns (wrap)
|
|
8
|
+
// tongues?: number // tongue count for wrap, default 36
|
|
9
|
+
const _box = new Box3();
|
|
10
|
+
const _sphere = new Sphere();
|
|
11
|
+
const _mat = new Matrix4();
|
|
12
|
+
const _anchor = new Vector3();
|
|
13
|
+
const _p = new Vector3();
|
|
14
|
+
const _vA = new Vector3();
|
|
15
|
+
const _vB = new Vector3();
|
|
16
|
+
const _vC = new Vector3();
|
|
17
|
+
const _ab = new Vector3();
|
|
18
|
+
const _ac = new Vector3();
|
|
19
|
+
/**
|
|
20
|
+
* Area-weighted random sampling of the host's triangles, in world space.
|
|
21
|
+
* Self-contained so the core package needs no three/examples dependency.
|
|
22
|
+
*/
|
|
23
|
+
function sampleSurface(host, count) {
|
|
24
|
+
host.updateWorldMatrix(true, true);
|
|
25
|
+
const tris = [];
|
|
26
|
+
let total = 0;
|
|
27
|
+
host.traverse((obj) => {
|
|
28
|
+
const mesh = obj;
|
|
29
|
+
if (!mesh.isMesh)
|
|
30
|
+
return;
|
|
31
|
+
const geo = mesh.geometry;
|
|
32
|
+
const pos = geo.getAttribute('position');
|
|
33
|
+
if (!pos)
|
|
34
|
+
return;
|
|
35
|
+
const idx = geo.index;
|
|
36
|
+
const triCount = (idx ? idx.count : pos.count) / 3;
|
|
37
|
+
for (let i = 0; i < triCount; i++) {
|
|
38
|
+
const ia = idx ? idx.getX(i * 3) : i * 3;
|
|
39
|
+
const ib = idx ? idx.getX(i * 3 + 1) : i * 3 + 1;
|
|
40
|
+
const ic = idx ? idx.getX(i * 3 + 2) : i * 3 + 2;
|
|
41
|
+
_vA.fromBufferAttribute(pos, ia).applyMatrix4(mesh.matrixWorld);
|
|
42
|
+
_vB.fromBufferAttribute(pos, ib).applyMatrix4(mesh.matrixWorld);
|
|
43
|
+
_vC.fromBufferAttribute(pos, ic).applyMatrix4(mesh.matrixWorld);
|
|
44
|
+
const area = _ab.subVectors(_vB, _vA).cross(_ac.subVectors(_vC, _vA)).length() * 0.5;
|
|
45
|
+
if (area <= 0)
|
|
46
|
+
continue;
|
|
47
|
+
total += area;
|
|
48
|
+
tris.push({ a: _vA.clone(), b: _vB.clone(), c: _vC.clone(), cum: total });
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (!tris.length)
|
|
52
|
+
return [];
|
|
53
|
+
const points = [];
|
|
54
|
+
for (let s = 0; s < count; s++) {
|
|
55
|
+
// Binary search the cumulative-area table.
|
|
56
|
+
const r = Math.random() * total;
|
|
57
|
+
let lo = 0;
|
|
58
|
+
let hi = tris.length - 1;
|
|
59
|
+
while (lo < hi) {
|
|
60
|
+
const mid = (lo + hi) >> 1;
|
|
61
|
+
if (tris[mid].cum < r)
|
|
62
|
+
lo = mid + 1;
|
|
63
|
+
else
|
|
64
|
+
hi = mid;
|
|
65
|
+
}
|
|
66
|
+
const tri = tris[lo];
|
|
67
|
+
let u = Math.random();
|
|
68
|
+
let v = Math.random();
|
|
69
|
+
if (u + v > 1) {
|
|
70
|
+
u = 1 - u;
|
|
71
|
+
v = 1 - v;
|
|
72
|
+
}
|
|
73
|
+
const p = tri.a
|
|
74
|
+
.clone()
|
|
75
|
+
.multiplyScalar(1 - u - v)
|
|
76
|
+
.addScaledVector(tri.b, u)
|
|
77
|
+
.addScaledVector(tri.c, v);
|
|
78
|
+
const n = _ab
|
|
79
|
+
.subVectors(tri.b, tri.a)
|
|
80
|
+
.cross(_ac.subVectors(tri.c, tri.a))
|
|
81
|
+
.normalize()
|
|
82
|
+
.clone();
|
|
83
|
+
points.push({ p, n });
|
|
84
|
+
}
|
|
85
|
+
return points;
|
|
86
|
+
}
|
|
87
|
+
const Fire = ({ hostRef, config, animations }) => {
|
|
88
|
+
const group = useRef(null);
|
|
89
|
+
const material = useRef(null);
|
|
90
|
+
const lightRef = useRef(null);
|
|
91
|
+
const { radius = 1, height = 2.5, radiusScale = 1, heightScale = 1, intensity = 1, speed = 1, turbulence = 1.5, sway = 1, tint = '#ffffff', light = true, mode = 'tongues', coverage = 0.85, tongues = 36, } = config;
|
|
92
|
+
const tintColor = useMemo(() => new Color(tint), [tint]);
|
|
93
|
+
// Shared instanced quad — per-tongue attributes are (re)filled on fit.
|
|
94
|
+
const geometry = useMemo(() => {
|
|
95
|
+
const base = new PlaneGeometry(1, 1);
|
|
96
|
+
const geo = new InstancedBufferGeometry();
|
|
97
|
+
geo.index = base.index;
|
|
98
|
+
geo.setAttribute('position', base.getAttribute('position'));
|
|
99
|
+
geo.setAttribute('uv', base.getAttribute('uv'));
|
|
100
|
+
return geo;
|
|
101
|
+
}, []);
|
|
102
|
+
useEffect(() => () => geometry.dispose(), [geometry]);
|
|
103
|
+
function setInstances(offsets, sizes, seeds) {
|
|
104
|
+
geometry.setAttribute('a_offset', new InstancedBufferAttribute(new Float32Array(offsets), 3));
|
|
105
|
+
geometry.setAttribute('a_size', new InstancedBufferAttribute(new Float32Array(sizes), 2));
|
|
106
|
+
geometry.setAttribute('a_seed', new InstancedBufferAttribute(new Float32Array(seeds), 1));
|
|
107
|
+
geometry.instanceCount = seeds.length;
|
|
108
|
+
}
|
|
109
|
+
// ── Auto-fit + tongue placement ──
|
|
110
|
+
useLayoutEffect(() => {
|
|
111
|
+
const host = hostRef;
|
|
112
|
+
// Free-standing: single tongue at the group origin.
|
|
113
|
+
if (!host) {
|
|
114
|
+
material.current.u_radius = radius * radiusScale;
|
|
115
|
+
material.current.u_height = height * heightScale;
|
|
116
|
+
setInstances([0, 0, 0], [1, 1], [Math.random() * 100]);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
host.updateWorldMatrix(true, true);
|
|
120
|
+
_box.setFromObject(host);
|
|
121
|
+
if (_box.isEmpty())
|
|
122
|
+
return;
|
|
123
|
+
_box.getBoundingSphere(_sphere);
|
|
124
|
+
const r = _sphere.radius;
|
|
125
|
+
const spanY = Math.max(_box.max.y - _box.min.y, 1e-4);
|
|
126
|
+
material.current.u_radius = r * 1.1 * radiusScale;
|
|
127
|
+
material.current.u_height = r * 3.2 * heightScale;
|
|
128
|
+
// The fit above is in WORLD space, but this group may be nested under
|
|
129
|
+
// transformed ancestors. Convert every world-space value into the
|
|
130
|
+
// parent's local frame so the host can sit anywhere in the scene.
|
|
131
|
+
const parentObj = group.current.parent;
|
|
132
|
+
parentObj?.updateWorldMatrix(true, false);
|
|
133
|
+
const invParent = parentObj
|
|
134
|
+
? _mat.copy(parentObj.matrixWorld).invert()
|
|
135
|
+
: _mat.identity();
|
|
136
|
+
if (mode === 'crown') {
|
|
137
|
+
// Single flame nestled on the host's crown (campfire-style).
|
|
138
|
+
_anchor
|
|
139
|
+
.set(_sphere.center.x, _box.max.y - r * 0.15, _sphere.center.z)
|
|
140
|
+
.applyMatrix4(invParent);
|
|
141
|
+
group.current.position.copy(_anchor);
|
|
142
|
+
setInstances([0, 0, 0], [1, 1], [Math.random() * 100]);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
// ── wrap: scatter tongues across the host surface ──
|
|
146
|
+
_anchor.copy(_sphere.center).applyMatrix4(invParent);
|
|
147
|
+
group.current.position.copy(_anchor);
|
|
148
|
+
// Oversample, then keep points inside the coverage band (fire climbs,
|
|
149
|
+
// so the band is anchored to the top with a noisy lower edge).
|
|
150
|
+
const raw = sampleSurface(host, tongues * 4);
|
|
151
|
+
const offsets = [];
|
|
152
|
+
const sizes = [];
|
|
153
|
+
const seeds = [];
|
|
154
|
+
let kept = 0;
|
|
155
|
+
for (const sp of raw) {
|
|
156
|
+
if (kept >= tongues)
|
|
157
|
+
break;
|
|
158
|
+
const hNorm = (sp.p.y - _box.min.y) / spanY;
|
|
159
|
+
if (hNorm + (Math.random() - 0.5) * 0.25 < 1 - coverage)
|
|
160
|
+
continue;
|
|
161
|
+
// Lift slightly off the surface, then express the anchor in
|
|
162
|
+
// group-local space: parent-local point minus the group's position.
|
|
163
|
+
_p.copy(sp.p)
|
|
164
|
+
.addScaledVector(sp.n, r * 0.02)
|
|
165
|
+
.applyMatrix4(invParent)
|
|
166
|
+
.sub(_anchor);
|
|
167
|
+
offsets.push(_p.x, _p.y, _p.z);
|
|
168
|
+
// Tongues grow toward the top — convection feeds the upper flames.
|
|
169
|
+
const grow = 0.6 + 0.6 * hNorm;
|
|
170
|
+
sizes.push((0.16 + Math.random() * 0.18) * grow, (0.28 + Math.random() * 0.30) * grow);
|
|
171
|
+
seeds.push(Math.random() * 100);
|
|
172
|
+
kept++;
|
|
173
|
+
}
|
|
174
|
+
// Crown tongue: the big body of fire rising off the top.
|
|
175
|
+
_p.set(_sphere.center.x, _box.max.y - r * 0.15, _sphere.center.z)
|
|
176
|
+
.applyMatrix4(invParent)
|
|
177
|
+
.sub(_anchor);
|
|
178
|
+
offsets.push(_p.x, _p.y, _p.z);
|
|
179
|
+
sizes.push(0.8, 0.95);
|
|
180
|
+
seeds.push(Math.random() * 100);
|
|
181
|
+
setInstances(offsets, sizes, seeds);
|
|
182
|
+
}, [
|
|
183
|
+
hostRef,
|
|
184
|
+
mode,
|
|
185
|
+
coverage,
|
|
186
|
+
tongues,
|
|
187
|
+
radius,
|
|
188
|
+
height,
|
|
189
|
+
radiusScale,
|
|
190
|
+
heightScale,
|
|
191
|
+
geometry,
|
|
192
|
+
]);
|
|
193
|
+
useFrame(({ clock }) => {
|
|
194
|
+
const t = clock.getElapsedTime();
|
|
195
|
+
material.current.u_time = t;
|
|
196
|
+
if (light && lightRef.current) {
|
|
197
|
+
// Low-frequency flicker — calm, ember-like, no strobing.
|
|
198
|
+
const flicker = 0.82 +
|
|
199
|
+
0.12 * Math.sin(t * 7.3) * Math.sin(t * 3.1) +
|
|
200
|
+
0.06 * Math.sin(t * 13.7 + 1.4);
|
|
201
|
+
lightRef.current.intensity = intensity * 14 * flicker;
|
|
202
|
+
lightRef.current.position.y =
|
|
203
|
+
material.current.u_height * (0.35 + 0.03 * Math.sin(t * 5.1));
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return (_jsxs("group", { ref: group, children: [_jsx("mesh", { geometry: geometry, frustumCulled: false, children: _jsx("fireMaterial", { ref: material, u_intensity: intensity, u_speed: speed, u_turbulence: turbulence, u_sway: sway, u_tint: tintColor }) }), light && (_jsx("pointLight", { ref: lightRef, color: "#ff7a26", distance: 0, decay: 2 }))] }));
|
|
207
|
+
};
|
|
208
|
+
export default Fire;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FireConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
+
interface FireEffectProps {
|
|
4
|
+
boundingRadius: number;
|
|
5
|
+
config: FireConfig;
|
|
6
|
+
animations?: AnimationOptions[];
|
|
7
|
+
}
|
|
8
|
+
declare const FireEffect: React.FC<FireEffectProps>;
|
|
9
|
+
export default FireEffect;
|
|
10
|
+
//# sourceMappingURL=FireEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FireEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FireEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,UAAU,eAAe;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAwGD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsFzC,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
// ── Flame particle vertex shader ──────────────────────────────────────────────
|
|
7
|
+
const flameVert = /* glsl */ `
|
|
8
|
+
attribute float aT; // lifetime position 0..1 (base→tip)
|
|
9
|
+
attribute vec2 aBase; // (x, z) spawn position within disc
|
|
10
|
+
attribute float aSpeed; // per-particle rise speed variation
|
|
11
|
+
attribute float aPhase; // noise phase offset
|
|
12
|
+
|
|
13
|
+
uniform float u_time;
|
|
14
|
+
uniform float u_speed;
|
|
15
|
+
uniform float uHeight;
|
|
16
|
+
uniform float uSpread;
|
|
17
|
+
uniform float uSize;
|
|
18
|
+
|
|
19
|
+
varying float vT;
|
|
20
|
+
|
|
21
|
+
void main() {
|
|
22
|
+
// Loop t upward continuously
|
|
23
|
+
float t = fract(aT + u_time * u_speed * aSpeed);
|
|
24
|
+
vT = t;
|
|
25
|
+
|
|
26
|
+
// Rise in Y, shrink spread toward tip
|
|
27
|
+
float spreadScale = 1.0 - t * 0.85;
|
|
28
|
+
float x = aBase.x * spreadScale * uSpread;
|
|
29
|
+
float z = aBase.y * spreadScale * uSpread;
|
|
30
|
+
|
|
31
|
+
// Turbulent horizontal sway (FBM-like with 2 sines)
|
|
32
|
+
float sway1 = sin(t * 3.8 + u_time * 1.6 + aPhase) * 0.18 * uSpread * (1.0 - t);
|
|
33
|
+
float sway2 = sin(t * 6.2 - u_time * 2.3 + aPhase * 1.7) * 0.09 * uSpread * (1.0 - t);
|
|
34
|
+
x += sway1 + sway2;
|
|
35
|
+
z += cos(t * 4.1 + u_time * 1.9 + aPhase * 0.8) * 0.12 * uSpread * (1.0 - t);
|
|
36
|
+
|
|
37
|
+
float y = t * uHeight - uHeight * 0.5;
|
|
38
|
+
|
|
39
|
+
// Shrink point size toward tip
|
|
40
|
+
gl_PointSize = uSize * (1.0 - t * 0.8) * (200.0 / -(modelViewMatrix * vec4(x, y, z, 1.0)).z);
|
|
41
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(x, y, z, 1.0);
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
const flameFrag = /* glsl */ `
|
|
45
|
+
uniform vec3 uFlameColor;
|
|
46
|
+
uniform vec3 uTipColor;
|
|
47
|
+
uniform float uOpacity;
|
|
48
|
+
varying float vT;
|
|
49
|
+
|
|
50
|
+
void main() {
|
|
51
|
+
vec2 c = gl_PointCoord - 0.5;
|
|
52
|
+
float d = length(c);
|
|
53
|
+
if (d > 0.5) discard;
|
|
54
|
+
float g = exp(-d * d * 5.5);
|
|
55
|
+
|
|
56
|
+
// Color: flameColor at base → mid orange → tipColor near top → transparent
|
|
57
|
+
float t2 = vT * vT;
|
|
58
|
+
vec3 midCol = mix(uFlameColor, vec3(1.0, 0.65, 0.1), 0.5);
|
|
59
|
+
vec3 col = t2 < 0.4
|
|
60
|
+
? mix(uFlameColor, midCol, t2 / 0.4)
|
|
61
|
+
: mix(midCol, uTipColor, (t2 - 0.4) / 0.6);
|
|
62
|
+
|
|
63
|
+
// Fade out at tip and base
|
|
64
|
+
float alpha = g * uOpacity * smoothstep(0.0, 0.12, vT) * (1.0 - smoothstep(0.75, 1.0, vT));
|
|
65
|
+
if (alpha < 0.01) discard;
|
|
66
|
+
gl_FragColor = vec4(col, alpha);
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
// ── Ember vertex shader ───────────────────────────────────────────────────────
|
|
70
|
+
const emberVert = /* glsl */ `
|
|
71
|
+
attribute float aT;
|
|
72
|
+
attribute vec3 aDrift; // (vx, vy, vz) drift velocity
|
|
73
|
+
attribute float aPhase;
|
|
74
|
+
|
|
75
|
+
uniform float u_time;
|
|
76
|
+
uniform float u_speed;
|
|
77
|
+
uniform float uHeight;
|
|
78
|
+
|
|
79
|
+
varying float vT;
|
|
80
|
+
|
|
81
|
+
void main() {
|
|
82
|
+
float t = fract(aT + u_time * u_speed * 0.4);
|
|
83
|
+
vT = t;
|
|
84
|
+
|
|
85
|
+
float x = aDrift.x * t * 1.8 + sin(t * 5.0 + aPhase) * 0.15;
|
|
86
|
+
float y = t * uHeight * 1.3 - uHeight * 0.4;
|
|
87
|
+
float z = aDrift.z * t * 1.8 + cos(t * 4.0 + aPhase) * 0.12;
|
|
88
|
+
|
|
89
|
+
gl_PointSize = (1.0 - t) * 5.0 * (200.0 / -(modelViewMatrix * vec4(x, y, z, 1.0)).z);
|
|
90
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(x, y, z, 1.0);
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
const emberFrag = /* glsl */ `
|
|
94
|
+
uniform float uOpacity;
|
|
95
|
+
varying float vT;
|
|
96
|
+
|
|
97
|
+
void main() {
|
|
98
|
+
vec2 c = gl_PointCoord - 0.5;
|
|
99
|
+
if (length(c) > 0.5) discard;
|
|
100
|
+
float g = exp(-dot(c, c) * 7.0);
|
|
101
|
+
float alpha = g * uOpacity * (1.0 - vT) * smoothstep(0.0, 0.08, vT);
|
|
102
|
+
if (alpha < 0.01) discard;
|
|
103
|
+
// Orange-white ember color
|
|
104
|
+
gl_FragColor = vec4(1.0, 0.65 + (1.0 - vT) * 0.35, 0.2 * (1.0 - vT), alpha);
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
const FireEffect = ({ boundingRadius, config, animations }) => {
|
|
108
|
+
const { particleCount, height, spread, flameColor, tipColor, opacity, speed, intensity } = config;
|
|
109
|
+
const startValuesCacheRef = useRef({});
|
|
110
|
+
const h = boundingRadius * height;
|
|
111
|
+
const s = boundingRadius * spread;
|
|
112
|
+
const { flameGeo, flameMat, emberGeo, emberMat } = useMemo(() => {
|
|
113
|
+
const N = Math.max(50, particleCount);
|
|
114
|
+
const E = Math.floor(N * 0.2);
|
|
115
|
+
// ── Flame geometry ─────────────────────────────────────────────────────
|
|
116
|
+
const aT = new Float32Array(N);
|
|
117
|
+
const aBase = new Float32Array(N * 2);
|
|
118
|
+
const aSpeed = new Float32Array(N);
|
|
119
|
+
const aPhase = new Float32Array(N);
|
|
120
|
+
for (let i = 0; i < N; i++) {
|
|
121
|
+
aT[i] = i / N;
|
|
122
|
+
const r = Math.sqrt(Math.random()) * s;
|
|
123
|
+
const a = Math.random() * Math.PI * 2;
|
|
124
|
+
aBase[i * 2] = Math.cos(a) * r;
|
|
125
|
+
aBase[i * 2 + 1] = Math.sin(a) * r;
|
|
126
|
+
aSpeed[i] = 0.6 + Math.random() * 0.8;
|
|
127
|
+
aPhase[i] = Math.random() * Math.PI * 2;
|
|
128
|
+
}
|
|
129
|
+
const fGeo = new THREE.BufferGeometry();
|
|
130
|
+
fGeo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(N * 3), 3));
|
|
131
|
+
fGeo.setAttribute('aT', new THREE.BufferAttribute(aT, 1));
|
|
132
|
+
fGeo.setAttribute('aBase', new THREE.BufferAttribute(aBase, 2));
|
|
133
|
+
fGeo.setAttribute('aSpeed', new THREE.BufferAttribute(aSpeed, 1));
|
|
134
|
+
fGeo.setAttribute('aPhase', new THREE.BufferAttribute(aPhase, 1));
|
|
135
|
+
const fc = new THREE.Color(flameColor);
|
|
136
|
+
const tc = new THREE.Color(tipColor);
|
|
137
|
+
const fMat = new THREE.ShaderMaterial({
|
|
138
|
+
vertexShader: flameVert,
|
|
139
|
+
fragmentShader: flameFrag,
|
|
140
|
+
uniforms: {
|
|
141
|
+
u_time: { value: 0 },
|
|
142
|
+
u_speed: { value: speed },
|
|
143
|
+
uHeight: { value: h },
|
|
144
|
+
uSpread: { value: s },
|
|
145
|
+
uSize: { value: 20 * intensity },
|
|
146
|
+
uFlameColor: { value: new THREE.Vector3(fc.r, fc.g, fc.b) },
|
|
147
|
+
uTipColor: { value: new THREE.Vector3(tc.r, tc.g, tc.b) },
|
|
148
|
+
uOpacity: { value: opacity },
|
|
149
|
+
},
|
|
150
|
+
transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
151
|
+
});
|
|
152
|
+
// ── Ember geometry ─────────────────────────────────────────────────────
|
|
153
|
+
const eT = new Float32Array(E);
|
|
154
|
+
const eDrift = new Float32Array(E * 3);
|
|
155
|
+
const ePhase = new Float32Array(E);
|
|
156
|
+
for (let i = 0; i < E; i++) {
|
|
157
|
+
eT[i] = i / E;
|
|
158
|
+
const a = Math.random() * Math.PI * 2;
|
|
159
|
+
const r = (0.2 + Math.random() * 0.8) * s;
|
|
160
|
+
eDrift[i * 3] = Math.cos(a) * r;
|
|
161
|
+
eDrift[i * 3 + 1] = 0;
|
|
162
|
+
eDrift[i * 3 + 2] = Math.sin(a) * r;
|
|
163
|
+
ePhase[i] = Math.random() * Math.PI * 2;
|
|
164
|
+
}
|
|
165
|
+
const eGeo = new THREE.BufferGeometry();
|
|
166
|
+
eGeo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(E * 3), 3));
|
|
167
|
+
eGeo.setAttribute('aT', new THREE.BufferAttribute(eT, 1));
|
|
168
|
+
eGeo.setAttribute('aDrift', new THREE.BufferAttribute(eDrift, 3));
|
|
169
|
+
eGeo.setAttribute('aPhase', new THREE.BufferAttribute(ePhase, 1));
|
|
170
|
+
const eMat = new THREE.ShaderMaterial({
|
|
171
|
+
vertexShader: emberVert,
|
|
172
|
+
fragmentShader: emberFrag,
|
|
173
|
+
uniforms: {
|
|
174
|
+
u_time: { value: 0 },
|
|
175
|
+
u_speed: { value: speed },
|
|
176
|
+
uHeight: { value: h },
|
|
177
|
+
uOpacity: { value: opacity * 0.7 },
|
|
178
|
+
},
|
|
179
|
+
transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
180
|
+
});
|
|
181
|
+
return { flameGeo: fGeo, flameMat: fMat, emberGeo: eGeo, emberMat: eMat };
|
|
182
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
183
|
+
}, [particleCount, h, s, flameColor, tipColor, opacity, speed, intensity]);
|
|
184
|
+
useFrame((state) => {
|
|
185
|
+
const t = state.clock.getElapsedTime();
|
|
186
|
+
flameMat.uniforms.u_time.value = t;
|
|
187
|
+
emberMat.uniforms.u_time.value = t;
|
|
188
|
+
if (animations?.length) {
|
|
189
|
+
applyGenerativeAnimations([flameMat, emberMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
return (_jsxs("group", { position: [0, boundingRadius * 0.1, 0], children: [_jsx("points", { geometry: flameGeo, material: flameMat }), _jsx("points", { geometry: emberGeo, material: emberMat })] }));
|
|
193
|
+
};
|
|
194
|
+
export default FireEffect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ForcefieldConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
+
interface ForcefieldEffectProps {
|
|
4
|
+
boundingRadius: number;
|
|
5
|
+
config: ForcefieldConfig;
|
|
6
|
+
animations?: AnimationOptions[];
|
|
7
|
+
}
|
|
8
|
+
declare const ForcefieldEffect: React.FC<ForcefieldEffectProps>;
|
|
9
|
+
export default ForcefieldEffect;
|
|
10
|
+
//# sourceMappingURL=ForcefieldEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForcefieldEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ForcefieldEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChF,UAAU,qBAAqB;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA6ED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmDrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsx as _jsx } 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
|
+
const shieldVert = /* glsl */ `
|
|
7
|
+
varying vec3 vNormal;
|
|
8
|
+
varying vec3 vWorldPos;
|
|
9
|
+
varying vec2 vUv;
|
|
10
|
+
void main() {
|
|
11
|
+
vNormal = normalize(normalMatrix * normal);
|
|
12
|
+
vWorldPos = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
13
|
+
vUv = uv;
|
|
14
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
const shieldFrag = /* glsl */ `
|
|
18
|
+
uniform float u_time;
|
|
19
|
+
uniform float uHexSize;
|
|
20
|
+
uniform vec3 uShieldColor;
|
|
21
|
+
uniform vec3 uRimColor;
|
|
22
|
+
uniform float uOpacity;
|
|
23
|
+
uniform float uIntensity;
|
|
24
|
+
|
|
25
|
+
// Ripple slots (3 simultaneous)
|
|
26
|
+
uniform vec3 uHitPos[3];
|
|
27
|
+
uniform float uHitTime[3];
|
|
28
|
+
|
|
29
|
+
varying vec3 vNormal;
|
|
30
|
+
varying vec3 vWorldPos;
|
|
31
|
+
varying vec2 vUv;
|
|
32
|
+
|
|
33
|
+
// ── Analytical hex grid in 3D via world-space spherical UV ───────────────
|
|
34
|
+
vec2 hexCoord(vec2 p) {
|
|
35
|
+
const float SQRT3 = 1.7320508;
|
|
36
|
+
vec2 r = vec2(1.0, SQRT3);
|
|
37
|
+
vec2 h = r * 0.5;
|
|
38
|
+
vec2 a = mod(p, r) - h;
|
|
39
|
+
vec2 b = mod(p + h, r) - h;
|
|
40
|
+
return dot(a, a) < dot(b, b) ? a : b;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
float hexEdge(vec2 p, float size) {
|
|
44
|
+
vec2 hc = hexCoord(p / size);
|
|
45
|
+
float d = length(hc);
|
|
46
|
+
// Edge = thin ring at cell boundary
|
|
47
|
+
return 1.0 - smoothstep(size * 0.38, size * 0.46, d);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
void main() {
|
|
51
|
+
// Spherical UV from world normal
|
|
52
|
+
vec3 n = normalize(vNormal);
|
|
53
|
+
float phi = atan(n.z, n.x);
|
|
54
|
+
float theta = acos(clamp(n.y, -1.0, 1.0));
|
|
55
|
+
vec2 suv = vec2(phi / 6.28318, theta / 3.14159);
|
|
56
|
+
|
|
57
|
+
float edge = hexEdge(suv, uHexSize);
|
|
58
|
+
|
|
59
|
+
// Fresnel rim
|
|
60
|
+
vec3 viewDir = normalize(cameraPosition - vWorldPos);
|
|
61
|
+
float fresnel = pow(1.0 - abs(dot(n, viewDir)), 2.5);
|
|
62
|
+
|
|
63
|
+
// Ripple contributions
|
|
64
|
+
float ripple = 0.0;
|
|
65
|
+
for (int k = 0; k < 3; k++) {
|
|
66
|
+
float age = u_time - uHitTime[k];
|
|
67
|
+
if (age < 0.0 || age > 2.0) continue;
|
|
68
|
+
float dist = distance(vWorldPos, uHitPos[k]);
|
|
69
|
+
float wave = sin(dist * 14.0 - age * 9.0) * exp(-dist * 2.5) * exp(-age * 1.4);
|
|
70
|
+
ripple += wave * 0.7;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
vec3 col = mix(uShieldColor, uRimColor, fresnel * 0.6 + edge * 0.4);
|
|
74
|
+
float alpha = (edge * 0.55 + fresnel * 0.3 + max(0.0, ripple) * 0.45 + 0.04)
|
|
75
|
+
* uOpacity * uIntensity;
|
|
76
|
+
if (alpha < 0.005) discard;
|
|
77
|
+
gl_FragColor = vec4(col + uRimColor * ripple * 0.3, alpha);
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
const ForcefieldEffect = ({ boundingRadius, config, animations }) => {
|
|
81
|
+
const { hexSize, rippleEnabled, shieldColor, rimColor, opacity, speed, intensity } = config;
|
|
82
|
+
const startValuesCacheRef = useRef({});
|
|
83
|
+
const meshRef = useRef(null);
|
|
84
|
+
const hitSlot = useRef(0);
|
|
85
|
+
const nextHit = useRef(0);
|
|
86
|
+
const mat = useMemo(() => {
|
|
87
|
+
const sc = new THREE.Color(shieldColor);
|
|
88
|
+
const rc = new THREE.Color(rimColor);
|
|
89
|
+
return new THREE.ShaderMaterial({
|
|
90
|
+
vertexShader: shieldVert,
|
|
91
|
+
fragmentShader: shieldFrag,
|
|
92
|
+
uniforms: {
|
|
93
|
+
u_time: { value: 0 },
|
|
94
|
+
uHexSize: { value: hexSize },
|
|
95
|
+
uShieldColor: { value: new THREE.Vector3(sc.r, sc.g, sc.b) },
|
|
96
|
+
uRimColor: { value: new THREE.Vector3(rc.r, rc.g, rc.b) },
|
|
97
|
+
uOpacity: { value: opacity },
|
|
98
|
+
uIntensity: { value: intensity },
|
|
99
|
+
uHitPos: { value: [new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3()] },
|
|
100
|
+
uHitTime: { value: [-99, -99, -99] },
|
|
101
|
+
},
|
|
102
|
+
transparent: true,
|
|
103
|
+
depthWrite: false,
|
|
104
|
+
side: THREE.FrontSide,
|
|
105
|
+
blending: THREE.AdditiveBlending,
|
|
106
|
+
});
|
|
107
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
|
+
}, [hexSize, shieldColor, rimColor, opacity, intensity]);
|
|
109
|
+
useFrame((state, delta) => {
|
|
110
|
+
const t = state.clock.getElapsedTime();
|
|
111
|
+
mat.uniforms.u_time.value = t;
|
|
112
|
+
if (rippleEnabled) {
|
|
113
|
+
nextHit.current -= delta;
|
|
114
|
+
if (nextHit.current <= 0) {
|
|
115
|
+
nextHit.current = 1.4 / speed + Math.random() * 0.8;
|
|
116
|
+
// Random point on sphere surface
|
|
117
|
+
const phi = Math.random() * Math.PI * 2;
|
|
118
|
+
const theta = Math.acos(2 * Math.random() - 1);
|
|
119
|
+
const r = boundingRadius * 1.15;
|
|
120
|
+
const slot = hitSlot.current % 3;
|
|
121
|
+
mat.uniforms.uHitPos.value[slot].set(Math.sin(theta) * Math.cos(phi) * r, Math.cos(theta) * r, Math.sin(theta) * Math.sin(phi) * r);
|
|
122
|
+
mat.uniforms.uHitTime.value[slot] = t;
|
|
123
|
+
hitSlot.current++;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (animations?.length) {
|
|
127
|
+
applyGenerativeAnimations([mat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return (_jsx("mesh", { ref: meshRef, material: mat, children: _jsx("sphereGeometry", { args: [boundingRadius * 1.15, 64, 64] }) }));
|
|
131
|
+
};
|
|
132
|
+
export default ForcefieldEffect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HologramConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
+
interface HologramEffectProps {
|
|
4
|
+
boundingRadius: number;
|
|
5
|
+
config: HologramConfig;
|
|
6
|
+
animations?: AnimationOptions[];
|
|
7
|
+
}
|
|
8
|
+
declare const HologramEffect: React.FC<HologramEffectProps>;
|
|
9
|
+
export default HologramEffect;
|
|
10
|
+
//# sourceMappingURL=HologramEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HologramEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/HologramEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,UAAU,mBAAmB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqFD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsDjD,CAAC;AACF,eAAe,cAAc,CAAC"}
|