@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,54 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BufferGeometry } from 'three';
|
|
3
|
+
import type { GeometryShapeConfig, MaterialSettings, ModeConfig, ObjectAnimations } from "@3driseai/3drise-core";
|
|
4
|
+
type Pt = [number, number, number];
|
|
5
|
+
type ModeData = {
|
|
6
|
+
kind: 'mesh';
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'points';
|
|
9
|
+
positions: Float32Array;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'lines';
|
|
12
|
+
points: Pt[];
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'plexus';
|
|
15
|
+
positions: Float32Array;
|
|
16
|
+
segments: Pt[];
|
|
17
|
+
};
|
|
18
|
+
export interface GeometryMeshProps {
|
|
19
|
+
config: GeometryShapeConfig;
|
|
20
|
+
modeConfig?: ModeConfig;
|
|
21
|
+
materialSettings: MaterialSettings;
|
|
22
|
+
animations?: ObjectAnimations;
|
|
23
|
+
color?: string;
|
|
24
|
+
/** Material for the solid path (defaults to a standard material). */
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function useShapeGeometry(options: GeometryShapeConfig): BufferGeometry;
|
|
28
|
+
/** interior fill via point-in-mesh ray-parity (closed meshes only) */
|
|
29
|
+
export declare function volumeFill(geo: BufferGeometry, count: number, oversample?: number): Float32Array;
|
|
30
|
+
/** area-weighted points on the skin — the keystone for the modes below */
|
|
31
|
+
export declare function surfaceScatter(geo: BufferGeometry, count: number): Float32Array;
|
|
32
|
+
/** fold into one wedge, mirror, rotate-copy around Z → kaleidoscope */
|
|
33
|
+
export declare function symmetricScatter(geo: BufferGeometry, count: number, sym: number): Float32Array;
|
|
34
|
+
/** blue-noise: oversample then reject anything closer than minDist (grid-hashed) */
|
|
35
|
+
export declare function evenScatter(geo: BufferGeometry, count: number, spacing: number): Float32Array;
|
|
36
|
+
export declare function meshVertices(geo: BufferGeometry): Float32Array;
|
|
37
|
+
export declare function edges3D(geo: BufferGeometry, angleDeg: number): Pt[];
|
|
38
|
+
export declare function contour2D(geo: BufferGeometry): Pt[];
|
|
39
|
+
export declare function wireframe(geo: BufferGeometry): Pt[];
|
|
40
|
+
/** slice at stepped heights, draw each triangle's cross-section segment (axis: 0=x 1=y 2=z) */
|
|
41
|
+
export declare function contourSlices(geo: BufferGeometry, slices: number, axis?: number): Pt[];
|
|
42
|
+
export declare function plexus(geo: BufferGeometry, count: number, radiusMul: number, maxLinks?: number): {
|
|
43
|
+
positions: Float32Array;
|
|
44
|
+
segments: Pt[];
|
|
45
|
+
};
|
|
46
|
+
export declare function computeMode(geo: BufferGeometry, c: ModeConfig): ModeData;
|
|
47
|
+
export declare function GeometryMesh({ config, materialSettings, animations, modeConfig, color, children }: GeometryMeshProps): import("react").JSX.Element;
|
|
48
|
+
export declare function FitGroup({ geometry, radius, children }: {
|
|
49
|
+
geometry: BufferGeometry;
|
|
50
|
+
radius?: number;
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
}): any;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=GeometryShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeometryShape.d.ts","sourceRoot":"","sources":["../../src/components/GeometryShape.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACjH,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnC,KAAK,QAAQ,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB,GAAG;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,YAAY,CAAC;CAC3B,GAAG;IACA,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,EAAE,EAAE,CAAC;CAChB,GAAG;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,EAAE,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAOD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,cAAc,CAK7E;AA8BD,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,GAAG,YAAY,CAyBpG;AACD,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAiC/E;AACD,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAiB9F;AACD,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAgC7F;AACD,wBAAgB,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,YAAY,CAS9D;AAID,wBAAgB,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE,CAKnE;AACD,wBAAgB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,EAAE,EAAE,CAkBnD;AACD,wBAAgB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,EAAE,EAAE,CAKnD;AACD,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,GAAG,EAAE,EAAE,CAuBzF;AAID,wBAAgB,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG;IAC7F,SAAS,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,EAAE,EAAE,CAAC;CAClB,CAoCJ;AACD,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,EAAE,UAAU,GAAG,QAAQ,CAkBxE;AAOD,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAA8B,EAAE,KAAiB,EAAE,QAAQ,EAAE,EAAE,iBAAiB,+BAWpJ;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,MAAY,EAAE,QAAQ,EAAE,EAAE;IACnD,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,GAQ2E,GAAG,CACtF"}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import { EdgesGeometry, WireframeGeometry, Mesh, MeshBasicMaterial, Raycaster, Vector3, DoubleSide, } from 'three';
|
|
4
|
+
import { Line } from '@react-three/drei';
|
|
5
|
+
// ── Wire these to your project ───────────────────────────────────────────────
|
|
6
|
+
import { shapeGenerators } from '../utils/shapes.js';
|
|
7
|
+
import PointCloud from './PointCloud.js';
|
|
8
|
+
// import type { ShapeConfig, DisplayMode } from './GeometryShapeController';
|
|
9
|
+
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
|
|
10
|
+
* Geometry — one source the modes all read from.
|
|
11
|
+
* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
|
|
12
|
+
export function useShapeGeometry(options) {
|
|
13
|
+
const key = JSON.stringify(options);
|
|
14
|
+
const geometry = useMemo(() => shapeGenerators[options.type](options), [options.type, key]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
15
|
+
useEffect(() => () => geometry.dispose(), [geometry]);
|
|
16
|
+
return geometry;
|
|
17
|
+
}
|
|
18
|
+
function getTriangles(geo) {
|
|
19
|
+
const pos = geo.attributes.position;
|
|
20
|
+
const idx = geo.index;
|
|
21
|
+
const tris = [];
|
|
22
|
+
const n = idx ? idx.count : pos.count;
|
|
23
|
+
for (let i = 0; i < n; i += 3) {
|
|
24
|
+
const a = idx ? idx.getX(i) : i, b = idx ? idx.getX(i + 1) : i + 1, c = idx ? idx.getX(i + 2) : i + 2;
|
|
25
|
+
tris.push([pos.getX(a), pos.getY(a), pos.getZ(a), pos.getX(b), pos.getY(b), pos.getZ(b), pos.getX(c), pos.getY(c), pos.getZ(c)]);
|
|
26
|
+
}
|
|
27
|
+
return tris;
|
|
28
|
+
}
|
|
29
|
+
function triArea(t) {
|
|
30
|
+
const ux = t[3] - t[0], uy = t[4] - t[1], uz = t[5] - t[2], vx = t[6] - t[0], vy = t[7] - t[1], vz = t[8] - t[2];
|
|
31
|
+
return 0.5 * Math.hypot(uy * vz - uz * vy, uz * vx - ux * vz, ux * vy - uy * vx);
|
|
32
|
+
}
|
|
33
|
+
function bboxDiag(geo) {
|
|
34
|
+
geo.computeBoundingBox();
|
|
35
|
+
const b = geo.boundingBox;
|
|
36
|
+
return Math.hypot(b.max.x - b.min.x, b.max.y - b.min.y, b.max.z - b.min.z) || 1;
|
|
37
|
+
}
|
|
38
|
+
function toPairs(arr) {
|
|
39
|
+
const out = [];
|
|
40
|
+
for (let i = 0; i < arr.length; i += 3)
|
|
41
|
+
out.push([arr[i], arr[i + 1], arr[i + 2]]);
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
|
|
45
|
+
* POINT transforms → Float32Array of xyz.
|
|
46
|
+
* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
|
|
47
|
+
/** interior fill via point-in-mesh ray-parity (closed meshes only) */
|
|
48
|
+
export function volumeFill(geo, count, oversample = 80) {
|
|
49
|
+
const probe = new Mesh(geo, new MeshBasicMaterial({ side: DoubleSide }));
|
|
50
|
+
probe.updateMatrixWorld(true);
|
|
51
|
+
geo.computeBoundingBox();
|
|
52
|
+
const bb = geo.boundingBox;
|
|
53
|
+
const sx = bb.max.x - bb.min.x, sy = bb.max.y - bb.min.y, sz = bb.max.z - bb.min.z;
|
|
54
|
+
const ray = new Raycaster();
|
|
55
|
+
const dir = new Vector3(0, 0, 1);
|
|
56
|
+
const p = new Vector3();
|
|
57
|
+
const out = new Float32Array(count * 3);
|
|
58
|
+
let i = 0, tries = 0;
|
|
59
|
+
const max = count * oversample;
|
|
60
|
+
while (i < count && tries < max) {
|
|
61
|
+
tries++;
|
|
62
|
+
p.set(bb.min.x + Math.random() * sx, bb.min.y + Math.random() * sy, bb.min.z + Math.random() * sz);
|
|
63
|
+
ray.set(p, dir);
|
|
64
|
+
if (ray.intersectObject(probe, false).length % 2 === 1) {
|
|
65
|
+
out[i * 3] = p.x;
|
|
66
|
+
out[i * 3 + 1] = p.y;
|
|
67
|
+
out[i * 3 + 2] = p.z;
|
|
68
|
+
i++;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
probe.material.dispose();
|
|
72
|
+
return i === count ? out : out.slice(0, i * 3);
|
|
73
|
+
}
|
|
74
|
+
/** area-weighted points on the skin — the keystone for the modes below */
|
|
75
|
+
export function surfaceScatter(geo, count) {
|
|
76
|
+
const tris = getTriangles(geo);
|
|
77
|
+
if (!tris.length)
|
|
78
|
+
return new Float32Array(0);
|
|
79
|
+
const cum = [];
|
|
80
|
+
let total = 0;
|
|
81
|
+
for (const t of tris) {
|
|
82
|
+
total += triArea(t);
|
|
83
|
+
cum.push(total);
|
|
84
|
+
}
|
|
85
|
+
const out = new Float32Array(count * 3);
|
|
86
|
+
for (let i = 0; i < count; i++) {
|
|
87
|
+
const r = Math.random() * total;
|
|
88
|
+
let lo = 0, hi = cum.length - 1;
|
|
89
|
+
while (lo < hi) {
|
|
90
|
+
const m = (lo + hi) >> 1;
|
|
91
|
+
if (cum[m] < r)
|
|
92
|
+
lo = m + 1;
|
|
93
|
+
else
|
|
94
|
+
hi = m;
|
|
95
|
+
}
|
|
96
|
+
const t = tris[lo];
|
|
97
|
+
let u = Math.random(), v = Math.random();
|
|
98
|
+
if (u + v > 1) {
|
|
99
|
+
u = 1 - u;
|
|
100
|
+
v = 1 - v;
|
|
101
|
+
}
|
|
102
|
+
const w = 1 - u - v;
|
|
103
|
+
out[i * 3] = t[0] * w + t[3] * u + t[6] * v;
|
|
104
|
+
out[i * 3 + 1] = t[1] * w + t[4] * u + t[7] * v;
|
|
105
|
+
out[i * 3 + 2] = t[2] * w + t[5] * u + t[8] * v;
|
|
106
|
+
}
|
|
107
|
+
return out;
|
|
108
|
+
}
|
|
109
|
+
/** fold into one wedge, mirror, rotate-copy around Z → kaleidoscope */
|
|
110
|
+
export function symmetricScatter(geo, count, sym) {
|
|
111
|
+
const base = surfaceScatter(geo, Math.max(1, Math.floor(count / (2 * sym))));
|
|
112
|
+
const w = (Math.PI * 2) / sym;
|
|
113
|
+
const out = [];
|
|
114
|
+
for (let i = 0; i < base.length; i += 3) {
|
|
115
|
+
const x = base[i], y = base[i + 1], z = base[i + 2];
|
|
116
|
+
const rr = Math.hypot(x, y);
|
|
117
|
+
let a = ((Math.atan2(y, x) % w) + w) % w;
|
|
118
|
+
if (a > w / 2)
|
|
119
|
+
a = w - a;
|
|
120
|
+
for (let k = 0; k < sym; k++)
|
|
121
|
+
for (const s of [1, -1]) {
|
|
122
|
+
const ang = k * w + s * a;
|
|
123
|
+
out.push(rr * Math.cos(ang), rr * Math.sin(ang), z);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return new Float32Array(out);
|
|
127
|
+
}
|
|
128
|
+
/** blue-noise: oversample then reject anything closer than minDist (grid-hashed) */
|
|
129
|
+
export function evenScatter(geo, count, spacing) {
|
|
130
|
+
const cand = surfaceScatter(geo, count * 6);
|
|
131
|
+
const minD = (spacing * bboxDiag(geo)) / Math.sqrt(count);
|
|
132
|
+
const minD2 = minD * minD;
|
|
133
|
+
const cell = minD || 1;
|
|
134
|
+
const grid = new Map();
|
|
135
|
+
const out = [];
|
|
136
|
+
const key = (a, b, c) => `${a},${b},${c}`;
|
|
137
|
+
for (let i = 0; i < cand.length && out.length < count * 3; i += 3) {
|
|
138
|
+
const x = cand[i], y = cand[i + 1], z = cand[i + 2];
|
|
139
|
+
const cx = Math.floor(x / cell), cy = Math.floor(y / cell), cz = Math.floor(z / cell);
|
|
140
|
+
let ok = true;
|
|
141
|
+
for (let dx = -1; dx <= 1 && ok; dx++)
|
|
142
|
+
for (let dy = -1; dy <= 1 && ok; dy++)
|
|
143
|
+
for (let dz = -1; dz <= 1 && ok; dz++) {
|
|
144
|
+
const arr = grid.get(key(cx + dx, cy + dy, cz + dz));
|
|
145
|
+
if (arr)
|
|
146
|
+
for (const p of arr) {
|
|
147
|
+
const ex = p[0] - x, ey = p[1] - y, ez = p[2] - z;
|
|
148
|
+
if (ex * ex + ey * ey + ez * ez < minD2) {
|
|
149
|
+
ok = false;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (ok) {
|
|
155
|
+
const k = key(cx, cy, cz);
|
|
156
|
+
(grid.get(k) ?? grid.set(k, []).get(k)).push([x, y, z]);
|
|
157
|
+
out.push(x, y, z);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return new Float32Array(out);
|
|
161
|
+
}
|
|
162
|
+
export function meshVertices(geo) {
|
|
163
|
+
const pos = geo.attributes.position;
|
|
164
|
+
const out = new Float32Array(pos.count * 3);
|
|
165
|
+
for (let i = 0; i < pos.count; i++) {
|
|
166
|
+
out[i * 3] = pos.getX(i);
|
|
167
|
+
out[i * 3 + 1] = pos.getY(i);
|
|
168
|
+
out[i * 3 + 2] = pos.getZ(i);
|
|
169
|
+
}
|
|
170
|
+
return out;
|
|
171
|
+
}
|
|
172
|
+
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
|
|
173
|
+
* LINE transforms → segment endpoint pairs (Pt[]).
|
|
174
|
+
* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
|
|
175
|
+
export function edges3D(geo, angleDeg) {
|
|
176
|
+
const e = new EdgesGeometry(geo, angleDeg);
|
|
177
|
+
const pts = toPairs(e.attributes.position.array);
|
|
178
|
+
e.dispose();
|
|
179
|
+
return pts;
|
|
180
|
+
}
|
|
181
|
+
export function contour2D(geo) {
|
|
182
|
+
const e = new EdgesGeometry(geo, 1);
|
|
183
|
+
const a = e.attributes.position.array;
|
|
184
|
+
let maxZ = -Infinity, minZ = Infinity;
|
|
185
|
+
for (let i = 2; i < a.length; i += 3) {
|
|
186
|
+
if (a[i] > maxZ)
|
|
187
|
+
maxZ = a[i];
|
|
188
|
+
if (a[i] < minZ)
|
|
189
|
+
minZ = a[i];
|
|
190
|
+
}
|
|
191
|
+
const eps = Math.max((maxZ - minZ) * 1e-3, 1e-4);
|
|
192
|
+
const out = [];
|
|
193
|
+
for (let i = 0; i < a.length; i += 6) {
|
|
194
|
+
if (Math.abs(a[i + 2] - maxZ) < eps && Math.abs(a[i + 5] - maxZ) < eps)
|
|
195
|
+
out.push([a[i], a[i + 1], 0], [a[i + 3], a[i + 4], 0]);
|
|
196
|
+
}
|
|
197
|
+
e.dispose();
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
200
|
+
export function wireframe(geo) {
|
|
201
|
+
const wg = new WireframeGeometry(geo);
|
|
202
|
+
const pts = toPairs(wg.attributes.position.array);
|
|
203
|
+
wg.dispose();
|
|
204
|
+
return pts;
|
|
205
|
+
}
|
|
206
|
+
/** slice at stepped heights, draw each triangle's cross-section segment (axis: 0=x 1=y 2=z) */
|
|
207
|
+
export function contourSlices(geo, slices, axis = 1) {
|
|
208
|
+
const tris = getTriangles(geo);
|
|
209
|
+
geo.computeBoundingBox();
|
|
210
|
+
const lo = geo.boundingBox.min.getComponent(axis), hi = geo.boundingBox.max.getComponent(axis);
|
|
211
|
+
const out = [];
|
|
212
|
+
for (let s = 0; s < slices; s++) {
|
|
213
|
+
const h = lo + ((s + 0.5) / slices) * (hi - lo);
|
|
214
|
+
for (const t of tris) {
|
|
215
|
+
const P = [[t[0], t[1], t[2]], [t[3], t[4], t[5]], [t[6], t[7], t[8]]];
|
|
216
|
+
const hit = [];
|
|
217
|
+
for (let e = 0; e < 3; e++) {
|
|
218
|
+
const A = P[e], B = P[(e + 1) % 3];
|
|
219
|
+
const da = A[axis] - h, db = B[axis] - h;
|
|
220
|
+
if (da * db < 0) {
|
|
221
|
+
const tt = da / (da - db);
|
|
222
|
+
hit.push([A[0] + (B[0] - A[0]) * tt, A[1] + (B[1] - A[1]) * tt, A[2] + (B[2] - A[2]) * tt]);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (hit.length === 2)
|
|
226
|
+
out.push(hit[0], hit[1]);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return out;
|
|
230
|
+
}
|
|
231
|
+
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
|
|
232
|
+
* PLEXUS → points + links to near neighbours.
|
|
233
|
+
* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
|
|
234
|
+
export function plexus(geo, count, radiusMul, maxLinks = 6) {
|
|
235
|
+
const pts = surfaceScatter(geo, count);
|
|
236
|
+
const n = pts.length / 3;
|
|
237
|
+
const radius = radiusMul * bboxDiag(geo);
|
|
238
|
+
const r2 = radius * radius;
|
|
239
|
+
const cell = radius || 1;
|
|
240
|
+
const grid = new Map();
|
|
241
|
+
const key = (a, b, c) => `${a},${b},${c}`;
|
|
242
|
+
for (let i = 0; i < n; i++) {
|
|
243
|
+
const k = key(Math.floor(pts[i * 3] / cell), Math.floor(pts[i * 3 + 1] / cell), Math.floor(pts[i * 3 + 2] / cell));
|
|
244
|
+
(grid.get(k) ?? grid.set(k, []).get(k)).push(i);
|
|
245
|
+
}
|
|
246
|
+
const segments = [];
|
|
247
|
+
for (let i = 0; i < n; i++) {
|
|
248
|
+
const x = pts[i * 3], y = pts[i * 3 + 1], z = pts[i * 3 + 2];
|
|
249
|
+
const cx = Math.floor(x / cell), cy = Math.floor(y / cell), cz = Math.floor(z / cell);
|
|
250
|
+
let links = 0;
|
|
251
|
+
for (let dx = -1; dx <= 1 && links < maxLinks; dx++)
|
|
252
|
+
for (let dy = -1; dy <= 1 && links < maxLinks; dy++)
|
|
253
|
+
for (let dz = -1; dz <= 1 && links < maxLinks; dz++) {
|
|
254
|
+
const arr = grid.get(key(cx + dx, cy + dy, cz + dz));
|
|
255
|
+
if (!arr)
|
|
256
|
+
continue;
|
|
257
|
+
for (const j of arr) {
|
|
258
|
+
if (j <= i)
|
|
259
|
+
continue;
|
|
260
|
+
const ex = pts[j * 3] - x, ey = pts[j * 3 + 1] - y, ez = pts[j * 3 + 2] - z;
|
|
261
|
+
if (ex * ex + ey * ey + ez * ez < r2) {
|
|
262
|
+
segments.push([x, y, z], [pts[j * 3], pts[j * 3 + 1], pts[j * 3 + 2]]);
|
|
263
|
+
if (++links >= maxLinks)
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return { positions: pts, segments };
|
|
270
|
+
}
|
|
271
|
+
export function computeMode(geo, c) {
|
|
272
|
+
switch (c.mode) {
|
|
273
|
+
case 'volume': return { kind: 'points', positions: volumeFill(geo, c.count) };
|
|
274
|
+
case 'surface': return { kind: 'points', positions: surfaceScatter(geo, c.count) };
|
|
275
|
+
case 'symmetric': return { kind: 'points', positions: symmetricScatter(geo, c.count, c.symmetry) };
|
|
276
|
+
case 'evenScatter': return { kind: 'points', positions: evenScatter(geo, c.count, c.spacing) };
|
|
277
|
+
case 'vertices': return { kind: 'points', positions: meshVertices(geo) };
|
|
278
|
+
case 'edges3d': return { kind: 'lines', points: edges3D(geo, c.angle) };
|
|
279
|
+
case 'profile2d': return { kind: 'lines', points: contour2D(geo) };
|
|
280
|
+
case 'wireframe': return { kind: 'lines', points: wireframe(geo) };
|
|
281
|
+
case 'contourSlices': return { kind: 'lines', points: contourSlices(geo, c.slices) };
|
|
282
|
+
case 'plexus': {
|
|
283
|
+
const p = plexus(geo, Math.min(c.count, 2500), c.linkRadius);
|
|
284
|
+
return { kind: 'plexus', positions: p.positions, segments: p.segments };
|
|
285
|
+
}
|
|
286
|
+
case 'solid':
|
|
287
|
+
default: return { kind: 'mesh' };
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function useModeData(geometry, config) {
|
|
291
|
+
console.log('useModeData', config);
|
|
292
|
+
const key = [config.mode, config.count, config.symmetry, config.spacing, config.slices, config.linkRadius, config.angle].join('|');
|
|
293
|
+
return useMemo(() => computeMode(geometry, config), [geometry, key]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
294
|
+
}
|
|
295
|
+
const defaultModeConfig = { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 };
|
|
296
|
+
export function GeometryMesh({ config, materialSettings, animations, modeConfig = defaultModeConfig, color = '#ffffff', children }) {
|
|
297
|
+
const geometry = useShapeGeometry(config);
|
|
298
|
+
const data = useModeData(geometry, modeConfig);
|
|
299
|
+
// if (data.kind === 'points') return <PointCloud positions={data.positions} color={color} size={modeConfig.mode === 'vertices' ? 0.035 : 0.02} />;
|
|
300
|
+
if (data.kind === 'points')
|
|
301
|
+
return _jsx(PointCloud, { positions: data.positions, animations: animations, materialSettings: materialSettings });
|
|
302
|
+
if (data.kind === 'lines')
|
|
303
|
+
return data.points.length ? _jsx(Line, { points: data.points, segments: true, color: color, lineWidth: modeConfig.lineWidth }) : null;
|
|
304
|
+
if (data.kind === 'plexus')
|
|
305
|
+
return (_jsxs("group", { children: [_jsx(PointCloud, { positions: data.positions, animations: animations, materialSettings: materialSettings }), data.segments.length > 0 && _jsx(Line, { points: data.segments, segments: true, color: color, lineWidth: modeConfig.lineWidth, transparent: true, opacity: 0.45 })] }));
|
|
306
|
+
return (_jsx("mesh", { geometry: geometry, children: children ?? _jsx("meshPhongMaterial", { color: color, side: DoubleSide }) }));
|
|
307
|
+
}
|
|
308
|
+
/* ── Optional host-owned auto-fit (generators return raw geometry). ── */
|
|
309
|
+
export function FitGroup({ geometry, radius = 1.7, children }) {
|
|
310
|
+
const { scale, position } = useMemo(() => {
|
|
311
|
+
geometry.computeBoundingSphere();
|
|
312
|
+
const c = geometry.boundingSphere.center;
|
|
313
|
+
const r = geometry.boundingSphere.radius || 1;
|
|
314
|
+
const s = radius / r;
|
|
315
|
+
return { scale: s, position: [-c.x * s, -c.y * s, -c.z * s] };
|
|
316
|
+
}, [geometry, radius]);
|
|
317
|
+
return _jsx("group", { scale: scale, position: position, children: children });
|
|
318
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GlyphsConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface GlyphsProps {
|
|
4
|
+
config: GlyphsConfig;
|
|
5
|
+
boundingRadius?: number;
|
|
6
|
+
}
|
|
7
|
+
declare const Glyphs: React.FC<GlyphsProps>;
|
|
8
|
+
export default Glyphs;
|
|
9
|
+
//# sourceMappingURL=Glyphs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Glyphs.d.ts","sourceRoot":"","sources":["../../src/components/Glyphs.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAGD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmDjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { GlyphRingMaterial } from '@3driseai/3drise-core';
|
|
6
|
+
const Glyphs = ({ config, boundingRadius }) => {
|
|
7
|
+
// The ring sits at r=0.55 within UV space, so the plane must span 2 * ringRadius / 0.55
|
|
8
|
+
// for the ring's outer edge to land at the configured `ringRadius` in world units.
|
|
9
|
+
const planeSize = useMemo(() => {
|
|
10
|
+
const r = Math.max(0.05, (boundingRadius ?? config.ringRadius ?? 1) * 2);
|
|
11
|
+
return (2 * r) / 0.55;
|
|
12
|
+
}, [boundingRadius, config.ringRadius]);
|
|
13
|
+
console.log("Rendering Glyphs with config:", config, "and boundingRadius:", boundingRadius, "resulting in planeSize:", planeSize);
|
|
14
|
+
const geometry = useMemo(() => new THREE.PlaneGeometry(planeSize, planeSize, 1, 1), [planeSize]);
|
|
15
|
+
const material = useMemo(() => {
|
|
16
|
+
const m = new GlyphRingMaterial();
|
|
17
|
+
m.transparent = true;
|
|
18
|
+
m.depthWrite = false;
|
|
19
|
+
m.side = THREE.DoubleSide;
|
|
20
|
+
m.blending = THREE.AdditiveBlending;
|
|
21
|
+
return m;
|
|
22
|
+
}, []);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const u = material.uniforms;
|
|
25
|
+
u.uRingColor.value.set(config.ringColor ?? '#88ccff');
|
|
26
|
+
u.uGlyphsColor.value.set(config.glyphsColor ?? '#88ccff');
|
|
27
|
+
u.uShadesMultiplier.value = config.shadesMultiplier ?? 0.0;
|
|
28
|
+
u.uHoverColor.value.set(config.hoverColor ?? '#ffffff');
|
|
29
|
+
u.uHoverRadius.value = config.hoverRadius ?? 0.3;
|
|
30
|
+
u.uHoverIntensity.value = config.hoverIntensity ?? 0.0;
|
|
31
|
+
u.uGlyphCount.value = Math.max(3, config.glyphCount ?? 12);
|
|
32
|
+
u.uMorphSpeed.value = config.morphSpeed ?? 0.4;
|
|
33
|
+
u.uIntensity.value = config.intensity ?? 1.5;
|
|
34
|
+
u.uOpacity.value = config.opacity ?? 1.0;
|
|
35
|
+
}, [
|
|
36
|
+
config.ringColor,
|
|
37
|
+
config.glyphsColor,
|
|
38
|
+
config.shadesMultiplier,
|
|
39
|
+
config.hoverColor,
|
|
40
|
+
config.hoverRadius,
|
|
41
|
+
config.hoverIntensity,
|
|
42
|
+
config.glyphCount,
|
|
43
|
+
config.morphSpeed,
|
|
44
|
+
config.intensity,
|
|
45
|
+
config.opacity,
|
|
46
|
+
material,
|
|
47
|
+
]);
|
|
48
|
+
useEffect(() => () => { geometry.dispose(); material.dispose(); }, [geometry, material]);
|
|
49
|
+
useFrame((state, delta) => {
|
|
50
|
+
material.uniforms.uTime.value = state.clock.getElapsedTime();
|
|
51
|
+
const rotSpeed = config.rotationSpeed ?? 0.5;
|
|
52
|
+
material.uniforms.uRotation.value += delta * rotSpeed * 0.15;
|
|
53
|
+
});
|
|
54
|
+
if (!config.enabled)
|
|
55
|
+
return null;
|
|
56
|
+
return _jsx("mesh", { geometry: geometry, material: material, frustumCulled: false });
|
|
57
|
+
};
|
|
58
|
+
export default Glyphs;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface GridHelperProps {
|
|
4
|
+
cellSize?: number;
|
|
5
|
+
cellThickness?: number;
|
|
6
|
+
cellColor?: THREE.ColorRepresentation;
|
|
7
|
+
sectionSize?: number;
|
|
8
|
+
sectionThickness?: number;
|
|
9
|
+
sectionColor?: THREE.ColorRepresentation;
|
|
10
|
+
followCamera?: boolean;
|
|
11
|
+
infiniteGrid?: boolean;
|
|
12
|
+
fadeDistance?: number;
|
|
13
|
+
fadeStrength?: number;
|
|
14
|
+
fadeFrom?: number;
|
|
15
|
+
side?: THREE.Side;
|
|
16
|
+
position?: [number, number, number];
|
|
17
|
+
rotation?: [number, number, number];
|
|
18
|
+
visible?: boolean;
|
|
19
|
+
device?: 'desktop' | 'tablet' | 'mobile';
|
|
20
|
+
}
|
|
21
|
+
declare const GridHelper: React.FC<GridHelperProps>;
|
|
22
|
+
export default GridHelper;
|
|
23
|
+
//# sourceMappingURL=GridHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridHelper.d.ts","sourceRoot":"","sources":["../../src/components/GridHelper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IACzC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC5C;AAcD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmBzC,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo } from 'react';
|
|
3
|
+
import { Grid } from '@react-three/drei';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
const cleanColor = (color) => {
|
|
6
|
+
if (typeof color !== 'string')
|
|
7
|
+
return color;
|
|
8
|
+
if (color.length === 9 && color.startsWith('#'))
|
|
9
|
+
return color.slice(0, 7);
|
|
10
|
+
const rgba = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
11
|
+
if (rgba) {
|
|
12
|
+
return new THREE.Color(+rgba[1] / 255, +rgba[2] / 255, +rgba[3] / 255).convertSRGBToLinear();
|
|
13
|
+
}
|
|
14
|
+
return color;
|
|
15
|
+
};
|
|
16
|
+
const GridHelper = ({ cellSize = 1, cellThickness = 1, cellColor = '#000000', sectionSize = 10, sectionThickness = 1.5, sectionColor = '#000000', followCamera = false, infiniteGrid = true, fadeDistance = 30, fadeStrength = 1, fadeFrom = 0, side = THREE.DoubleSide, position = [0, 0, 0], rotation = [0, 0, 0], visible = true, device = 'desktop', }) => {
|
|
17
|
+
const gridRef = useRef(null);
|
|
18
|
+
const targetY = useRef(position[1]);
|
|
19
|
+
const responsiveScale = useMemo(() => {
|
|
20
|
+
if (device === 'mobile')
|
|
21
|
+
return [0.7, 0.7, 0.7];
|
|
22
|
+
if (device === 'tablet')
|
|
23
|
+
return [0.85, 0.85, 0.85];
|
|
24
|
+
return [1, 1, 1];
|
|
25
|
+
}, [device]);
|
|
26
|
+
// Animate Y position toward target (replaces GSAP fade-in/out)
|
|
27
|
+
// useFrame((_s, delta) => {
|
|
28
|
+
// if (!gridRef.current) return;
|
|
29
|
+
// targetY.current = visible ? position[1] : position[1] - 2;
|
|
30
|
+
// gridRef.current.position.y += (targetY.current - gridRef.current.position.y) * Math.min(delta * 4, 1);
|
|
31
|
+
// });
|
|
32
|
+
if (!visible)
|
|
33
|
+
return null;
|
|
34
|
+
return (_jsx(Grid, { ref: gridRef, cellSize: cellSize, cellThickness: cellThickness, cellColor: cleanColor(cellColor), sectionSize: sectionSize, sectionThickness: sectionThickness, sectionColor: cleanColor(sectionColor), followCamera: followCamera, infiniteGrid: infiniteGrid, fadeDistance: fadeDistance, fadeStrength: fadeStrength, fadeFrom: fadeFrom, side: side, position: position, rotation: rotation, scale: responsiveScale, castShadow: false, receiveShadow: false, userData: { id: '3drise-grid' } }));
|
|
35
|
+
};
|
|
36
|
+
export default GridHelper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { GridConfig, MyGridConfig } from "@3driseai/3drise-core";
|
|
3
|
+
type GridGeneratorProps = {
|
|
4
|
+
config: (GridConfig | MyGridConfig) & {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare const GridGenerator: React.FC<GridGeneratorProps>;
|
|
9
|
+
export default GridGenerator;
|
|
10
|
+
//# sourceMappingURL=GridsGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/GridsGenerator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACtE,KAAK,kBAAkB,GAAG;IACtB,MAAM,EAAE,CAAC,UAAU,GAAG,YAAY,CAAC,GAAG;QAClC,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;CACL,CAAC;AAGF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAS/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import GridHelper from "./GridHelper.js";
|
|
3
|
+
import { MyGrid } from "./MyGrid.js";
|
|
4
|
+
const GridGenerator = ({ config }) => {
|
|
5
|
+
switch (config.type) {
|
|
6
|
+
case "basic":
|
|
7
|
+
return _jsx(GridHelper, { ...config, side: 2 });
|
|
8
|
+
case "superGrid":
|
|
9
|
+
return _jsx(MyGrid, { config: config });
|
|
10
|
+
default:
|
|
11
|
+
return _jsx("gridHelper", { ...config });
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export default GridGenerator;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HdrTransitionSettings } from "@3driseai/3drise-core";
|
|
2
|
+
export interface HdrPlaylistRendererProps {
|
|
3
|
+
/** Two or more equirect HDR URLs to cycle through. Caller ensures length >= 2. */
|
|
4
|
+
urls: string[];
|
|
5
|
+
/** Fully resolved transition settings (defaults already merged). */
|
|
6
|
+
transition: HdrTransitionSettings;
|
|
7
|
+
}
|
|
8
|
+
declare const HdrPlaylistRenderer: React.FC<HdrPlaylistRendererProps>;
|
|
9
|
+
export default HdrPlaylistRenderer;
|
|
10
|
+
//# sourceMappingURL=HdrPlaylistRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HdrPlaylistRenderer.d.ts","sourceRoot":"","sources":["../../src/components/HdrPlaylistRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,MAAM,WAAW,wBAAwB;IACrC,kFAAkF;IAClF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,oEAAoE;IACpE,UAAU,EAAE,qBAAqB,CAAC;CACrC;AAwJD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA+M3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|