@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,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import Letter from './Letter.js';
|
|
4
|
+
export default function Letters({ text, config, materialSettings, hoverSettings, transformEffects = [], colorEffects = [], onLetterClick, }) {
|
|
5
|
+
const ref = useRef(null);
|
|
6
|
+
const characters = text.split('');
|
|
7
|
+
const letterSpacing = config.letterSpacing || 0;
|
|
8
|
+
const spacing = 0.6 + letterSpacing;
|
|
9
|
+
const letters = characters.map((char, index) => {
|
|
10
|
+
const totalWidth = (characters.length - 1) * spacing;
|
|
11
|
+
const xOffset = index * spacing - totalWidth / 2;
|
|
12
|
+
return { char, index, position: [xOffset, 0, 0] };
|
|
13
|
+
});
|
|
14
|
+
const handleLetterClick = (object, letterData) => {
|
|
15
|
+
onLetterClick?.(letterData);
|
|
16
|
+
};
|
|
17
|
+
return (_jsx("group", { ref: ref, scale: [1, 1, 1], position: [0, 0, 0], rotation: [0, 0, 0], children: letters.map((letterData) => (_jsx(Letter, { letterData: letterData, config: config, materialSettings: materialSettings, hoverSettings: hoverSettings, transformEffects: transformEffects, colorEffects: colorEffects, isActive: false, onClick: (object) => handleLetterClick(object, letterData) }, `${letterData.char}-${letterData.index}`))) }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CreatedObjectSettings } from "@3driseai/3drise-core";
|
|
3
|
+
type LightObjectProps = {
|
|
4
|
+
createdObject: CreatedObjectSettings;
|
|
5
|
+
};
|
|
6
|
+
declare const LightObject: React.FC<LightObjectProps>;
|
|
7
|
+
export default LightObject;
|
|
8
|
+
//# sourceMappingURL=LightObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightObject.d.ts","sourceRoot":"","sources":["../../src/components/LightObject.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,KAAK,gBAAgB,GAAG;IACpB,aAAa,EAAE,qBAAqB,CAAC;CACxC,CAAC;AA4CF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAgB3C,CAAC;AACF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { useThree } from '@react-three/fiber';
|
|
4
|
+
import { useLightShadow } from '../hooks/useLightShadow.js';
|
|
5
|
+
import { useLightAnimation } from '../hooks/useLightAnimation.js';
|
|
6
|
+
import { useLightMouseMove } from '../hooks/useLightMouseMove.js';
|
|
7
|
+
const DirectionalLightR3F = ({ config, animations, mouseMove }) => {
|
|
8
|
+
const lightRef = useRef(null);
|
|
9
|
+
useLightShadow(lightRef, config.shadow);
|
|
10
|
+
useLightAnimation(lightRef, animations);
|
|
11
|
+
useLightMouseMove(lightRef, mouseMove, { lightConfig: config });
|
|
12
|
+
return (_jsx("directionalLight", { ref: lightRef, color: config.color || '#ffffff', intensity: config.intensity ?? 1 }));
|
|
13
|
+
};
|
|
14
|
+
const SpotLightR3F = ({ config, animations, mouseMove }) => {
|
|
15
|
+
const { scene } = useThree();
|
|
16
|
+
const lightRef = useRef(null);
|
|
17
|
+
const targetRef = useRef(null);
|
|
18
|
+
const [tx, ty, tz] = config.targetPosition ?? [0, 0, 0];
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const light = lightRef.current;
|
|
21
|
+
if (!light)
|
|
22
|
+
return;
|
|
23
|
+
if (!targetRef.current) {
|
|
24
|
+
targetRef.current = light.target;
|
|
25
|
+
scene.add(targetRef.current);
|
|
26
|
+
}
|
|
27
|
+
targetRef.current.position.set(tx, ty, tz);
|
|
28
|
+
targetRef.current.updateMatrixWorld();
|
|
29
|
+
return () => {
|
|
30
|
+
if (targetRef.current) {
|
|
31
|
+
scene.remove(targetRef.current);
|
|
32
|
+
targetRef.current = null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}, [scene, tx, ty, tz]);
|
|
36
|
+
useLightShadow(lightRef, config.shadow);
|
|
37
|
+
useLightAnimation(lightRef, animations);
|
|
38
|
+
useLightMouseMove(lightRef, mouseMove, { lightConfig: config });
|
|
39
|
+
return (_jsx("spotLight", { ref: lightRef, color: config.color || '#ffffff', intensity: config.intensity ?? 1, angle: config.angle ?? Math.PI / 4, penumbra: config.penumbra ?? 0.1, decay: config.decay ?? 1, distance: config.distance ?? 0 }));
|
|
40
|
+
};
|
|
41
|
+
const PointLightR3F = ({ config, animations, mouseMove }) => {
|
|
42
|
+
const lightRef = useRef(null);
|
|
43
|
+
useLightShadow(lightRef, config.shadow);
|
|
44
|
+
useLightAnimation(lightRef, animations);
|
|
45
|
+
useLightMouseMove(lightRef, mouseMove, { lightConfig: config });
|
|
46
|
+
return (_jsx("pointLight", { ref: lightRef, color: config.color || '#ffffff', intensity: config.intensity ?? 1, decay: config.decay ?? 1, distance: config.distance ?? 0 }));
|
|
47
|
+
};
|
|
48
|
+
const LightObject = ({ createdObject }) => {
|
|
49
|
+
const config = createdObject.config;
|
|
50
|
+
if (!config || config.enabled === false)
|
|
51
|
+
return null;
|
|
52
|
+
const animations = createdObject.animations?.light?.animations;
|
|
53
|
+
const mouseMove = createdObject.mouseMove?.light;
|
|
54
|
+
switch (config.type) {
|
|
55
|
+
case 'directional':
|
|
56
|
+
return _jsx(DirectionalLightR3F, { config: config, animations: animations, mouseMove: mouseMove });
|
|
57
|
+
case 'spot':
|
|
58
|
+
return _jsx(SpotLightR3F, { config: config, animations: animations, mouseMove: mouseMove });
|
|
59
|
+
case 'point':
|
|
60
|
+
return _jsx(PointLightR3F, { config: config, animations: animations, mouseMove: mouseMove });
|
|
61
|
+
default:
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export default LightObject;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SceneLightConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface LightsManagerProps {
|
|
4
|
+
config: SceneLightConfig;
|
|
5
|
+
}
|
|
6
|
+
declare const LightsManager: React.FC<LightsManagerProps>;
|
|
7
|
+
export default LightsManager;
|
|
8
|
+
//# sourceMappingURL=LightsManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightsManager.d.ts","sourceRoot":"","sources":["../../src/components/LightsManager.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,gBAAgB,CAAC;CAC5B;AAID,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+F/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
import { useFrame, useThree } from '@react-three/fiber';
|
|
4
|
+
import { createSunPosition } from '@3driseai/3drise-core';
|
|
5
|
+
import { Color, } from 'three';
|
|
6
|
+
import { useLightAnimation } from '../hooks/useLightAnimation.js';
|
|
7
|
+
const SUN_DISTANCE = 100;
|
|
8
|
+
const LightsManager = ({ config }) => {
|
|
9
|
+
const { scene } = useThree();
|
|
10
|
+
const ambientLightRef = useRef(null);
|
|
11
|
+
const sunLightRef = useRef(null);
|
|
12
|
+
const ambientConfig = config.ambient;
|
|
13
|
+
const sunConfig = config.sun;
|
|
14
|
+
const followSun = config.followSun;
|
|
15
|
+
const handleAmbientLightChange = () => {
|
|
16
|
+
if (ambientLightRef.current && ambientConfig && ambientConfig.color) {
|
|
17
|
+
const light = ambientLightRef.current;
|
|
18
|
+
light.color = new Color(ambientConfig.color);
|
|
19
|
+
light.intensity = ambientConfig.intensity || 1;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const handleSunLightChange = () => {
|
|
23
|
+
const light = sunLightRef.current;
|
|
24
|
+
if (!light)
|
|
25
|
+
return;
|
|
26
|
+
const elevation = sunConfig?.elevation ?? 45;
|
|
27
|
+
const azimuth = sunConfig?.azimuth ?? -90;
|
|
28
|
+
const sunPos = createSunPosition(elevation, azimuth);
|
|
29
|
+
light.position.set(sunPos.x * SUN_DISTANCE, sunPos.y * SUN_DISTANCE, sunPos.z * SUN_DISTANCE);
|
|
30
|
+
light.target.position.set(0, 0, 0);
|
|
31
|
+
light.target.updateMatrixWorld();
|
|
32
|
+
light.color = new Color(sunConfig?.color || '#ffffff');
|
|
33
|
+
light.intensity = sunConfig?.intensity ?? 1;
|
|
34
|
+
const shadow = sunConfig?.shadow;
|
|
35
|
+
// undefined shadow.enabled → treat as on; only an explicit `false` disables.
|
|
36
|
+
const shadowsEnabled = (shadow?.enabled ?? true) && (config.enableShadows ?? true);
|
|
37
|
+
light.castShadow = shadowsEnabled;
|
|
38
|
+
if (shadow) {
|
|
39
|
+
if (shadow.mapSize !== undefined) {
|
|
40
|
+
const previousMapSize = light.shadow.mapSize.x;
|
|
41
|
+
light.shadow.mapSize.set(shadow.mapSize, shadow.mapSize);
|
|
42
|
+
// Force the renderer to recreate the shadow map texture when size changes
|
|
43
|
+
if (previousMapSize !== shadow.mapSize && light.shadow.map) {
|
|
44
|
+
light.shadow.map.dispose();
|
|
45
|
+
light.shadow.map = null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (shadow.bias !== undefined)
|
|
49
|
+
light.shadow.bias = shadow.bias;
|
|
50
|
+
if (shadow.normalBias !== undefined)
|
|
51
|
+
light.shadow.normalBias = shadow.normalBias;
|
|
52
|
+
if (shadow.radius !== undefined)
|
|
53
|
+
light.shadow.radius = shadow.radius;
|
|
54
|
+
if (shadow.intensity !== undefined)
|
|
55
|
+
light.shadow.intensity = shadow.intensity;
|
|
56
|
+
const cam = light.shadow.camera;
|
|
57
|
+
if (shadow.cameraNear !== undefined)
|
|
58
|
+
cam.near = shadow.cameraNear;
|
|
59
|
+
if (shadow.cameraFar !== undefined)
|
|
60
|
+
cam.far = shadow.cameraFar;
|
|
61
|
+
if (shadow.cameraLeft !== undefined)
|
|
62
|
+
cam.left = shadow.cameraLeft;
|
|
63
|
+
if (shadow.cameraRight !== undefined)
|
|
64
|
+
cam.right = shadow.cameraRight;
|
|
65
|
+
if (shadow.cameraTop !== undefined)
|
|
66
|
+
cam.top = shadow.cameraTop;
|
|
67
|
+
if (shadow.cameraBottom !== undefined)
|
|
68
|
+
cam.bottom = shadow.cameraBottom;
|
|
69
|
+
cam.updateProjectionMatrix();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
handleAmbientLightChange();
|
|
74
|
+
}, [ambientConfig]);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
handleSunLightChange();
|
|
77
|
+
}, [sunConfig]);
|
|
78
|
+
// Drive keyframe animations stored on ambient / sun configs. These arrays are
|
|
79
|
+
// populated by the per-light Animation tab in LightSettings.
|
|
80
|
+
useLightAnimation(ambientLightRef, ambientConfig?.animations);
|
|
81
|
+
useLightAnimation(sunLightRef, sunConfig?.animations);
|
|
82
|
+
// directionalLight needs its target object in the scene
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
const light = sunLightRef.current;
|
|
85
|
+
if (!light)
|
|
86
|
+
return;
|
|
87
|
+
scene.add(light.target);
|
|
88
|
+
return () => {
|
|
89
|
+
scene.remove(light.target);
|
|
90
|
+
};
|
|
91
|
+
}, [scene]);
|
|
92
|
+
useFrame((state) => {
|
|
93
|
+
if (followSun && sunLightRef.current) {
|
|
94
|
+
const time = state.clock.getElapsedTime();
|
|
95
|
+
const slowRotation = time * 0.01;
|
|
96
|
+
const dynamicElevation = sunConfig?.elevation || 45;
|
|
97
|
+
const dynamicAzimuth = (sunConfig?.azimuth || -90) + slowRotation;
|
|
98
|
+
const sunPosition = createSunPosition(dynamicElevation, dynamicAzimuth);
|
|
99
|
+
sunLightRef.current.position.set(sunPosition.x * SUN_DISTANCE, sunPosition.y * SUN_DISTANCE, sunPosition.z * SUN_DISTANCE);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return (_jsxs(_Fragment, { children: [_jsx("ambientLight", { ref: ambientLightRef, color: ambientConfig?.color, intensity: ambientConfig?.intensity, visible: ambientConfig?.enabled }), _jsx("directionalLight", { visible: sunConfig?.enabled, ref: sunLightRef, color: sunConfig?.color || '#ffffff', intensity: sunConfig?.intensity ?? 1, castShadow: config.enableShadows ?? true })] }));
|
|
103
|
+
};
|
|
104
|
+
export default LightsManager;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ParticlesSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface LinesProps {
|
|
4
|
+
createdObject: ParticlesSettings;
|
|
5
|
+
transitionSettings?: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
declare const Lines: React.FC<LinesProps>;
|
|
8
|
+
export default Lines;
|
|
9
|
+
//# sourceMappingURL=Lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lines.d.ts","sourceRoot":"","sources":["../../src/components/Lines.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,UAAU;IAChB,aAAa,EAAE,iBAAiB,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5C;AAGD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAa/B,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { PositionsCreator } from '@3driseai/3drise-core';
|
|
4
|
+
import Path from './Path.js';
|
|
5
|
+
const Lines = ({ createdObject, transitionSettings }) => {
|
|
6
|
+
if (!createdObject)
|
|
7
|
+
return null;
|
|
8
|
+
const { config } = createdObject;
|
|
9
|
+
const color = createdObject.materialSettings && 'color' in createdObject.materialSettings
|
|
10
|
+
? createdObject.materialSettings.color
|
|
11
|
+
: '#ffffff';
|
|
12
|
+
const targetShape = (transitionSettings?.shapeType && typeof transitionSettings.shapeType === 'string')
|
|
13
|
+
? transitionSettings.shapeType
|
|
14
|
+
: config.shapeType;
|
|
15
|
+
const curves = useMemo(() => PositionsCreator.generatePaths(config.shapeType), [config.shapeType]);
|
|
16
|
+
const targetCurves = useMemo(() => PositionsCreator.generatePaths(targetShape), [targetShape]);
|
|
17
|
+
return (_jsx(_Fragment, { children: curves.map((currentCurve, index) => (_jsx(Path, { curve: currentCurve, targetCurve: targetCurves[index % targetCurves.length], duration: 1, color: color }, `path-${index}`))) }));
|
|
18
|
+
};
|
|
19
|
+
export default Lines;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface LoadingIndicatorProps {
|
|
3
|
+
text?: string;
|
|
4
|
+
fullScreen?: boolean;
|
|
5
|
+
animate?: boolean;
|
|
6
|
+
size?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const LoadingIndicator: React.FC<LoadingIndicatorProps>;
|
|
9
|
+
export default LoadingIndicator;
|
|
10
|
+
//# sourceMappingURL=LoadingIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/LoadingIndicator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,qBAAqB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAErD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import RiseLogo from './RiseLogo.js';
|
|
3
|
+
const LoadingIndicator = ({ text, fullScreen = false, animate = true, size = 80, }) => {
|
|
4
|
+
return (_jsxs(_Fragment, { children: [text && _jsx("div", { className: "loading-text", children: text }), _jsx(RiseLogo, { size: size, animated: animate, loop: true })] }));
|
|
5
|
+
};
|
|
6
|
+
export default LoadingIndicator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MaterialSettings } from "@3driseai/3drise-core";
|
|
3
|
+
export interface MaterialLibraryProps {
|
|
4
|
+
materialSettings: MaterialSettings;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const MaterialLibrary: React.FC<MaterialLibraryProps>;
|
|
8
|
+
export default MaterialLibrary;
|
|
9
|
+
//# sourceMappingURL=MaterialLibrary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialLibrary.d.ts","sourceRoot":"","sources":["../../src/components/MaterialLibrary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,MAAM,WAAW,oBAAoB;IACjC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAGD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoDnD,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { MeshReflectorMaterial, MeshRefractionMaterial, MeshTransmissionMaterial, MeshDistortMaterial, MeshWobbleMaterial, MeshDiscardMaterial, MeshPortalMaterial, } from '@react-three/drei';
|
|
4
|
+
const MaterialLibrary = ({ materialSettings }) => {
|
|
5
|
+
const variant = materialSettings.materialVariant;
|
|
6
|
+
const cubeCameraTexture = useRef(null);
|
|
7
|
+
const getSettings = (defaultSettings) => {
|
|
8
|
+
const settings = { ...defaultSettings };
|
|
9
|
+
Object.keys(materialSettings).forEach(key => {
|
|
10
|
+
if (key in settings && key !== 'materialType' && key !== 'materialVariant' && key !== 'handlers') {
|
|
11
|
+
settings[key] = materialSettings[key];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return settings;
|
|
15
|
+
};
|
|
16
|
+
switch (variant) {
|
|
17
|
+
case 'Reflector':
|
|
18
|
+
return _jsx(MeshReflectorMaterial, { ...getSettings({
|
|
19
|
+
color: "#777777", roughness: 0.1, metalness: 1.0,
|
|
20
|
+
blur: [300, 100], resolution: 512, mixBlur: 1, mixStrength: 40,
|
|
21
|
+
depthScale: 1, minDepthThreshold: 0.1, maxDepthThreshold: 1,
|
|
22
|
+
depthToBlurRatioBias: 0.25, mirror: 1, distortion: 1, mixContrast: 1,
|
|
23
|
+
...materialSettings,
|
|
24
|
+
}) });
|
|
25
|
+
case 'Refraction':
|
|
26
|
+
if (cubeCameraTexture.current)
|
|
27
|
+
return _jsx(MeshRefractionMaterial, { envMap: cubeCameraTexture.current, ...getSettings({
|
|
28
|
+
color: "#ffffff", ior: 2.4, fresnel: 0, aberrationStrength: 0.01, fastChroma: true, ...materialSettings,
|
|
29
|
+
}) });
|
|
30
|
+
return _jsx("meshStandardMaterial", { color: "#ffffff" });
|
|
31
|
+
case 'Transmission':
|
|
32
|
+
return _jsx(MeshTransmissionMaterial, { ...getSettings({
|
|
33
|
+
transmission: 1, thickness: 0.2, roughness: 0.0, chromaticAberration: 0.03,
|
|
34
|
+
anisotropy: 0.1, anisotropicBlur: 0.1, distortion: 0.0, distortionScale: 0.3,
|
|
35
|
+
temporalDistortion: 0.5, transmissionSampler: true, backside: false,
|
|
36
|
+
backsideThickness: 0.2, backsideEnvMapIntensity: 1, resolution: 256,
|
|
37
|
+
backsideResolution: 256, samples: 10, ...materialSettings,
|
|
38
|
+
}) });
|
|
39
|
+
case 'Distort':
|
|
40
|
+
return _jsx(MeshDistortMaterial, { ...getSettings({
|
|
41
|
+
color: "#ffffff", distort: 0.5, speed: 2, radius: 1, ...materialSettings,
|
|
42
|
+
}) });
|
|
43
|
+
case 'Wobble':
|
|
44
|
+
return _jsx(MeshWobbleMaterial, { ...getSettings({
|
|
45
|
+
color: "#ffffff", factor: 1, speed: 2, ...materialSettings,
|
|
46
|
+
}) });
|
|
47
|
+
case 'Discard':
|
|
48
|
+
return _jsx(MeshDiscardMaterial, {});
|
|
49
|
+
case 'Portal':
|
|
50
|
+
return _jsx(MeshPortalMaterial, { blur: 0, resolution: 512, ...getSettings({
|
|
51
|
+
blend: 1, resolution: 512, ...materialSettings,
|
|
52
|
+
}) });
|
|
53
|
+
default:
|
|
54
|
+
return _jsx("meshStandardMaterial", { color: "#ffffff" });
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export default MaterialLibrary;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Mesh } from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { MoonSettings } from "@3driseai/3drise-core";
|
|
4
|
+
export interface MoonProps {
|
|
5
|
+
settings?: MoonSettings;
|
|
6
|
+
sunPosition?: [number, number, number];
|
|
7
|
+
onMeshReady?: (mesh: Mesh) => void;
|
|
8
|
+
}
|
|
9
|
+
export type { MoonSettings };
|
|
10
|
+
export { defaultMoonSettings } from '@3driseai/3drise-core';
|
|
11
|
+
declare const Moon: React.FC<MoonProps>;
|
|
12
|
+
export default Moon;
|
|
13
|
+
//# sourceMappingURL=Moon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Moon.d.ts","sourceRoot":"","sources":["../../src/components/Moon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACtC;AAED,YAAY,EAAE,YAAY,EAAE,CAAC;AAG7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAyD7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect, useState, useCallback } from 'react';
|
|
3
|
+
import { TextureLoader, Vector3 } from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
export { defaultMoonSettings } from '@3driseai/3drise-core';
|
|
6
|
+
const MOON_TEXTURE_URL = "https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/moon_1024.jpg";
|
|
7
|
+
const Moon = ({ settings, sunPosition, onMeshReady }) => {
|
|
8
|
+
const meshRef = useRef(null);
|
|
9
|
+
const lightRef = useRef(null);
|
|
10
|
+
const targetRef = useRef(null);
|
|
11
|
+
const [texture, setTexture] = useState(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const loader = new TextureLoader();
|
|
14
|
+
loader.setCrossOrigin('anonymous');
|
|
15
|
+
let cancelled = false;
|
|
16
|
+
loader.load(MOON_TEXTURE_URL, (loaded) => {
|
|
17
|
+
console.log("Moon texture loaded:", loaded);
|
|
18
|
+
if (!cancelled)
|
|
19
|
+
setTexture(loaded);
|
|
20
|
+
}, undefined, () => {
|
|
21
|
+
// Silently ignore — moon renders as a plain lit sphere if the texture fails.
|
|
22
|
+
});
|
|
23
|
+
return () => {
|
|
24
|
+
cancelled = true;
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
27
|
+
const s = settings ?? {
|
|
28
|
+
visible: true,
|
|
29
|
+
position: [0, 0, 0],
|
|
30
|
+
scale: 3,
|
|
31
|
+
rotation: [0, 0, 0.5],
|
|
32
|
+
emissiveIntensity: 0.3,
|
|
33
|
+
orbitRadius: 250,
|
|
34
|
+
enableOrbit: false,
|
|
35
|
+
orbitSpeed: 0.1,
|
|
36
|
+
};
|
|
37
|
+
const handleMeshRef = useCallback((mesh) => {
|
|
38
|
+
if (mesh) {
|
|
39
|
+
meshRef.current = mesh;
|
|
40
|
+
onMeshReady?.(mesh);
|
|
41
|
+
}
|
|
42
|
+
}, [onMeshReady]);
|
|
43
|
+
useFrame((state) => {
|
|
44
|
+
const moonPos = sunPosition ?? s.position;
|
|
45
|
+
if (meshRef.current && s.enableOrbit) {
|
|
46
|
+
const time = state.clock.getElapsedTime();
|
|
47
|
+
const speed = s.orbitSpeed ?? 0.1;
|
|
48
|
+
const radius = s.orbitRadius ?? 250;
|
|
49
|
+
meshRef.current.position.x = Math.cos(time * speed) * radius;
|
|
50
|
+
meshRef.current.position.z = Math.sin(time * speed) * radius;
|
|
51
|
+
meshRef.current.rotation.y += 0.001;
|
|
52
|
+
}
|
|
53
|
+
if (lightRef.current && targetRef.current) {
|
|
54
|
+
const cameraPos = state.camera.position;
|
|
55
|
+
const moonPosition = meshRef.current?.position ?? new Vector3(...moonPos);
|
|
56
|
+
const dirToMoon = new Vector3().subVectors(moonPosition, cameraPos).normalize();
|
|
57
|
+
const dist = cameraPos.distanceTo(moonPosition) * 0.2;
|
|
58
|
+
lightRef.current.position.copy(cameraPos).addScaledVector(dirToMoon, dist);
|
|
59
|
+
targetRef.current.position.copy(moonPosition);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const moonPos = sunPosition ?? s.position;
|
|
63
|
+
return (_jsxs("group", { userData: { id: '3drise-moon' }, children: [_jsx("object3D", { ref: targetRef, position: moonPos }), _jsx("directionalLight", { ref: lightRef, intensity: 2, color: 0xffffff, target: targetRef.current ?? undefined }), _jsxs("mesh", { ref: handleMeshRef, position: moonPos, rotation: s.rotation, scale: s.scale, visible: s.visible, children: [_jsx("sphereGeometry", { args: [1, 32, 32] }), _jsx("meshPhongMaterial", { color: 0xb2b2b2, normalMap: texture, shininess: 0 })] })] }));
|
|
64
|
+
};
|
|
65
|
+
Moon.displayName = 'Moon';
|
|
66
|
+
export default Moon;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ThreeElements } from '@react-three/fiber';
|
|
2
|
+
import type { MyGridConfig } from '@3driseai/3drise-core';
|
|
3
|
+
export interface MyGridProps {
|
|
4
|
+
config?: MyGridConfig;
|
|
5
|
+
groupProps?: ThreeElements['group'];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* MyGridConfig — the single source of truth for a grid instance.
|
|
9
|
+
* Colors are hex strings so they round-trip cleanly through the controller
|
|
10
|
+
* and any preset/serialization layer.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultMyGridConfig: MyGridConfig;
|
|
13
|
+
export declare function MyGrid({ config, groupProps }: MyGridProps): import("react").JSX.Element;
|
|
14
|
+
export default MyGrid;
|
|
15
|
+
//# sourceMappingURL=MyGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MyGrid.d.ts","sourceRoot":"","sources":["../../src/components/MyGrid.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,WAAW;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC;AAID;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAuBjC,CAAC;AACF,wBAAgB,MAAM,CAAC,EAAE,MAA4B,EAAE,UAAU,EAAE,EAAE,WAAW,+BAkC/E;AACD,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { MyGridMaterial, } from '@3driseai/3drise-core';
|
|
6
|
+
// Side-effect import registers <myGridMaterial> via extend() in MyGridMaterial.ts.
|
|
7
|
+
void MyGridMaterial;
|
|
8
|
+
/**
|
|
9
|
+
* MyGridConfig — the single source of truth for a grid instance.
|
|
10
|
+
* Colors are hex strings so they round-trip cleanly through the controller
|
|
11
|
+
* and any preset/serialization layer.
|
|
12
|
+
*/
|
|
13
|
+
export const defaultMyGridConfig = {
|
|
14
|
+
cellSize: 1,
|
|
15
|
+
size: 50,
|
|
16
|
+
segments: undefined,
|
|
17
|
+
flat: true,
|
|
18
|
+
lineMode: 2, // flow
|
|
19
|
+
cellMode: 2, // twinkle
|
|
20
|
+
lineWidth: 1,
|
|
21
|
+
sectionSize: 5,
|
|
22
|
+
sectionWidth: 1.6,
|
|
23
|
+
animSpeed: 1,
|
|
24
|
+
animScale: 0.5,
|
|
25
|
+
animIntensity: 1,
|
|
26
|
+
fadeDistance: undefined,
|
|
27
|
+
fadeStrength: 0.65,
|
|
28
|
+
displace: 0,
|
|
29
|
+
lineColor: '#477fb8',
|
|
30
|
+
sectionColor: '#80c7ff',
|
|
31
|
+
cellColor: '#1a5999',
|
|
32
|
+
glowColor: '#339eff',
|
|
33
|
+
bgColor: '#05080d',
|
|
34
|
+
bgOpacity: 0,
|
|
35
|
+
followMouse: false,
|
|
36
|
+
};
|
|
37
|
+
export function MyGrid({ config = defaultMyGridConfig, groupProps }) {
|
|
38
|
+
const matRef = useRef(null);
|
|
39
|
+
const meshRef = useRef(null);
|
|
40
|
+
const { cellSize, size, segments, flat, lineMode, cellMode, lineWidth, sectionSize, sectionWidth, animSpeed, animScale, animIntensity, fadeDistance, fadeStrength, displace, lineColor, sectionColor, cellColor, glowColor, bgColor, bgOpacity, followMouse, } = config;
|
|
41
|
+
const segs = segments ?? (displace > 0 ? Math.max(64, Math.ceil(size / cellSize) * 2) : 1);
|
|
42
|
+
const fade = fadeDistance ?? size * 0.5;
|
|
43
|
+
// memoize Color objects so we only re-allocate when the hex actually changes
|
|
44
|
+
const colors = useMemo(() => ({
|
|
45
|
+
line: new THREE.Color(lineColor),
|
|
46
|
+
section: new THREE.Color(sectionColor),
|
|
47
|
+
cell: new THREE.Color(cellColor),
|
|
48
|
+
glow: new THREE.Color(glowColor),
|
|
49
|
+
bg: new THREE.Color(bgColor),
|
|
50
|
+
}), [lineColor, sectionColor, cellColor, glowColor, bgColor]);
|
|
51
|
+
// scratch objects for mouse → plane projection
|
|
52
|
+
const ray = useMemo(() => new THREE.Raycaster(), []);
|
|
53
|
+
const plane = useMemo(() => new THREE.Plane(new THREE.Vector3(0, 1, 0), 0), []);
|
|
54
|
+
const hit = useMemo(() => new THREE.Vector3(), []);
|
|
55
|
+
useFrame((state) => {
|
|
56
|
+
const m = matRef.current;
|
|
57
|
+
if (!m)
|
|
58
|
+
return;
|
|
59
|
+
m.u_time = state.clock.elapsedTime;
|
|
60
|
+
m.u_mouse.copy(state.pointer); // NDC Vector2 — convention
|
|
61
|
+
if (followMouse && meshRef.current) {
|
|
62
|
+
ray.setFromCamera(state.pointer, state.camera);
|
|
63
|
+
plane.normal.set(0, 1, 0);
|
|
64
|
+
if (ray.ray.intersectPlane(plane, hit)) {
|
|
65
|
+
meshRef.current.worldToLocal(hit); // works regardless of host transform
|
|
66
|
+
m.u_focus.set(hit.x, hit.y);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return (_jsx("group", { ...groupProps, children: _jsxs("mesh", { ref: meshRef, rotation: flat ? [-Math.PI / 2, 0, 0] : [0, 0, 0], children: [_jsx("planeGeometry", { args: [size, size, segs, segs] }), _jsx("myGridMaterial", { ref: matRef, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, side: THREE.DoubleSide, u_cellSize: cellSize, u_lineWidth: lineWidth, u_sectionSize: sectionSize, u_sectionWidth: sectionWidth, u_lineMode: lineMode, u_cellMode: cellMode, u_animSpeed: animSpeed, u_animScale: animScale, u_animIntensity: animIntensity, u_fadeDistance: fade, u_fadeStrength: fadeStrength, u_displace: displace, u_lineColor: colors.line, u_sectionColor: colors.section, u_cellColor: colors.cell, u_glowColor: colors.glow, u_bgColor: colors.bg, u_bgOpacity: bgOpacity }, MyGridMaterial.key)] }) }));
|
|
71
|
+
}
|
|
72
|
+
export default MyGrid;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Object3D } from "three";
|
|
3
|
+
import type { CameraState, CreatedObjectSettings, ObjectTreeNode } from "@3driseai/3drise-core";
|
|
4
|
+
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
|
+
type ObjectNodeProps = {
|
|
6
|
+
node: ObjectTreeNode;
|
|
7
|
+
cameraSettings: CameraState;
|
|
8
|
+
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
9
|
+
handleObjectClick?: (object: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const ObjectNode: React.FC<ObjectNodeProps>;
|
|
12
|
+
export default ObjectNode;
|
|
13
|
+
//# sourceMappingURL=ObjectNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AA8BF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+FzC,CAAC;AACF,eAAe,UAAU,CAAC"}
|