@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,110 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import { useParticlePositions } from '../hooks/useParticlePositions.js';
|
|
5
|
+
import { useParticlesColors } from '../hooks/useParticlesColors.js';
|
|
6
|
+
import { useParticlesTextures } from '../hooks/useParticlesTextures.js';
|
|
7
|
+
import { handleShapeAnimation, buildShaderEffectsMaterial, structureKey } from '@3driseai/3drise-core';
|
|
8
|
+
import { update3driseShaderUniforms } from '../hooks/use3driseShader.js';
|
|
9
|
+
function normalizeEffects(raw) {
|
|
10
|
+
return Array.isArray(raw) ? raw : [];
|
|
11
|
+
}
|
|
12
|
+
const ParticlesR3f = ({ particlesSettings, duration = 1, transitionSettings, }) => {
|
|
13
|
+
const materialRef = useRef(null);
|
|
14
|
+
const pointsRef = useRef(null);
|
|
15
|
+
const { name, config, meshSettings } = particlesSettings;
|
|
16
|
+
const { count, shapeType, outlines, texture } = config;
|
|
17
|
+
const color = particlesSettings.materialSettings && 'color' in particlesSettings.materialSettings
|
|
18
|
+
? particlesSettings.materialSettings.color
|
|
19
|
+
: '#ffffff';
|
|
20
|
+
const opacity = particlesSettings.materialSettings && 'opacity' in particlesSettings.materialSettings
|
|
21
|
+
? particlesSettings.materialSettings.opacity
|
|
22
|
+
: 1.0;
|
|
23
|
+
const pointSize = particlesSettings.materialSettings && 'pointSize' in particlesSettings.materialSettings
|
|
24
|
+
? particlesSettings.materialSettings.pointSize
|
|
25
|
+
: 5.0;
|
|
26
|
+
const targetShape = (transitionSettings?.shapeType && typeof transitionSettings.shapeType === 'string')
|
|
27
|
+
? transitionSettings.shapeType
|
|
28
|
+
: shapeType;
|
|
29
|
+
const targetOutLines = transitionSettings?.outlines !== undefined
|
|
30
|
+
? transitionSettings.outlines
|
|
31
|
+
: (outlines || false);
|
|
32
|
+
const targetColor = transitionSettings?.color || color;
|
|
33
|
+
const aspectRatio = 16 / 9;
|
|
34
|
+
const nbLines = Math.round(Math.sqrt(count / 3 / aspectRatio));
|
|
35
|
+
const nbColumns = Math.round(aspectRatio * nbLines);
|
|
36
|
+
const particleUVScale = 1.0 / Math.max(nbColumns, nbLines);
|
|
37
|
+
const { basePositions, targetPositions, animationProgress, uvs } = useParticlePositions({
|
|
38
|
+
shapeType,
|
|
39
|
+
targetShape,
|
|
40
|
+
count,
|
|
41
|
+
outlines: outlines || false,
|
|
42
|
+
targetOutLines,
|
|
43
|
+
pointsRef,
|
|
44
|
+
});
|
|
45
|
+
const { handleColorsAnimation } = useParticlesColors({ color, targetColor });
|
|
46
|
+
const { currentTexture, prevTexture, loadTexture, textureProgress, handleTextureAnimation } = useParticlesTextures();
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (texture && texture.trim() !== '') {
|
|
49
|
+
textureProgress.current = 0;
|
|
50
|
+
loadTexture(texture);
|
|
51
|
+
}
|
|
52
|
+
}, [texture, loadTexture]);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const points = pointsRef.current;
|
|
55
|
+
if (!points)
|
|
56
|
+
return;
|
|
57
|
+
const applyTexture = (url) => {
|
|
58
|
+
if (!url)
|
|
59
|
+
return;
|
|
60
|
+
textureProgress.current = 0;
|
|
61
|
+
loadTexture(url);
|
|
62
|
+
};
|
|
63
|
+
points.userData.applyTexture = applyTexture;
|
|
64
|
+
return () => {
|
|
65
|
+
delete points.userData.applyTexture;
|
|
66
|
+
};
|
|
67
|
+
}, [loadTexture, textureProgress]);
|
|
68
|
+
const speed = 1 / duration;
|
|
69
|
+
const activeEffects = useMemo(() => normalizeEffects(particlesSettings.animations?.material?.shaderEffects), [particlesSettings.animations?.material?.shaderEffects]);
|
|
70
|
+
const pointerRadius = particlesSettings.animations?.material
|
|
71
|
+
?.shaderEffectsPointerRadius ?? 0.4;
|
|
72
|
+
const effectsKey = useMemo(() => structureKey(activeEffects), [activeEffects]);
|
|
73
|
+
const material = useMemo(() => buildShaderEffectsMaterial({
|
|
74
|
+
effects: activeEffects,
|
|
75
|
+
initialColor: color,
|
|
76
|
+
initialOpacity: opacity,
|
|
77
|
+
initialPointSize: pointSize,
|
|
78
|
+
initialParticleUVScale: particleUVScale,
|
|
79
|
+
initialPointerEffectRadius: pointerRadius,
|
|
80
|
+
}),
|
|
81
|
+
// Rebuild when the structural set of effects changes; not on parameter tweaks.
|
|
82
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
|
+
[effectsKey]);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
materialRef.current = material;
|
|
86
|
+
return () => {
|
|
87
|
+
material.dispose();
|
|
88
|
+
};
|
|
89
|
+
}, [material]);
|
|
90
|
+
useFrame((state, delta) => {
|
|
91
|
+
const mat = materialRef.current;
|
|
92
|
+
if (!mat || !pointsRef.current || !basePositions.current)
|
|
93
|
+
return;
|
|
94
|
+
if (meshSettings.visible) {
|
|
95
|
+
handleShapeAnimation(delta, speed, animationProgress, pointsRef, basePositions, targetPositions);
|
|
96
|
+
handleColorsAnimation(materialRef, delta, speed);
|
|
97
|
+
}
|
|
98
|
+
if (prevTexture.current)
|
|
99
|
+
mat.uniforms.uTexture.value = prevTexture.current;
|
|
100
|
+
if (currentTexture.current)
|
|
101
|
+
mat.uniforms.uTargetTexture.value = currentTexture.current;
|
|
102
|
+
mat.uniforms.uHasTexture.value = !!currentTexture.current;
|
|
103
|
+
handleTextureAnimation(materialRef, delta, speed);
|
|
104
|
+
update3driseShaderUniforms(mat.uniforms, activeEffects, state.clock.getElapsedTime(), { x: state.pointer.x, y: state.pointer.y }, { pointerRadius });
|
|
105
|
+
});
|
|
106
|
+
if (!basePositions.current)
|
|
107
|
+
return null;
|
|
108
|
+
return (_jsxs("points", { name: name, ref: pointsRef, raycast: () => null, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: [_jsxs("bufferGeometry", { children: [_jsx("bufferAttribute", { attach: "attributes-position", count: basePositions.current.length / 3, array: basePositions.current, itemSize: 3, args: [basePositions.current, 3] }), uvs && (_jsx("bufferAttribute", { attach: "attributes-aUV", count: uvs.length / 2, array: uvs, itemSize: 2, args: [uvs, 2] }))] }), _jsx("primitive", { object: material, attach: "material" })] }));
|
|
109
|
+
};
|
|
110
|
+
export default ParticlesR3f;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CatmullRomCurve3 } from "three";
|
|
3
|
+
interface PathProps {
|
|
4
|
+
curve: CatmullRomCurve3;
|
|
5
|
+
targetCurve: CatmullRomCurve3;
|
|
6
|
+
duration?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
opacity?: number;
|
|
9
|
+
tubeRadius?: number;
|
|
10
|
+
}
|
|
11
|
+
declare const Path: React.FC<PathProps>;
|
|
12
|
+
export default Path;
|
|
13
|
+
//# sourceMappingURL=Path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/components/Path.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,UAAU,SAAS;IACf,KAAK,EAAE,gBAAgB,CAAC;IACxB,WAAW,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAoC7B,CAAC;AACF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
const Path = ({ curve, targetCurve, duration = 1, color = '#4c00ff', opacity = 1, tubeRadius = 0.001, }) => {
|
|
5
|
+
const tubeRef = useRef(null);
|
|
6
|
+
const targetTubeRef = useRef(null);
|
|
7
|
+
const meshRef = useRef(null);
|
|
8
|
+
const animationProgress = useRef(0);
|
|
9
|
+
const basePositions = useRef(null);
|
|
10
|
+
const speed = 1 / duration;
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (tubeRef.current) {
|
|
13
|
+
basePositions.current = new Float32Array(tubeRef.current.attributes.position.array);
|
|
14
|
+
}
|
|
15
|
+
animationProgress.current = 0;
|
|
16
|
+
}, [curve, targetCurve]);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
return () => {
|
|
19
|
+
tubeRef.current?.dispose();
|
|
20
|
+
targetTubeRef.current?.dispose();
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
useFrame((_, delta) => {
|
|
24
|
+
if (!meshRef.current || !tubeRef.current || !targetTubeRef.current || !basePositions.current)
|
|
25
|
+
return;
|
|
26
|
+
const progress = Math.min(animationProgress.current + delta * speed, 1);
|
|
27
|
+
const currentGeom = tubeRef.current;
|
|
28
|
+
const targetPositions = targetTubeRef.current.attributes.position.array;
|
|
29
|
+
const currentPosAttr = currentGeom.attributes.position;
|
|
30
|
+
const length = Math.min(basePositions.current.length, targetPositions.length);
|
|
31
|
+
for (let i = 0; i < length; i += 3) {
|
|
32
|
+
currentPosAttr.array[i] = basePositions.current[i] + (targetPositions[i] - basePositions.current[i]) * progress;
|
|
33
|
+
currentPosAttr.array[i + 1] = basePositions.current[i + 1] + (targetPositions[i + 1] - basePositions.current[i + 1]) * progress;
|
|
34
|
+
currentPosAttr.array[i + 2] = basePositions.current[i + 2] + (targetPositions[i + 2] - basePositions.current[i + 2]) * progress;
|
|
35
|
+
}
|
|
36
|
+
animationProgress.current = progress;
|
|
37
|
+
currentPosAttr.needsUpdate = true;
|
|
38
|
+
});
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsxs("mesh", { ref: meshRef, children: [_jsx("tubeGeometry", { ref: tubeRef, args: [curve, 64, tubeRadius, 8, false] }), _jsx("meshBasicMaterial", { color: color, transparent: opacity < 1, opacity: opacity })] }), _jsx("mesh", { position: [0, -1000, 0], children: _jsx("tubeGeometry", { ref: targetTubeRef, args: [targetCurve, 64, tubeRadius, 8, false] }) })] }));
|
|
40
|
+
};
|
|
41
|
+
export default Path;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PathGeometrySettings, Vector3Array } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface PathGeometryProps {
|
|
4
|
+
points: Vector3Array[];
|
|
5
|
+
curve: number;
|
|
6
|
+
smoothCorners?: number;
|
|
7
|
+
geometry: PathGeometrySettings;
|
|
8
|
+
}
|
|
9
|
+
declare const PathGeometry: React.FC<PathGeometryProps>;
|
|
10
|
+
export default PathGeometry;
|
|
11
|
+
//# sourceMappingURL=PathGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathGeometry.d.ts","sourceRoot":"","sources":["../../src/components/PathGeometry.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,iBAAiB;IACvB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,oBAAoB,CAAC;CAClC;AAGD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAsG7C,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { Line } from '@react-three/drei';
|
|
5
|
+
import { smoothPathCorners, createPathSpline } from '@3driseai/3drise-core';
|
|
6
|
+
const PathGeometry = ({ points, curve, smoothCorners = 0, geometry, }) => {
|
|
7
|
+
const { type, width = 2, radius = 0.5, segments = 8, numLanes = 0, color = '#555555', dividerColor = '#ffffff' } = geometry;
|
|
8
|
+
const smoothedPoints = useMemo(() => smoothPathCorners(points, smoothCorners), [points, smoothCorners]);
|
|
9
|
+
const spline = useMemo(() => {
|
|
10
|
+
if (smoothedPoints.length < 2)
|
|
11
|
+
return null;
|
|
12
|
+
return createPathSpline(smoothedPoints, curve);
|
|
13
|
+
}, [smoothedPoints, curve]);
|
|
14
|
+
const tubeGeometry = useMemo(() => {
|
|
15
|
+
if (!spline || type !== 'tube')
|
|
16
|
+
return null;
|
|
17
|
+
return new THREE.TubeGeometry(spline, points.length * 10, radius, segments, false);
|
|
18
|
+
}, [spline, type, radius, segments, points.length]);
|
|
19
|
+
const roadGeometry = useMemo(() => {
|
|
20
|
+
if (!spline || type !== 'road')
|
|
21
|
+
return null;
|
|
22
|
+
const divisions = Math.max(points.length * 20, 100);
|
|
23
|
+
const vertices = [];
|
|
24
|
+
const indices = [];
|
|
25
|
+
const uvs = [];
|
|
26
|
+
const halfWidth = width / 2;
|
|
27
|
+
const up = new THREE.Vector3(0, 1, 0);
|
|
28
|
+
for (let i = 0; i <= divisions; i++) {
|
|
29
|
+
const t = i / divisions;
|
|
30
|
+
const point = spline.getPointAt(t);
|
|
31
|
+
const perp = new THREE.Vector3().crossVectors(spline.getTangentAt(t).normalize(), up).normalize();
|
|
32
|
+
const left = new THREE.Vector3().copy(point).addScaledVector(perp, -halfWidth);
|
|
33
|
+
const right = new THREE.Vector3().copy(point).addScaledVector(perp, halfWidth);
|
|
34
|
+
left.y += 0.01;
|
|
35
|
+
right.y += 0.01;
|
|
36
|
+
vertices.push(left.x, left.y, left.z, right.x, right.y, right.z);
|
|
37
|
+
uvs.push(0, t, 1, t);
|
|
38
|
+
if (i < divisions) {
|
|
39
|
+
const b = i * 2;
|
|
40
|
+
indices.push(b, b + 1, b + 2, b + 1, b + 3, b + 2);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const geo = new THREE.BufferGeometry();
|
|
44
|
+
geo.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));
|
|
45
|
+
geo.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2));
|
|
46
|
+
geo.setIndex(indices);
|
|
47
|
+
geo.computeVertexNormals();
|
|
48
|
+
return geo;
|
|
49
|
+
}, [spline, type, width, points.length]);
|
|
50
|
+
const wallsGeometry = useMemo(() => {
|
|
51
|
+
if (!spline || type !== 'walls')
|
|
52
|
+
return null;
|
|
53
|
+
const divisions = Math.max(points.length * 20, 100);
|
|
54
|
+
const wallHeight = 2;
|
|
55
|
+
const halfWidth = width / 2;
|
|
56
|
+
const vertices = [];
|
|
57
|
+
const indices = [];
|
|
58
|
+
const uvs = [];
|
|
59
|
+
const up = new THREE.Vector3(0, 1, 0);
|
|
60
|
+
for (let i = 0; i <= divisions; i++) {
|
|
61
|
+
const t = i / divisions;
|
|
62
|
+
const point = spline.getPointAt(t);
|
|
63
|
+
const perp = new THREE.Vector3().crossVectors(spline.getTangentAt(t).normalize(), up).normalize();
|
|
64
|
+
const lb = new THREE.Vector3().copy(point).addScaledVector(perp, -halfWidth);
|
|
65
|
+
const lt = lb.clone().setY(lb.y + wallHeight);
|
|
66
|
+
const rb = new THREE.Vector3().copy(point).addScaledVector(perp, halfWidth);
|
|
67
|
+
const rt = rb.clone().setY(rb.y + wallHeight);
|
|
68
|
+
vertices.push(lb.x, lb.y, lb.z, lt.x, lt.y, lt.z, rb.x, rb.y, rb.z, rt.x, rt.y, rt.z);
|
|
69
|
+
uvs.push(0, t, 0, t, 1, t, 1, t);
|
|
70
|
+
if (i < divisions) {
|
|
71
|
+
const b = i * 4, n = (i + 1) * 4;
|
|
72
|
+
indices.push(b, b + 1, n, b + 1, n + 1, n, b + 2, n + 2, b + 3, b + 3, n + 2, n + 3, b + 1, b + 3, n + 1, b + 3, n + 3, n + 1, b, n, b + 2, b + 2, n, n + 2);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const geo = new THREE.BufferGeometry();
|
|
76
|
+
geo.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));
|
|
77
|
+
geo.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2));
|
|
78
|
+
geo.setIndex(indices);
|
|
79
|
+
geo.computeVertexNormals();
|
|
80
|
+
return geo;
|
|
81
|
+
}, [spline, type, width, points.length]);
|
|
82
|
+
const laneDividerLines = useMemo(() => {
|
|
83
|
+
if (!spline || type !== 'road' || numLanes <= 0)
|
|
84
|
+
return null;
|
|
85
|
+
const divisions = Math.max(points.length * 20, 100);
|
|
86
|
+
const laneWidth = width / (numLanes * 2);
|
|
87
|
+
const offsets = [0];
|
|
88
|
+
for (let lane = 1; lane < numLanes; lane++) {
|
|
89
|
+
offsets.push(-lane * laneWidth, lane * laneWidth);
|
|
90
|
+
}
|
|
91
|
+
const up = new THREE.Vector3(0, 1, 0);
|
|
92
|
+
return offsets.map(offset => {
|
|
93
|
+
const line = [];
|
|
94
|
+
for (let i = 0; i <= divisions; i++) {
|
|
95
|
+
const t = i / divisions;
|
|
96
|
+
const point = spline.getPointAt(t);
|
|
97
|
+
const perp = new THREE.Vector3().crossVectors(spline.getTangentAt(t).normalize(), up).normalize();
|
|
98
|
+
const dp = new THREE.Vector3().copy(point).addScaledVector(perp, offset);
|
|
99
|
+
dp.y += 0.02;
|
|
100
|
+
line.push([dp.x, dp.y, dp.z]);
|
|
101
|
+
}
|
|
102
|
+
return line;
|
|
103
|
+
});
|
|
104
|
+
}, [spline, type, width, numLanes, points.length]);
|
|
105
|
+
if (!spline || type === 'none')
|
|
106
|
+
return null;
|
|
107
|
+
return (_jsxs("group", { children: [type === 'tube' && tubeGeometry && (_jsx("mesh", { geometry: tubeGeometry, children: _jsx("meshStandardMaterial", { color: color, side: THREE.DoubleSide }) })), type === 'road' && roadGeometry && (_jsx("mesh", { geometry: roadGeometry, children: _jsx("meshStandardMaterial", { color: color, side: THREE.DoubleSide }) })), type === 'road' && laneDividerLines?.map((line, index) => (_jsx(Line, { points: line, color: dividerColor, lineWidth: 2, dashed: index !== 0, dashSize: 0.5, gapSize: 0.3, raycast: () => null }, `lane-${index}`))), type === 'walls' && wallsGeometry && (_jsx("mesh", { geometry: wallsGeometry, children: _jsx("meshStandardMaterial", { color: color, side: THREE.DoubleSide }) }))] }));
|
|
108
|
+
};
|
|
109
|
+
export default PathGeometry;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PathConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface PathRendererProps {
|
|
4
|
+
pathSettings: PathConfig;
|
|
5
|
+
color?: string;
|
|
6
|
+
showPoints?: boolean;
|
|
7
|
+
showLine?: boolean;
|
|
8
|
+
showCurve?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const PathRenderer: React.FC<PathRendererProps>;
|
|
11
|
+
export default PathRenderer;
|
|
12
|
+
//# sourceMappingURL=PathRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathRenderer.d.ts","sourceRoot":"","sources":["../../src/components/PathRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,iBAAiB;IAC9B,YAAY,EAAE,UAAU,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAGD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6B7C,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Sphere, Line } from '@react-three/drei';
|
|
4
|
+
import { smoothPathCorners, createPathSpline, sampleSplinePoints } from '@3driseai/3drise-core';
|
|
5
|
+
import PathGeometry from './PathGeometry.js';
|
|
6
|
+
const PathRenderer = ({ pathSettings, color = '#ffa500', showPoints = true, showLine = true, showCurve = true, }) => {
|
|
7
|
+
console.log("Rendering Path with settings:", pathSettings);
|
|
8
|
+
const pointSize = pathSettings.pointSize ?? 0.1;
|
|
9
|
+
const lineWidth = pathSettings.lineWidth ?? 2;
|
|
10
|
+
const points = pathSettings?.points || [];
|
|
11
|
+
const curve = pathSettings?.curve ?? 1;
|
|
12
|
+
const smoothCorners = pathSettings?.smoothCorners ?? 0;
|
|
13
|
+
const geometry = pathSettings?.geometry;
|
|
14
|
+
const hasCurve = curve > 1;
|
|
15
|
+
const hasSmoothCorners = smoothCorners > 0;
|
|
16
|
+
const smoothedPoints = useMemo(() => {
|
|
17
|
+
if (!hasSmoothCorners || points.length < 3)
|
|
18
|
+
return points;
|
|
19
|
+
return smoothPathCorners(points, smoothCorners);
|
|
20
|
+
}, [points, smoothCorners, hasSmoothCorners]);
|
|
21
|
+
const curvePoints = useMemo(() => {
|
|
22
|
+
if (!showCurve || points.length < 2)
|
|
23
|
+
return null;
|
|
24
|
+
if (!hasCurve && !hasSmoothCorners)
|
|
25
|
+
return null;
|
|
26
|
+
const basePoints = hasSmoothCorners ? smoothedPoints : points;
|
|
27
|
+
const spline = createPathSpline(basePoints, curve);
|
|
28
|
+
if (!spline)
|
|
29
|
+
return null;
|
|
30
|
+
return sampleSplinePoints(spline, basePoints.length);
|
|
31
|
+
}, [points, smoothedPoints, curve, smoothCorners, showCurve, hasCurve, hasSmoothCorners]);
|
|
32
|
+
if (points.length === 0)
|
|
33
|
+
return null;
|
|
34
|
+
return (_jsxs("group", { children: [showPoints && points.map((point, index) => (_jsxs("group", { position: point, children: [_jsx(Sphere, { args: [pointSize, 16, 16], children: _jsx("meshStandardMaterial", { color: color, emissive: color, emissiveIntensity: 0.5, toneMapped: false }) }), _jsx(Sphere, { args: [pointSize * 0.33, 8, 8], position: [0, pointSize * 1.67, 0], children: _jsx("meshBasicMaterial", { color: "#ffffff" }) })] }, `path-point-${index}`))), showLine && points.length > 1 && !hasCurve && !hasSmoothCorners && (_jsx(Line, { points: points, color: color, lineWidth: lineWidth, raycast: () => null })), showCurve && curvePoints && curvePoints.length > 1 && (_jsx(Line, { points: curvePoints, color: color, lineWidth: lineWidth, raycast: () => null })), showLine && showCurve && (hasCurve || hasSmoothCorners) && points.length > 1 && (_jsx(Line, { points: points, color: color, lineWidth: 1, dashed: true, dashSize: 0.1, gapSize: 0.1, raycast: () => null })), geometry && geometry.type !== 'none' && points.length >= 2 && (_jsx(PathGeometry, { points: points, curve: curve, smoothCorners: smoothCorners, geometry: geometry }))] }));
|
|
35
|
+
};
|
|
36
|
+
export default PathRenderer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Mesh } from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export type PlanetType = 'moon' | 'sun' | 'mercury' | 'venus' | 'mars' | 'jupiter' | 'saturn' | 'uranus' | 'neptune';
|
|
4
|
+
export interface PlanetProps {
|
|
5
|
+
type?: PlanetType;
|
|
6
|
+
position?: [number, number, number];
|
|
7
|
+
scale?: number;
|
|
8
|
+
rotation?: [number, number, number];
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
emissiveIntensity?: number;
|
|
11
|
+
shininess?: number;
|
|
12
|
+
onMeshReady?: (mesh: Mesh) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Planet: React.FC<PlanetProps>;
|
|
15
|
+
export default Planet;
|
|
16
|
+
//# sourceMappingURL=Planet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Planet.d.ts","sourceRoot":"","sources":["../../src/components/Planet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErH,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACtC;AA0CD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAcjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect, useMemo, useCallback } from 'react';
|
|
3
|
+
import { RingGeometry, DoubleSide, Vector3, SRGBColorSpace, } from 'three';
|
|
4
|
+
import { useTexture } from '@react-three/drei';
|
|
5
|
+
const CDN = 'https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/planets';
|
|
6
|
+
const PLANET_TEXTURES = {
|
|
7
|
+
moon: `${CDN}/2k_moon.jpg`,
|
|
8
|
+
sun: `${CDN}/2k_sun.jpg`,
|
|
9
|
+
mercury: `${CDN}/2k_mercury.jpg`,
|
|
10
|
+
venus: `${CDN}/2k_venus_surface.jpg`,
|
|
11
|
+
mars: `${CDN}/2k_mars.jpg`,
|
|
12
|
+
jupiter: `${CDN}/2k_jupiter.jpg`,
|
|
13
|
+
saturn: `${CDN}/2k_saturn.jpg`,
|
|
14
|
+
uranus: `${CDN}/2k_uranus.jpg`,
|
|
15
|
+
neptune: `${CDN}/2k_neptune.jpg`,
|
|
16
|
+
};
|
|
17
|
+
const saturnRingTextureUrl = `${CDN}/2k_saturn_ring_alpha.png`;
|
|
18
|
+
const RING_INNER = 1.3;
|
|
19
|
+
const RING_OUTER = 2.3;
|
|
20
|
+
function createRingGeometry(inner, outer, segments = 128) {
|
|
21
|
+
const geom = new RingGeometry(inner, outer, segments);
|
|
22
|
+
// RingGeometry's default UVs go around the ring. Remap so the radial axis
|
|
23
|
+
// (inner → outer) maps to U (0 → 1) so a strip-style ring texture displays correctly.
|
|
24
|
+
const pos = geom.attributes.position;
|
|
25
|
+
const uv = geom.attributes.uv;
|
|
26
|
+
const v = new Vector3();
|
|
27
|
+
for (let i = 0; i < pos.count; i++) {
|
|
28
|
+
v.fromBufferAttribute(pos, i);
|
|
29
|
+
const r = v.length();
|
|
30
|
+
const t = (r - inner) / (outer - inner);
|
|
31
|
+
uv.setXY(i, t, 0.5);
|
|
32
|
+
}
|
|
33
|
+
uv.needsUpdate = true;
|
|
34
|
+
return geom;
|
|
35
|
+
}
|
|
36
|
+
const SaturnRing = () => {
|
|
37
|
+
const ringTexture = useTexture(saturnRingTextureUrl);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
ringTexture.colorSpace = SRGBColorSpace;
|
|
40
|
+
}, [ringTexture]);
|
|
41
|
+
const ringGeometry = useMemo(() => createRingGeometry(RING_INNER, RING_OUTER), []);
|
|
42
|
+
return (_jsx("mesh", { geometry: ringGeometry, rotation: [-Math.PI / 2, 0, 0], children: _jsx("meshBasicMaterial", { map: ringTexture, alphaMap: ringTexture, transparent: true, side: DoubleSide, depthWrite: false }) }));
|
|
43
|
+
};
|
|
44
|
+
const Planet = ({ type = 'moon', position = [0, 0, 0], scale = 5, rotation = [0, 0, 0], visible = true, emissiveIntensity = 0, shininess = 30, onMeshReady, }) => {
|
|
45
|
+
const meshRef = useRef(null);
|
|
46
|
+
const texture = useTexture(PLANET_TEXTURES[type]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
texture.colorSpace = SRGBColorSpace;
|
|
49
|
+
texture.anisotropy = 8;
|
|
50
|
+
}, [texture]);
|
|
51
|
+
const handleMeshRef = useCallback((mesh) => {
|
|
52
|
+
if (mesh) {
|
|
53
|
+
meshRef.current = mesh;
|
|
54
|
+
onMeshReady?.(mesh);
|
|
55
|
+
}
|
|
56
|
+
}, [onMeshReady]);
|
|
57
|
+
return (_jsxs("group", { userData: { id: `3drise-planet-${type}` }, position: position, rotation: rotation, scale: scale, visible: visible, children: [_jsxs("mesh", { ref: handleMeshRef, children: [_jsx("sphereGeometry", { args: [1, 64, 64] }), _jsx("meshPhongMaterial", { map: texture, color: '#ffffff', emissive: '#ffffff', emissiveMap: texture, emissiveIntensity: emissiveIntensity, shininess: shininess })] }), type === 'saturn' && _jsx(SaturnRing, {})] }));
|
|
58
|
+
};
|
|
59
|
+
Planet.displayName = 'Planet';
|
|
60
|
+
export default Planet;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MaterialSettings, ObjectAnimations } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface PointCloudProps {
|
|
4
|
+
positions: Float32Array;
|
|
5
|
+
materialSettings: MaterialSettings;
|
|
6
|
+
animations?: ObjectAnimations;
|
|
7
|
+
}
|
|
8
|
+
declare const PointCloud: React.FC<PointCloudProps>;
|
|
9
|
+
export default PointCloud;
|
|
10
|
+
//# sourceMappingURL=PointCloud.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointCloud.d.ts","sourceRoot":"","sources":["../../src/components/PointCloud.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,eAAe;IACrB,SAAS,EAAE,YAAY,CAAC;IACxB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAyBD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAkFzC,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import { useParticlesColors } from '../hooks/useParticlesColors.js';
|
|
5
|
+
import { useParticlesTextures } from '../hooks/useParticlesTextures.js';
|
|
6
|
+
import { buildShaderEffectsMaterial, structureKey } from '@3driseai/3drise-core';
|
|
7
|
+
import { update3driseShaderUniforms } from '../hooks/use3driseShader.js';
|
|
8
|
+
function normalizeEffects(raw) {
|
|
9
|
+
return Array.isArray(raw) ? raw : [];
|
|
10
|
+
}
|
|
11
|
+
function generateUVsFromPositions(positions) {
|
|
12
|
+
const count = positions.length / 3;
|
|
13
|
+
let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
|
|
14
|
+
for (let i = 0; i < positions.length; i += 3) {
|
|
15
|
+
minX = Math.min(minX, positions[i]);
|
|
16
|
+
maxX = Math.max(maxX, positions[i]);
|
|
17
|
+
minY = Math.min(minY, positions[i + 1]);
|
|
18
|
+
maxY = Math.max(maxY, positions[i + 1]);
|
|
19
|
+
}
|
|
20
|
+
const rangeX = maxX - minX || 1;
|
|
21
|
+
const rangeY = maxY - minY || 1;
|
|
22
|
+
const uvs = new Float32Array(count * 2);
|
|
23
|
+
for (let i = 0; i < positions.length; i += 3) {
|
|
24
|
+
const idx = (i / 3) * 2;
|
|
25
|
+
uvs[idx] = (positions[i] - minX) / rangeX;
|
|
26
|
+
uvs[idx + 1] = (positions[i + 1] - minY) / rangeY;
|
|
27
|
+
}
|
|
28
|
+
return uvs;
|
|
29
|
+
}
|
|
30
|
+
const PointCloud = ({ positions, materialSettings, animations, }) => {
|
|
31
|
+
const materialRef = useRef(null);
|
|
32
|
+
const pointsRef = useRef(null);
|
|
33
|
+
const color = materialSettings && 'color' in materialSettings
|
|
34
|
+
? materialSettings.color
|
|
35
|
+
: '#ffffff';
|
|
36
|
+
const opacity = materialSettings && 'opacity' in materialSettings
|
|
37
|
+
? materialSettings.opacity
|
|
38
|
+
: 1.0;
|
|
39
|
+
const pointSize = materialSettings && 'pointSize' in materialSettings
|
|
40
|
+
? materialSettings.pointSize
|
|
41
|
+
: 5.0;
|
|
42
|
+
const texture = materialSettings && 'map' in materialSettings
|
|
43
|
+
? materialSettings.map
|
|
44
|
+
: null;
|
|
45
|
+
const count = positions.length / 3;
|
|
46
|
+
const aspectRatio = 16 / 9;
|
|
47
|
+
const nbLines = Math.round(Math.sqrt(count / 3 / aspectRatio));
|
|
48
|
+
const nbColumns = Math.round(aspectRatio * nbLines);
|
|
49
|
+
const particleUVScale = 1.0 / Math.max(nbColumns, nbLines);
|
|
50
|
+
const uvs = useMemo(() => generateUVsFromPositions(positions), [positions]);
|
|
51
|
+
const { handleColorsAnimation } = useParticlesColors({ color, targetColor: color });
|
|
52
|
+
const { currentTexture, prevTexture, loadTexture, textureProgress, handleTextureAnimation } = useParticlesTextures();
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (texture && texture.trim() !== '') {
|
|
55
|
+
textureProgress.current = 0;
|
|
56
|
+
loadTexture(texture);
|
|
57
|
+
}
|
|
58
|
+
}, [texture, loadTexture]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const points = pointsRef.current;
|
|
61
|
+
if (!points)
|
|
62
|
+
return;
|
|
63
|
+
const applyTexture = (url) => {
|
|
64
|
+
if (!url)
|
|
65
|
+
return;
|
|
66
|
+
textureProgress.current = 0;
|
|
67
|
+
loadTexture(url);
|
|
68
|
+
};
|
|
69
|
+
points.userData.applyTexture = applyTexture;
|
|
70
|
+
return () => {
|
|
71
|
+
delete points.userData.applyTexture;
|
|
72
|
+
};
|
|
73
|
+
}, [loadTexture, textureProgress]);
|
|
74
|
+
const speed = 1;
|
|
75
|
+
const activeEffects = useMemo(() => normalizeEffects(animations?.material?.shaderEffects), [animations?.material?.shaderEffects]);
|
|
76
|
+
const pointerRadius = animations?.material
|
|
77
|
+
?.shaderEffectsPointerRadius ?? 0.4;
|
|
78
|
+
const effectsKey = useMemo(() => structureKey(activeEffects), [activeEffects]);
|
|
79
|
+
const material = useMemo(() => buildShaderEffectsMaterial({
|
|
80
|
+
effects: activeEffects,
|
|
81
|
+
initialColor: color,
|
|
82
|
+
initialOpacity: opacity,
|
|
83
|
+
initialPointSize: pointSize,
|
|
84
|
+
initialParticleUVScale: particleUVScale,
|
|
85
|
+
initialPointerEffectRadius: pointerRadius,
|
|
86
|
+
}),
|
|
87
|
+
// Rebuild when the structural set of effects changes; not on parameter tweaks.
|
|
88
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89
|
+
[effectsKey]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
materialRef.current = material;
|
|
92
|
+
return () => {
|
|
93
|
+
material.dispose();
|
|
94
|
+
};
|
|
95
|
+
}, [material]);
|
|
96
|
+
useFrame((state, delta) => {
|
|
97
|
+
const mat = materialRef.current;
|
|
98
|
+
if (!mat || !pointsRef.current)
|
|
99
|
+
return;
|
|
100
|
+
handleColorsAnimation(materialRef, delta, speed);
|
|
101
|
+
if (prevTexture.current)
|
|
102
|
+
mat.uniforms.uTexture.value = prevTexture.current;
|
|
103
|
+
if (currentTexture.current)
|
|
104
|
+
mat.uniforms.uTargetTexture.value = currentTexture.current;
|
|
105
|
+
mat.uniforms.uHasTexture.value = !!currentTexture.current;
|
|
106
|
+
handleTextureAnimation(materialRef, delta, speed);
|
|
107
|
+
update3driseShaderUniforms(mat.uniforms, activeEffects, state.clock.getElapsedTime(), { x: state.pointer.x, y: state.pointer.y }, { pointerRadius });
|
|
108
|
+
});
|
|
109
|
+
if (!positions)
|
|
110
|
+
return null;
|
|
111
|
+
return (_jsxs("points", { ref: pointsRef, raycast: () => null, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: [_jsxs("bufferGeometry", { children: [_jsx("bufferAttribute", { attach: "attributes-position", count: positions.length / 3, array: positions, itemSize: 3, args: [positions, 3] }), uvs && (_jsx("bufferAttribute", { attach: "attributes-aUV", count: uvs.length / 2, array: uvs, itemSize: 2, args: [uvs, 2] }))] }), _jsx("primitive", { object: material, attach: "material" })] }));
|
|
112
|
+
};
|
|
113
|
+
export default PointCloud;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductionScene.d.ts","sourceRoot":"","sources":["../../src/components/ProductionScene.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAGnD,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Physics } from "@react-three/rapier";
|
|
3
|
+
const ProductionScene = ({ physicsSettings, children, }) => {
|
|
4
|
+
// Interaction hook
|
|
5
|
+
return (_jsx(Physics, { gravity: physicsSettings.gravity, paused: !physicsSettings.enabled, debug: physicsSettings.debug, children: children }));
|
|
6
|
+
};
|
|
7
|
+
export default ProductionScene;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CreatedObjectSettings, HtmlElement } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Object3D } from "three";
|
|
4
|
+
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
|
+
type ProjectProps = {
|
|
6
|
+
projectId: string;
|
|
7
|
+
loadingIndicator?: React.ReactNode;
|
|
8
|
+
onObjectClick?: (object: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
9
|
+
onObjectHover?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
10
|
+
onElementClick?: (element: HtmlElement) => void;
|
|
11
|
+
onElementHover?: (element: HtmlElement | null) => void;
|
|
12
|
+
onSceneInitialized?: () => void;
|
|
13
|
+
};
|
|
14
|
+
declare const ProjectLoader: React.FC<ProjectProps>;
|
|
15
|
+
export default ProjectLoader;
|
|
16
|
+
//# sourceMappingURL=ProjectLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectLoader.d.ts","sourceRoot":"","sources":["../../src/components/ProjectLoader.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGhF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,YAAY,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtG,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC,CAAC;AAIF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA2EzC,CAAC;AACF,eAAe,aAAa,CAAC"}
|