@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,278 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useCallback } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useThree, useFrame } from '@react-three/fiber';
|
|
5
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
6
|
+
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
7
|
+
import { useNumericAnimation } from '../hooks/useNumericAnimation.js';
|
|
8
|
+
import { calculateTimeProgress, applyEasing, gsapEasingMap, interpolateValue, interpolateMouseMoveProperty, } from '@3driseai/3drise-core';
|
|
9
|
+
const CLOUD_COLORS = {
|
|
10
|
+
night: new THREE.Color(0.1, 0.1, 0.2),
|
|
11
|
+
sunrise: new THREE.Color(0.8, 0.4, 0.4),
|
|
12
|
+
midday: new THREE.Color(1.0, 1.0, 1.0),
|
|
13
|
+
sunset: new THREE.Color(0.8, 0.3, 0.3),
|
|
14
|
+
};
|
|
15
|
+
const DEFAULT_MATERIAL = {
|
|
16
|
+
materialType: 'clouds',
|
|
17
|
+
materialVariant: 'Sky Clouds Bright',
|
|
18
|
+
u_time: 0,
|
|
19
|
+
u_resolution: [800, 600],
|
|
20
|
+
u_cameraPos: [0, 0, 0],
|
|
21
|
+
u_cloudColor: [1.0, 1.0, 1.0],
|
|
22
|
+
};
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Per-domain helpers (clouds-specific writes for the `clouds` domain)
|
|
25
|
+
// =============================================================================
|
|
26
|
+
function applyCloudsKeyframeAnimations(animations, startValuesCache, config, override, currentTime) {
|
|
27
|
+
if (!animations?.length)
|
|
28
|
+
return;
|
|
29
|
+
override.speed = undefined; // reset before each pass
|
|
30
|
+
for (const anim of animations) {
|
|
31
|
+
const { property, to, duration, ease, loop = false, yoyo = false, active } = anim;
|
|
32
|
+
if (!active || to === undefined)
|
|
33
|
+
continue;
|
|
34
|
+
if (property !== 'speed')
|
|
35
|
+
continue;
|
|
36
|
+
let from = anim.from;
|
|
37
|
+
if (from === undefined) {
|
|
38
|
+
from = startValuesCache[property] ??= (config.speed ?? 1);
|
|
39
|
+
}
|
|
40
|
+
let p = calculateTimeProgress(currentTime, duration, yoyo, loop);
|
|
41
|
+
if (ease) {
|
|
42
|
+
const fn = gsapEasingMap[ease] || ease;
|
|
43
|
+
p = applyEasing(fn, p);
|
|
44
|
+
}
|
|
45
|
+
override.speed = interpolateValue(property, from, to, p);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function applyCloudsMouseMove(properties, config, override, pointer) {
|
|
49
|
+
if (!properties?.length)
|
|
50
|
+
return;
|
|
51
|
+
override.speed = undefined;
|
|
52
|
+
for (const { property, enabled, propertySettings } of properties) {
|
|
53
|
+
if (!enabled || property !== 'speed')
|
|
54
|
+
continue;
|
|
55
|
+
const { axis = 'both', sensitivity = 1, inverted = false, min, max } = propertySettings || {};
|
|
56
|
+
const base = config.speed ?? 1;
|
|
57
|
+
override.speed = interpolateMouseMoveProperty(base, min, max, pointer, axis, sensitivity, inverted);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Project legacy flat `handlers.onMouseMove.properties[]` shape into per-domain
|
|
61
|
+
// buckets so we can route it through the new handlers without a save migration.
|
|
62
|
+
function projectLegacyHandlersToDomain(legacy) {
|
|
63
|
+
const transform = [];
|
|
64
|
+
const material = [];
|
|
65
|
+
const clouds = [];
|
|
66
|
+
if (!legacy)
|
|
67
|
+
return { transform, material, clouds };
|
|
68
|
+
for (const cfg of legacy) {
|
|
69
|
+
const enabledP = { property: cfg.property, enabled: cfg.enabled ?? true, propertySettings: cfg.propertySettings };
|
|
70
|
+
if (cfg.property === 'speed')
|
|
71
|
+
clouds.push(enabledP);
|
|
72
|
+
else if (cfg.property === 'position' || cfg.property === 'rotation' || cfg.property === 'scale')
|
|
73
|
+
transform.push(enabledP);
|
|
74
|
+
else
|
|
75
|
+
material.push(enabledP);
|
|
76
|
+
}
|
|
77
|
+
return { transform, material, clouds };
|
|
78
|
+
}
|
|
79
|
+
// =============================================================================
|
|
80
|
+
// MAIN COMPONENT
|
|
81
|
+
// =============================================================================
|
|
82
|
+
const defaultTimeSettings = {
|
|
83
|
+
enabled: false,
|
|
84
|
+
timescale: 1,
|
|
85
|
+
timeOfDay: 12,
|
|
86
|
+
syncWithRealTime: false,
|
|
87
|
+
autoAnimate: false,
|
|
88
|
+
};
|
|
89
|
+
const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
|
|
90
|
+
const visible = settings.meshSettings.visible ?? true;
|
|
91
|
+
const meshSettings = settings.meshSettings;
|
|
92
|
+
const config = settings.config;
|
|
93
|
+
const materialSettings = settings.materialSettings;
|
|
94
|
+
const position = meshSettings.position;
|
|
95
|
+
const scale = meshSettings.scale;
|
|
96
|
+
// console.log(config.speed)
|
|
97
|
+
const baseSpeed = config.speed ?? 1;
|
|
98
|
+
// console.log(baseSpeed)
|
|
99
|
+
const height = position[1];
|
|
100
|
+
const planeSize = config?.planeSize || [10000, 10000];
|
|
101
|
+
const planeSegments = config?.planeSegments || 64;
|
|
102
|
+
const meshRef = useRef(null);
|
|
103
|
+
const cloudAnimTime = useRef(0);
|
|
104
|
+
const { camera } = useThree();
|
|
105
|
+
const cloudColorRef = useRef(new THREE.Color(1, 1, 1));
|
|
106
|
+
const targetCloudColorRef = useRef(new THREE.Color(1, 1, 1));
|
|
107
|
+
// Sequence-driven numeric anims (legacy `useAnimationEvents` path)
|
|
108
|
+
const numericOverrideRef = useRef(null);
|
|
109
|
+
const { animateNumeric } = useNumericAnimation();
|
|
110
|
+
// Per-domain animation + mouseMove overrides
|
|
111
|
+
const animatedOverrideRef = useRef({});
|
|
112
|
+
const mouseOverrideRef = useRef({});
|
|
113
|
+
// Keyframe-animation start-value caches (one per domain that uses them)
|
|
114
|
+
const transformAnimCacheRef = useRef({});
|
|
115
|
+
const materialAnimCacheRef = useRef({});
|
|
116
|
+
const cloudsAnimCacheRef = useRef({});
|
|
117
|
+
// useMaterialApplication(visible ? (meshRef.current as any) : null, materialSettings, true);
|
|
118
|
+
const handleTimeUpdate = useCallback((state) => {
|
|
119
|
+
const { normalizedTime, isDaytime, delta } = state;
|
|
120
|
+
if (isDaytime) {
|
|
121
|
+
if (normalizedTime <= 0.15) {
|
|
122
|
+
targetCloudColorRef.current.lerpColors(CLOUD_COLORS.night, CLOUD_COLORS.sunrise, normalizedTime / 0.15);
|
|
123
|
+
}
|
|
124
|
+
else if (normalizedTime <= 0.25) {
|
|
125
|
+
targetCloudColorRef.current.lerpColors(CLOUD_COLORS.sunrise, CLOUD_COLORS.midday, (normalizedTime - 0.15) / 0.10);
|
|
126
|
+
}
|
|
127
|
+
else if (normalizedTime <= 0.75) {
|
|
128
|
+
targetCloudColorRef.current.copy(CLOUD_COLORS.midday);
|
|
129
|
+
}
|
|
130
|
+
else if (normalizedTime <= 0.85) {
|
|
131
|
+
targetCloudColorRef.current.lerpColors(CLOUD_COLORS.midday, CLOUD_COLORS.sunset, (normalizedTime - 0.75) / 0.10);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
targetCloudColorRef.current.lerpColors(CLOUD_COLORS.sunset, CLOUD_COLORS.night, (normalizedTime - 0.85) / 0.15);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
targetCloudColorRef.current.copy(CLOUD_COLORS.night);
|
|
139
|
+
}
|
|
140
|
+
const colorLerpSpeed = Math.min(1, 2.0 * (delta || 0.016));
|
|
141
|
+
cloudColorRef.current.lerp(targetCloudColorRef.current, colorLerpSpeed);
|
|
142
|
+
}, []);
|
|
143
|
+
const { sunDirection } = useSkySystem({
|
|
144
|
+
timeSettings,
|
|
145
|
+
onTimeUpdate: handleTimeUpdate,
|
|
146
|
+
enabled: visible,
|
|
147
|
+
});
|
|
148
|
+
// Legacy sequence-driven `speed`/`scale` anims via `useAnimationEvents`
|
|
149
|
+
useAnimationEvents({
|
|
150
|
+
onStepStart: (event) => {
|
|
151
|
+
if (!event.step?.transitions)
|
|
152
|
+
return;
|
|
153
|
+
for (const transition of event.step.transitions) {
|
|
154
|
+
if (transition.state !== 'clouds' || !meshRef.current)
|
|
155
|
+
continue;
|
|
156
|
+
const toProps = transition.properties.to || {};
|
|
157
|
+
const fromProps = transition.properties.from || {};
|
|
158
|
+
if (toProps.visible !== undefined)
|
|
159
|
+
meshRef.current.visible = toProps.visible;
|
|
160
|
+
const KEYS = ['speed', 'scale'];
|
|
161
|
+
const from = {};
|
|
162
|
+
const to = {};
|
|
163
|
+
for (const k of KEYS) {
|
|
164
|
+
const toVal = toProps[k];
|
|
165
|
+
if (toVal === undefined)
|
|
166
|
+
continue;
|
|
167
|
+
to[k] = toVal;
|
|
168
|
+
const sourceFallback = k === 'speed' ? baseSpeed : scale;
|
|
169
|
+
from[k] = fromProps[k] ?? sourceFallback;
|
|
170
|
+
}
|
|
171
|
+
if (Object.keys(to).length > 0) {
|
|
172
|
+
animateNumeric(from, to, (updated) => {
|
|
173
|
+
numericOverrideRef.current = { ...numericOverrideRef.current, ...updated };
|
|
174
|
+
}, () => {
|
|
175
|
+
numericOverrideRef.current = null;
|
|
176
|
+
}, event.step?.duration);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
useFrame((state) => {
|
|
182
|
+
const mesh = meshRef.current;
|
|
183
|
+
if (!mesh || !mesh.visible || !mesh.material)
|
|
184
|
+
return;
|
|
185
|
+
const material = mesh.material;
|
|
186
|
+
const uniforms = material?.uniforms;
|
|
187
|
+
if (!uniforms)
|
|
188
|
+
return;
|
|
189
|
+
const now = Date.now();
|
|
190
|
+
const pointer = state.pointer;
|
|
191
|
+
// ── PER-DOMAIN ANIMATIONS ────────────────────────────────────────────────
|
|
192
|
+
const mouseMove = settings.mouseMove;
|
|
193
|
+
// const isPerDomain = mm && ('transform' in mm || 'material' in mm || 'edges' in mm || 'light' in mm || 'clouds' in mm);
|
|
194
|
+
// transform: position / rotation / scale
|
|
195
|
+
// const transformAnims = settings.animations?.transform?.animations;
|
|
196
|
+
// if (transformAnims?.length) {
|
|
197
|
+
// handleTransformAnimations(
|
|
198
|
+
// { object: mesh, meshSettings: meshSettings as any, pathIsActive: false },
|
|
199
|
+
// transformAnims,
|
|
200
|
+
// now,
|
|
201
|
+
// false,
|
|
202
|
+
// );
|
|
203
|
+
// }
|
|
204
|
+
// // material: shader uniforms
|
|
205
|
+
// const materialAnims = settings.animations?.material?.animations;
|
|
206
|
+
// if (materialAnims?.length) {
|
|
207
|
+
// handleMaterialAnimations(
|
|
208
|
+
// { object: mesh, materialSettings: materialSettings as any, startValuesCache: materialAnimCacheRef.current },
|
|
209
|
+
// materialAnims,
|
|
210
|
+
// now,
|
|
211
|
+
// false,
|
|
212
|
+
// );
|
|
213
|
+
// }
|
|
214
|
+
// clouds: speed
|
|
215
|
+
applyCloudsKeyframeAnimations(settings.animations?.clouds?.animations, cloudsAnimCacheRef.current, config, animatedOverrideRef.current, now);
|
|
216
|
+
// ── PER-DOMAIN MOUSE-MOVE ─────────────────────────────────────────────────
|
|
217
|
+
if (mouseMove) {
|
|
218
|
+
const perDomain = mouseMove;
|
|
219
|
+
// if (perDomain.transform?.enabled && perDomain.transform.properties?.length) {
|
|
220
|
+
// handleTransformMouseMove(
|
|
221
|
+
// { object: mesh, meshSettings: meshSettings as any },
|
|
222
|
+
// perDomain.transform.properties,
|
|
223
|
+
// pointer,
|
|
224
|
+
// );
|
|
225
|
+
// }
|
|
226
|
+
// if (perDomain.material?.enabled && perDomain.material.properties?.length) {
|
|
227
|
+
// handleMaterialMouseMove(
|
|
228
|
+
// { object: mesh, materialSettings: materialSettings as any },
|
|
229
|
+
// perDomain.material.properties,
|
|
230
|
+
// pointer,
|
|
231
|
+
// );
|
|
232
|
+
// }
|
|
233
|
+
applyCloudsMouseMove(perDomain.clouds?.enabled ? perDomain.clouds.properties : undefined, config, mouseOverrideRef.current, pointer);
|
|
234
|
+
}
|
|
235
|
+
// ── EFFECTIVE SPEED + UNIFORM UPDATES ─────────────────────────────────────
|
|
236
|
+
const effectiveSpeed = animatedOverrideRef.current.speed
|
|
237
|
+
?? numericOverrideRef.current?.speed
|
|
238
|
+
?? mouseOverrideRef.current.speed
|
|
239
|
+
?? baseSpeed;
|
|
240
|
+
// console.log(effectiveSpeed)
|
|
241
|
+
// console.log(effectiveSpeed)
|
|
242
|
+
cloudAnimTime.current += 0.02 * effectiveSpeed;
|
|
243
|
+
// console.log(cloudAnimTime.current)
|
|
244
|
+
if (uniforms.u_time)
|
|
245
|
+
uniforms.u_time.value = cloudAnimTime.current;
|
|
246
|
+
if (uniforms.u_cameraPos) {
|
|
247
|
+
uniforms.u_cameraPos.value?.copy
|
|
248
|
+
? uniforms.u_cameraPos.value.copy(camera.position)
|
|
249
|
+
: (uniforms.u_cameraPos.value = camera.position.clone());
|
|
250
|
+
}
|
|
251
|
+
if (uniforms.u_cloudColor) {
|
|
252
|
+
uniforms.u_cloudColor.value?.copy
|
|
253
|
+
? uniforms.u_cloudColor.value.copy(cloudColorRef.current)
|
|
254
|
+
: (uniforms.u_cloudColor.value = cloudColorRef.current.clone());
|
|
255
|
+
}
|
|
256
|
+
if (uniforms.u_resolution) {
|
|
257
|
+
uniforms.u_resolution.value?.set
|
|
258
|
+
? uniforms.u_resolution.value.set(window.innerWidth, window.innerHeight)
|
|
259
|
+
: (uniforms.u_resolution.value = new THREE.Vector2(window.innerWidth, window.innerHeight));
|
|
260
|
+
}
|
|
261
|
+
if (uniforms.u_sunPosition && sunDirection) {
|
|
262
|
+
uniforms.u_sunPosition.value?.copy
|
|
263
|
+
? uniforms.u_sunPosition.value.copy(sunDirection)
|
|
264
|
+
: (uniforms.u_sunPosition.value = sunDirection.clone());
|
|
265
|
+
}
|
|
266
|
+
// Apply scale override (sequence-driven path only — per-domain transform anims
|
|
267
|
+
// already mutate mesh.scale through handleTransformAnimations).
|
|
268
|
+
if (numericOverrideRef.current?.scale !== undefined) {
|
|
269
|
+
mesh.scale.setScalar(numericOverrideRef.current.scale);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
return (_jsx("mesh", { ref: meshRef, name: "SkyClouds", userData: { id: '3drise-clouds' },
|
|
273
|
+
// position={[0, height, 0]}
|
|
274
|
+
// rotation={[Math.PI / 2, 0, 0]}
|
|
275
|
+
// scale={scale}
|
|
276
|
+
renderOrder: -1, frustumCulled: false, visible: visible, children: _jsx("planeGeometry", { args: [planeSize[0], planeSize[1], planeSegments, planeSegments] }) }));
|
|
277
|
+
};
|
|
278
|
+
export default Clouds;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
sunCoronaMaterial: any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export type CoronaProps = {
|
|
10
|
+
/** Radius of the core this corona surrounds. Default 1. */
|
|
11
|
+
radius?: number;
|
|
12
|
+
/** Shell size relative to the core. Default 1.25. Synced with u_shellScale. */
|
|
13
|
+
shellScale?: number;
|
|
14
|
+
/** Uniform overrides for SunCoronaMaterial (u_intensity, u_innerColor, ...). */
|
|
15
|
+
uniforms?: Record<string, number | THREE.Vector3 | number[]>;
|
|
16
|
+
};
|
|
17
|
+
export default function Corona({ radius, shellScale, uniforms }: CoronaProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Corona.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Corona.d.ts","sourceRoot":"","sources":["../../src/components/Corona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,GAAG,CAAC;QACV,UAAU,iBAAiB;YACvB,iBAAiB,EAAE,GAAG,CAAC;SAC1B;KACJ;CACJ;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAU,EAAE,UAAiB,EAAE,QAAQ,EAAE,EAAE,WAAW,+BAOtF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { useFrame } from "@react-three/fiber";
|
|
5
|
+
export default function Corona({ radius = 1, shellScale = 1.25, uniforms }) {
|
|
6
|
+
const matRef = useRef(null);
|
|
7
|
+
useFrame((_, delta) => {
|
|
8
|
+
if (matRef.current)
|
|
9
|
+
matRef.current.u_time += delta;
|
|
10
|
+
});
|
|
11
|
+
return (_jsxs("mesh", { scale: radius * shellScale, children: [_jsx("sphereGeometry", { args: [1, 64, 64] }), _jsx("coronaMaterial", { ref: matRef, u_shellScale: shellScale, side: THREE.BackSide, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, ...uniforms })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Object3D } from "three";
|
|
4
|
+
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
|
+
interface CreatedObjectProps {
|
|
6
|
+
createdObject: CreatedObjectSettings;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
shouldApply3driseMaterial?: boolean;
|
|
9
|
+
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
10
|
+
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const CreatedObject: React.FC<CreatedObjectProps>;
|
|
13
|
+
export default CreatedObject;
|
|
14
|
+
//# sourceMappingURL=CreatedObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AASnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,kBAAkB;IACxB,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuF9C,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect, useState, memo } from "react";
|
|
3
|
+
import { DEFAULT_EDGES_SETTINGS } from "@3driseai/3drise-core";
|
|
4
|
+
import { useMaterialApplication } from "../hooks/useMaterialApplication.js";
|
|
5
|
+
import { useShadowApplication } from "../hooks/useShadowApplication.js";
|
|
6
|
+
import { useTransformControls } from "../hooks/useTransformControls.js";
|
|
7
|
+
import { RigidBody } from '@react-three/rapier';
|
|
8
|
+
import { cameraManager } from "../utils/CameraSingleton.js";
|
|
9
|
+
import AnimatedObject from "./AnimatedObject.js";
|
|
10
|
+
import { useFrameEffects } from "../hooks/useFrameEffects.js";
|
|
11
|
+
import { useObjectEdges } from "../hooks/useObjectEdges.js";
|
|
12
|
+
const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, onObjectReady, handleObjectClick, }) => {
|
|
13
|
+
const isSelected = false;
|
|
14
|
+
// const isSelected = useObjectSelection(createdObject.id);
|
|
15
|
+
// const { handleObjectClick: contextHandleObjectClick } = useSceneClick();
|
|
16
|
+
const meshRef = useRef(null);
|
|
17
|
+
const transformRef = useRef(null);
|
|
18
|
+
// const baseColorRef = useRef<string>(("color" in createdObject.materialSettings && createdObject.materialSettings.color) || '#ffffff');
|
|
19
|
+
// const [hovered, setHovered] = useState(false);
|
|
20
|
+
const [animatedTransform, setAnimatedTransform] = useState({
|
|
21
|
+
position: createdObject.meshSettings.position,
|
|
22
|
+
rotation: createdObject.meshSettings.rotation,
|
|
23
|
+
scale: createdObject.meshSettings.scale,
|
|
24
|
+
});
|
|
25
|
+
// Initialize transform controls
|
|
26
|
+
const { controllersRef } = useTransformControls();
|
|
27
|
+
const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(isSelected);
|
|
28
|
+
const [mountedObject, setMountedObject] = useState(null);
|
|
29
|
+
useObjectEdges(createdObject.id, createdObject.edgesSettings ?? DEFAULT_EDGES_SETTINGS);
|
|
30
|
+
// useObjectGenerativeEffects(mountedObject, createdObject.effects);
|
|
31
|
+
useMaterialApplication(meshRef.current, createdObject.materialSettings, shouldApply3driseMaterial);
|
|
32
|
+
useShadowApplication(meshRef.current, createdObject.meshSettings.castShadow, createdObject.meshSettings.receiveShadow);
|
|
33
|
+
const anchoredPosition = cameraManager.getAnchorPosition(createdObject.meshSettings.anchor?.anchor || 'center', 0, createdObject.meshSettings.anchor?.offset || { y: 0, x: 0, z: 0 }, createdObject.meshSettings.anchor?.padding || 0);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (meshRef.current) {
|
|
36
|
+
meshRef.current.userData.id = createdObject.id;
|
|
37
|
+
onObjectReady && onObjectReady(createdObject, meshRef.current);
|
|
38
|
+
}
|
|
39
|
+
return () => {
|
|
40
|
+
};
|
|
41
|
+
}, [meshRef.current]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (transformRef.current && isSelected) {
|
|
44
|
+
controllersRef.current.set(createdObject.id.toString(), transformRef.current);
|
|
45
|
+
// console.log('Transform controls registered for object:', createdObject.id, createdObject.name);
|
|
46
|
+
}
|
|
47
|
+
return () => {
|
|
48
|
+
controllersRef.current.delete(createdObject.id.toString());
|
|
49
|
+
// console.log('Transform controls unregistered for object:', createdObject.id, createdObject.name);
|
|
50
|
+
};
|
|
51
|
+
}, [createdObject.id, isSelected]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setAnimatedTransform({
|
|
54
|
+
position: createdObject.meshSettings.position,
|
|
55
|
+
rotation: createdObject.meshSettings.rotation,
|
|
56
|
+
scale: createdObject.meshSettings.scale,
|
|
57
|
+
});
|
|
58
|
+
}, [createdObject.meshSettings.position, createdObject.meshSettings.rotation, createdObject.meshSettings.scale]);
|
|
59
|
+
// const [noiseTexture, setNoiseTexture] = useState<Texture | null>(null);
|
|
60
|
+
const isTransforming = useRef(false);
|
|
61
|
+
// useMaterialApplication(obj.object, createdObject.materialSettings);
|
|
62
|
+
// Check if this should use the new MaterialLibrary system for Drei materials
|
|
63
|
+
// console.log(object)
|
|
64
|
+
const handleObjectEnter = (e) => {
|
|
65
|
+
// console.log(e)
|
|
66
|
+
// Only handle if this is the actual mesh group, not a child
|
|
67
|
+
if (e.eventObject !== meshRef.current)
|
|
68
|
+
return;
|
|
69
|
+
if (createdObject.type === 'particles' || createdObject.type === 'gallery')
|
|
70
|
+
return;
|
|
71
|
+
// e.stopPropagation();
|
|
72
|
+
handlePointerEnter(e);
|
|
73
|
+
if (createdObject.actions?.length || createdObject.mouseMove?.enabled) {
|
|
74
|
+
document.body.style.cursor = 'pointer';
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const handleObjectLeave = (e) => {
|
|
78
|
+
// Only handle if this is the actual mesh group, not a child
|
|
79
|
+
if (e.eventObject !== meshRef.current)
|
|
80
|
+
return;
|
|
81
|
+
if (createdObject.type === 'particles' || createdObject.type === 'gallery')
|
|
82
|
+
return;
|
|
83
|
+
handlePointerLeave();
|
|
84
|
+
document.body.style.cursor = 'auto';
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
};
|
|
87
|
+
const anchorEnabled = createdObject.meshSettings.anchor && createdObject.meshSettings.anchor.enabled;
|
|
88
|
+
return (_jsx(AnimatedObject
|
|
89
|
+
// animationId={createdObject.animationId || ''}
|
|
90
|
+
, {
|
|
91
|
+
// animationId={createdObject.animationId || ''}
|
|
92
|
+
stateKey: createdObject.id, transitionSettings: {
|
|
93
|
+
...animatedTransform,
|
|
94
|
+
position: anchorEnabled ? [anchoredPosition.x, anchoredPosition.y, anchoredPosition.z] : animatedTransform.position
|
|
95
|
+
}, createdObject: createdObject,
|
|
96
|
+
// animateMaterial={!useDreiMaterials}
|
|
97
|
+
parentRef: meshRef, visible: createdObject.meshSettings.visible, handleObjectClick: handleObjectClick, onPointerEnter: handleObjectEnter, onPointerLeave: e => handleObjectLeave(e), hovered: hovered, children: createdObject.rigidBodySettings?.enabled ? (_jsx(RigidBody, { type: createdObject.rigidBodySettings?.type || 'dynamic', mass: createdObject.rigidBodySettings?.mass || 1, colliders: createdObject.userData?.type === 'plane'
|
|
98
|
+
? 'cuboid' // Force box collider for planes
|
|
99
|
+
: undefined // Auto-detect for others
|
|
100
|
+
, friction: createdObject.rigidBodySettings?.friction, restitution: createdObject.rigidBodySettings?.restitution, gravityScale: createdObject.rigidBodySettings?.gravityScale ?? 1, linearDamping: createdObject.rigidBodySettings?.linearDamping ?? 0.01, angularDamping: createdObject.rigidBodySettings?.angularDamping ?? 0.01, children: children })) : (children) }));
|
|
101
|
+
});
|
|
102
|
+
CreatedObject.displayName = 'CreatedObject';
|
|
103
|
+
export default CreatedObject;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import type { Object3D } from 'three';
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
|
+
interface CustomPrimitiveProps {
|
|
6
|
+
createdObject: CreatedObjectSettings;
|
|
7
|
+
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
8
|
+
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const CustomPrimitive: React.FC<CustomPrimitiveProps>;
|
|
11
|
+
export default CustomPrimitive;
|
|
12
|
+
//# sourceMappingURL=CustomPrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,oBAAoB;IAC1B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA6ElD,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, memo, useMemo } from "react";
|
|
3
|
+
import { ObjectManager, } from "@3driseai/3drise-core";
|
|
4
|
+
import { Vector3 } from "three";
|
|
5
|
+
import MaterialLibrary from "./MaterialLibrary.js";
|
|
6
|
+
import { useWaterReflections } from "../hooks/useWaterReflections.js";
|
|
7
|
+
import { GeometryMesh } from "./GeometryShape.js";
|
|
8
|
+
const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick, }) => {
|
|
9
|
+
const meshRef = useRef(null);
|
|
10
|
+
const resolvedObject = useMemo(() => {
|
|
11
|
+
// console.log(`Resolving object for ${createdObject.name}`, createdObject);
|
|
12
|
+
if (!createdObject)
|
|
13
|
+
return null;
|
|
14
|
+
const obj = ObjectManager.getObject(createdObject.id);
|
|
15
|
+
if (!obj) {
|
|
16
|
+
console.warn(`CustomPrimitive - Object with ID ${createdObject.id} not found.`);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return obj.object;
|
|
20
|
+
}, [createdObject.id]);
|
|
21
|
+
// const objectRef = useRef<Mesh>(resolvedObject as Mesh);
|
|
22
|
+
// useEffect(() => {
|
|
23
|
+
// if (createdObject.type !== 'mesh' || !objectRef.current) return;
|
|
24
|
+
// // const managedObject = ObjectManager.getObject(createdObject.id);
|
|
25
|
+
// // if (!managedObject || !(managedObject.object instanceof Mesh)) return;
|
|
26
|
+
// const targetMesh = objectRef.current;
|
|
27
|
+
// const meshType = (createdObject.config as any)?.type || targetMesh.userData?.type || 'box';
|
|
28
|
+
// const meshData = {
|
|
29
|
+
// position: [targetMesh.position.x, targetMesh.position.y, targetMesh.position.z],
|
|
30
|
+
// rotation: [targetMesh.rotation.x, targetMesh.rotation.y, targetMesh.rotation.z],
|
|
31
|
+
// scale: [targetMesh.scale.x, targetMesh.scale.y, targetMesh.scale.z],
|
|
32
|
+
// visible: targetMesh.visible,
|
|
33
|
+
// name: targetMesh.name || createdObject.name,
|
|
34
|
+
// ...createdObject.config,
|
|
35
|
+
// type: meshType,
|
|
36
|
+
// id: createdObject.id,
|
|
37
|
+
// } as any;
|
|
38
|
+
// const generated = createMeshByType(meshData);
|
|
39
|
+
// if (!generated) return;
|
|
40
|
+
// if (targetMesh.geometry !== generated.mesh.geometry) {
|
|
41
|
+
// targetMesh.geometry?.dispose();
|
|
42
|
+
// targetMesh.geometry = generated.mesh.geometry;
|
|
43
|
+
// }
|
|
44
|
+
// targetMesh.userData = {
|
|
45
|
+
// ...targetMesh.userData,
|
|
46
|
+
// type: meshType,
|
|
47
|
+
// id: createdObject.id,
|
|
48
|
+
// options: generated.config,
|
|
49
|
+
// };
|
|
50
|
+
// if (generated.mesh.material && generated.mesh.material !== targetMesh.material) {
|
|
51
|
+
// if (Array.isArray(generated.mesh.material)) {
|
|
52
|
+
// generated.mesh.material.forEach((m) => m.dispose());
|
|
53
|
+
// } else {
|
|
54
|
+
// generated.mesh.material.dispose();
|
|
55
|
+
// }
|
|
56
|
+
// }
|
|
57
|
+
// }, [
|
|
58
|
+
// createdObject.config,
|
|
59
|
+
// ]);
|
|
60
|
+
const isWaterMaterial = createdObject.materialSettings.materialVariant === 'water' || createdObject.materialSettings.materialType === 'water';
|
|
61
|
+
// console.log({isWaterMaterial, materialVariant: createdObject.materialSettings.materialVariant, materialType: createdObject.materialSettings.materialType})
|
|
62
|
+
useWaterReflections(createdObject.meshSettings.visible && isWaterMaterial ? meshRef : { current: null }, {
|
|
63
|
+
waterPosition: new Vector3(...createdObject.meshSettings.position),
|
|
64
|
+
resolution: 256,
|
|
65
|
+
updateFrequency: 1,
|
|
66
|
+
enabled: createdObject.meshSettings.visible && isWaterMaterial,
|
|
67
|
+
});
|
|
68
|
+
const useDreiMaterials = createdObject.materialSettings.materialType === "advanced";
|
|
69
|
+
// const obj = ObjectManager.getObject(createdObject.id);
|
|
70
|
+
const materialType = createdObject.materialSettings?.materialType || 'basic';
|
|
71
|
+
// let mode = 'solid';
|
|
72
|
+
// if (materialType === 'particles') {
|
|
73
|
+
// mode = 'particles';
|
|
74
|
+
// }
|
|
75
|
+
// else if (materialType === 'line') {
|
|
76
|
+
// mode = 'outline';
|
|
77
|
+
// }
|
|
78
|
+
if (createdObject.type === 'mesh')
|
|
79
|
+
return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 } }) }, createdObject.id);
|
|
80
|
+
if (!resolvedObject) {
|
|
81
|
+
console.warn(`no resolved object for ${createdObject.name} (${createdObject.id})`);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return (_jsx("primitive", { ref: meshRef, name: createdObject.name, object: resolvedObject, children: useDreiMaterials && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }, createdObject.id));
|
|
85
|
+
});
|
|
86
|
+
CustomPrimitive.displayName = 'CustomPrimitive';
|
|
87
|
+
export default CustomPrimitive;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { EarthConfig } from "@3driseai/3drise-core";
|
|
4
|
+
declare const Earth: React.FC<EarthConfig & {
|
|
5
|
+
onMeshReady?: (mesh: THREE.Mesh) => void;
|
|
6
|
+
}>;
|
|
7
|
+
export default Earth;
|
|
8
|
+
//# sourceMappingURL=Earth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMpD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;CAC5C,CA2BR,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo, useCallback, useEffect } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useTexture } from '@react-three/drei';
|
|
5
|
+
const CDN = 'https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/planets';
|
|
6
|
+
const EARTH_DAY_URL = `${CDN}/earth_day_4096.jpg`;
|
|
7
|
+
const EARTH_NIGHT_URL = `${CDN}/earth_night_4096.jpg`;
|
|
8
|
+
const EARTH_BUMP_ROUGHNESS_CLOUDS_URL = `${CDN}/earth_bump_roughness_clouds_4096.jpg`;
|
|
9
|
+
const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosphereTwilightColor = '#bc490b', radius = 1, onMeshReady, }) => {
|
|
10
|
+
const globeRef = useRef(null);
|
|
11
|
+
const globeMatRef = useRef(null);
|
|
12
|
+
const atmosphereMatRef = useRef(null);
|
|
13
|
+
const segments = 64;
|
|
14
|
+
const [dayMap, nightMap, bumpRoughnessClouds] = useTexture([
|
|
15
|
+
EARTH_DAY_URL,
|
|
16
|
+
EARTH_NIGHT_URL,
|
|
17
|
+
EARTH_BUMP_ROUGHNESS_CLOUDS_URL,
|
|
18
|
+
]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
dayMap.colorSpace = THREE.SRGBColorSpace;
|
|
21
|
+
nightMap.colorSpace = THREE.SRGBColorSpace;
|
|
22
|
+
dayMap.anisotropy = 8;
|
|
23
|
+
nightMap.anisotropy = 8;
|
|
24
|
+
bumpRoughnessClouds.anisotropy = 8;
|
|
25
|
+
}, [dayMap, nightMap, bumpRoughnessClouds]);
|
|
26
|
+
const sunDirection = useMemo(() => new THREE.Vector3(sunPosition[0], sunPosition[1], sunPosition[2]).normalize(), [sunPosition]);
|
|
27
|
+
const dayColor = useMemo(() => new THREE.Color(atmosphereDayColor), [atmosphereDayColor]);
|
|
28
|
+
const twilightColor = useMemo(() => new THREE.Color(atmosphereTwilightColor), [atmosphereTwilightColor]);
|
|
29
|
+
const handleGlobeRef = useCallback((mesh) => {
|
|
30
|
+
if (mesh) {
|
|
31
|
+
globeRef.current = mesh;
|
|
32
|
+
onMeshReady?.(mesh);
|
|
33
|
+
}
|
|
34
|
+
}, [onMeshReady]);
|
|
35
|
+
return (_jsxs("group", { userData: { id: '3drise-earth' }, children: [_jsxs("mesh", { ref: handleGlobeRef, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthMaterial", { ref: globeMatRef, uDayMap: dayMap, uNightMap: nightMap, uBumpRoughnessClouds: bumpRoughnessClouds, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] }), _jsxs("mesh", { scale: 1.04, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthAtmosphereMaterial", { ref: atmosphereMatRef, transparent: true, side: THREE.BackSide, depthWrite: false, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] })] }));
|
|
36
|
+
};
|
|
37
|
+
Earth.displayName = 'Earth';
|
|
38
|
+
export default Earth;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { GenerativeEffectSettings } from "@3driseai/3drise-core";
|
|
4
|
+
export interface EffectsGeneratorProps {
|
|
5
|
+
settings: GenerativeEffectSettings;
|
|
6
|
+
object?: Object3D | null;
|
|
7
|
+
}
|
|
8
|
+
declare const EffectsGenerator: React.FC<EffectsGeneratorProps>;
|
|
9
|
+
export default EffectsGenerator;
|
|
10
|
+
//# sourceMappingURL=EffectsGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAyBtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B;AAGD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA0CrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|