@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,139 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import CustomPrimitive from "./CustomPrimitive.js";
|
|
4
|
+
import CreatedObject from "./CreatedObject.js";
|
|
5
|
+
import Text3D from './Text3D.js';
|
|
6
|
+
import Text2D from './Text2D.js';
|
|
7
|
+
import PathRenderer from './PathRenderer.js';
|
|
8
|
+
import GalleryLayout from './GalleryLayout.js';
|
|
9
|
+
import EffectsGenerator from './EffectsGenerator.js';
|
|
10
|
+
import ParticlesR3f from "./ParticlesR3f.js";
|
|
11
|
+
import Lines from "./Lines.js";
|
|
12
|
+
import LightObject from "./LightObject.js";
|
|
13
|
+
import EnvironmentObject from "./EnvironmentObject.js";
|
|
14
|
+
import Galaxy from "./Galaxy.js";
|
|
15
|
+
import GridGenerator from "./GridsGenerator.js";
|
|
16
|
+
// Types whose React component instantiates and drives its own ShaderMaterial.
|
|
17
|
+
// useMaterialApplication would otherwise traverse the mesh tree and replace
|
|
18
|
+
// that material with a registry-default instance, breaking config-driven
|
|
19
|
+
// uniform updates (e.g. only ringRadius worked on glyphs because that drives
|
|
20
|
+
// geometry, not the material).
|
|
21
|
+
const SELF_MANAGED_MATERIAL = new Set([
|
|
22
|
+
'effect',
|
|
23
|
+
// 'gallery',
|
|
24
|
+
'earth',
|
|
25
|
+
'solarSystem',
|
|
26
|
+
'shootingStars',
|
|
27
|
+
'grid',
|
|
28
|
+
// 'moon'
|
|
29
|
+
]);
|
|
30
|
+
// const EffectsLayer: React.FC<{ effects: CreatedObjectSettings['effects'] }> = ({ effects }) =>
|
|
31
|
+
// effects?.length ? (
|
|
32
|
+
// <>
|
|
33
|
+
// {effects.map((effect, index) => (
|
|
34
|
+
// <EffectsGenerator key={index} settings={effect} />
|
|
35
|
+
// ))}
|
|
36
|
+
// </>
|
|
37
|
+
// ) : null;
|
|
38
|
+
const GroupWithChildren = ({ createdObject, children, cameraSettings, onObjectReady, handleObjectClick, renderObject }) => {
|
|
39
|
+
const isGroup = createdObject.type === 'group';
|
|
40
|
+
const selfManagedMaterial = SELF_MANAGED_MATERIAL.has(createdObject.type);
|
|
41
|
+
return (_jsxs(CreatedObject, { createdObject: createdObject, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick, shouldApply3driseMaterial: !isGroup && !selfManagedMaterial, children: [!isGroup && renderObject(createdObject, handleObjectClick), children.map(childNode => (_jsx(ObjectNode, { node: childNode, cameraSettings: cameraSettings, handleObjectClick: handleObjectClick, onObjectReady: onObjectReady }, childNode.objectId)))] }, createdObject.id));
|
|
42
|
+
};
|
|
43
|
+
const ObjectNode = ({ node, cameraSettings, onObjectReady, handleObjectClick }) => {
|
|
44
|
+
const { children, createdObject } = node;
|
|
45
|
+
// console.log(createdObject.meshSettings.name, createdObject.actions, createdObject.mouseMove)
|
|
46
|
+
// Specialized renderers for each object type
|
|
47
|
+
const renderers = useMemo(() => ({
|
|
48
|
+
group: () => null,
|
|
49
|
+
mesh: (obj, cameraSettings, onObjectReady) => (_jsx(CustomPrimitive, { createdObject: obj, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick }, obj.id)),
|
|
50
|
+
// water: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
51
|
+
// <Ocean
|
|
52
|
+
// settings={obj}
|
|
53
|
+
// />
|
|
54
|
+
// ),
|
|
55
|
+
// stars: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
56
|
+
// <Stars
|
|
57
|
+
// settings={obj}
|
|
58
|
+
// />
|
|
59
|
+
// ),
|
|
60
|
+
// clouds: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
61
|
+
// <Clouds
|
|
62
|
+
// settings={obj}
|
|
63
|
+
// />
|
|
64
|
+
// ),
|
|
65
|
+
model: (obj, cameraSettings, onObjectReady) => (_jsx(CustomPrimitive, { createdObject: obj, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick }, obj.id)),
|
|
66
|
+
// custom_primitive: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
67
|
+
// <CustomPrimitive
|
|
68
|
+
// key={obj.id}
|
|
69
|
+
// createdObject={obj}
|
|
70
|
+
// onObjectReady={onObjectReady}
|
|
71
|
+
// handleObjectClick={handleObjectClick}
|
|
72
|
+
// />
|
|
73
|
+
// ),
|
|
74
|
+
text: (obj, cameraSettings, onObjectReady) => {
|
|
75
|
+
const renderMode = obj.config?.renderMode ?? 'bitmap';
|
|
76
|
+
return (_jsx(_Fragment, { children: renderMode === 'text3d'
|
|
77
|
+
? _jsx(Text3D, { textSettings: obj })
|
|
78
|
+
: _jsx(Text2D, { textSettings: obj }) }));
|
|
79
|
+
},
|
|
80
|
+
particles: (obj, cameraSettings, onObjectReady) => {
|
|
81
|
+
const particlesSettings = obj;
|
|
82
|
+
return (_jsxs(_Fragment, { children: [particlesSettings.config?.particles && (_jsx(ParticlesR3f, { particlesSettings: particlesSettings, cameraFov: cameraSettings.fov, duration: 1, transitionSettings: particlesSettings.meshSettings })), particlesSettings.config?.paths && (_jsx(Lines, { createdObject: particlesSettings }))] }));
|
|
83
|
+
},
|
|
84
|
+
path: (obj, cameraSettings, onObjectReady) => (_jsx(PathRenderer, { pathSettings: obj.config }, obj.id)),
|
|
85
|
+
grid: (obj, cameraSettings, onObjectReady) => (
|
|
86
|
+
// <GridHelper {...(obj.config as GridConfig)} side={2} />
|
|
87
|
+
_jsx(GridGenerator, { config: obj.config })),
|
|
88
|
+
effect: (obj) => (_jsx(EffectsGenerator, { settings: {
|
|
89
|
+
config: obj.config,
|
|
90
|
+
} }, obj.id)),
|
|
91
|
+
gallery: (obj, cameraSettings, onObjectReady) => (_jsx(GalleryLayout, { createdObject: obj, handleObjectClick: handleObjectClick })),
|
|
92
|
+
light: (obj, cameraSettings, onObjectReady) => (_jsx(LightObject, { createdObject: obj })),
|
|
93
|
+
environment: (obj, cameraSettings, onObjectReady) => (_jsx(EnvironmentObject, { createdObject: obj })),
|
|
94
|
+
space: (obj, cameraSettings, onObjectReady) => (_jsx(Galaxy, { createdObject: obj, onObjectReady: onObjectReady })),
|
|
95
|
+
// rain: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
96
|
+
// <Rain
|
|
97
|
+
// settings={obj}
|
|
98
|
+
// />
|
|
99
|
+
// ),
|
|
100
|
+
// earth: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
101
|
+
// <Earth
|
|
102
|
+
// {...obj.config as EarthConfig}
|
|
103
|
+
// />
|
|
104
|
+
// ),
|
|
105
|
+
// solarSystem: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
106
|
+
// <SolarSystem
|
|
107
|
+
// {...obj.config as SolarSystemConfig}
|
|
108
|
+
// />
|
|
109
|
+
// ),
|
|
110
|
+
// shootingStars: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
|
|
111
|
+
// <ShootingStars
|
|
112
|
+
// settings={obj.config as ShootingStarsSettings}
|
|
113
|
+
// />
|
|
114
|
+
// ),
|
|
115
|
+
}), [handleObjectClick]);
|
|
116
|
+
if (!createdObject) {
|
|
117
|
+
console.warn(`createdObject not found.`);
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const meshSettings = createdObject.meshSettings;
|
|
121
|
+
const hasChildren = children.length > 0;
|
|
122
|
+
const shouldRenderAsGroup = hasChildren || createdObject.type === 'group' || createdObject.type === 'effect';
|
|
123
|
+
const renderObject = useCallback((obj, handleObjectClick) => {
|
|
124
|
+
// console.log('Rendering object:', obj);
|
|
125
|
+
const renderer = renderers[obj.type];
|
|
126
|
+
return renderer?.(obj, cameraSettings, onObjectReady) ?? null;
|
|
127
|
+
}, [cameraSettings, onObjectReady, renderers]);
|
|
128
|
+
const renderedObject = shouldRenderAsGroup
|
|
129
|
+
? _jsx(GroupWithChildren, { createdObject: createdObject, children: children, cameraSettings: cameraSettings, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick, renderObject: renderObject })
|
|
130
|
+
: _jsx(CreatedObject, { createdObject: createdObject, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick, shouldApply3driseMaterial: !SELF_MANAGED_MATERIAL.has(createdObject.type), children: renderObject(createdObject) }, createdObject.id);
|
|
131
|
+
// createdObject.effects
|
|
132
|
+
// ? <>
|
|
133
|
+
// {renderObject(createdObject)}
|
|
134
|
+
// {/* <EffectsLayer effects={createdObject.effects} /> */}
|
|
135
|
+
// </>
|
|
136
|
+
// : renderObject(createdObject);
|
|
137
|
+
return renderedObject;
|
|
138
|
+
};
|
|
139
|
+
export default ObjectNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Object3D } from "three";
|
|
3
|
+
import type { CameraState, CreatedObjectSettings } from "@3driseai/3drise-core";
|
|
4
|
+
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
|
+
type ObjectNodeApiProps = {
|
|
6
|
+
objectId: string;
|
|
7
|
+
cameraSettings: CameraState;
|
|
8
|
+
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
9
|
+
handleObjectClick?: (object: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const ObjectNodeApi: React.FC<ObjectNodeApiProps>;
|
|
12
|
+
export default ObjectNodeApi;
|
|
13
|
+
//# sourceMappingURL=ObjectNodeApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectNodeApi.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNodeApi.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,KAAK,kBAAkB,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,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;AAGF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAW/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
// import { apiFetch } from '../utils/apiFetch';
|
|
4
|
+
import ObjectNode from './ObjectNode.js';
|
|
5
|
+
import { dataCenterServer } from '../constants.js';
|
|
6
|
+
const ObjectNodeApi = ({ objectId, cameraSettings, onObjectReady, handleObjectClick }) => {
|
|
7
|
+
const [node, setNode] = useState(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
fetch(`${dataCenterServer}scene-objects/${objectId}/tree`)
|
|
10
|
+
.then(res => res.ok ? res.json() : Promise.reject(res.status))
|
|
11
|
+
.then(({ tree }) => setNode(tree))
|
|
12
|
+
.catch(err => console.error('Failed to fetch scene object tree:', err));
|
|
13
|
+
}, [objectId]);
|
|
14
|
+
if (!node)
|
|
15
|
+
return null;
|
|
16
|
+
return (_jsx(ObjectNode, { node: node, cameraSettings: cameraSettings, onObjectReady: onObjectReady, handleObjectClick: handleObjectClick }));
|
|
17
|
+
};
|
|
18
|
+
export default ObjectNodeApi;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AnimationSequence, GeneralObjectSettings, CameraState, 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 ObjectsRendererProps {
|
|
6
|
+
cameraSettings: CameraState;
|
|
7
|
+
generalObjectSettings: GeneralObjectSettings;
|
|
8
|
+
createdObjects: CreatedObjectSettings[];
|
|
9
|
+
onObjectsReady?: () => void;
|
|
10
|
+
handleObjectClick?: (object: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
11
|
+
sequences?: AnimationSequence[];
|
|
12
|
+
}
|
|
13
|
+
declare const ObjectsRenderer: React.FC<ObjectsRendererProps>;
|
|
14
|
+
export default ObjectsRenderer;
|
|
15
|
+
//# sourceMappingURL=ObjectsRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectsRenderer.d.ts","sourceRoot":"","sources":["../../src/components/ObjectsRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG1H,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,oBAAoB;IAC1B,cAAc,EAAE,WAAW,CAAC;IAC5B,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,cAAc,EAAE,qBAAqB,EAAE,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC1G,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAGD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgClD,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useRef, useCallback, useMemo } from 'react';
|
|
3
|
+
import { buildObjectTree } from '@3driseai/3drise-core';
|
|
4
|
+
import ObjectNode from './ObjectNode.js';
|
|
5
|
+
import useInteraction from '../hooks/useInteraction.js';
|
|
6
|
+
const ObjectsRenderer = memo(({ cameraSettings, createdObjects, generalObjectSettings, onObjectsReady, handleObjectClick, sequences = [], }) => {
|
|
7
|
+
const groupRef = useRef(null);
|
|
8
|
+
const objectsTree = useMemo(() => buildObjectTree(createdObjects), [createdObjects]);
|
|
9
|
+
const readyObjectsCount = useRef(0);
|
|
10
|
+
const onObjectReady = useCallback((object, ref) => {
|
|
11
|
+
readyObjectsCount.current += 1;
|
|
12
|
+
if (readyObjectsCount.current === objectsTree.length) {
|
|
13
|
+
console.log("All objects are ready!");
|
|
14
|
+
onObjectsReady && onObjectsReady();
|
|
15
|
+
}
|
|
16
|
+
}, [objectsTree.length, onObjectsReady]);
|
|
17
|
+
function filterInteractionsByEvent(interactions, mouseEvent) {
|
|
18
|
+
if (!interactions)
|
|
19
|
+
return [];
|
|
20
|
+
return interactions.filter((interaction) => interaction.mouseEvent === mouseEvent);
|
|
21
|
+
}
|
|
22
|
+
const { executeInteraction } = useInteraction({
|
|
23
|
+
cameraSettings,
|
|
24
|
+
sequences,
|
|
25
|
+
});
|
|
26
|
+
const handleObjectClickHandler = (createdObject, ref, event) => {
|
|
27
|
+
console.log('Object clicked:', createdObject.meshSettings.name);
|
|
28
|
+
console.log('Object ref:', ref);
|
|
29
|
+
const clickInteractions = filterInteractionsByEvent(createdObject.actions, "click");
|
|
30
|
+
clickInteractions.forEach((interaction) => {
|
|
31
|
+
executeInteraction({ interaction, ref, createdObject });
|
|
32
|
+
});
|
|
33
|
+
if (handleObjectClick) {
|
|
34
|
+
handleObjectClick(createdObject, ref, event);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return (_jsx("group", { ref: groupRef, name: "main-objects", position: generalObjectSettings.meshSettings.position, rotation: generalObjectSettings.meshSettings.rotation, scale: generalObjectSettings.meshSettings.scale, children: objectsTree.map(node => (_jsx(ObjectNode, { node: node, cameraSettings: cameraSettings, onObjectReady: onObjectReady, handleObjectClick: handleObjectClickHandler }, node.objectId))) }));
|
|
38
|
+
});
|
|
39
|
+
ObjectsRenderer.displayName = 'ObjectsRenderer';
|
|
40
|
+
export default ObjectsRenderer;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CreatedObjectSettings, CameraState, GeneralObjectSettings } from "@3driseai/3drise-core";
|
|
3
|
+
import { type ThreeEvent } from "@react-three/fiber";
|
|
4
|
+
import { Object3D } from "three";
|
|
5
|
+
export interface ObjectsRendererApiProps {
|
|
6
|
+
objectIds: string[];
|
|
7
|
+
cameraSettings: CameraState;
|
|
8
|
+
generalObjectSettings: GeneralObjectSettings;
|
|
9
|
+
apiBaseUrl?: string;
|
|
10
|
+
onObjectsReady?: () => void;
|
|
11
|
+
handleObjectClick?: (object: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
12
|
+
onError?: (error: Error) => void;
|
|
13
|
+
onLoading?: (isLoading: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* ObjectsRendererApi
|
|
17
|
+
*
|
|
18
|
+
* A wrapper component that fetches scene objects by their IDs from the data-center API
|
|
19
|
+
* and passes them to ObjectsRenderer for 3D rendering.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <ObjectsRendererApi
|
|
23
|
+
* objectIds={['obj-1', 'obj-2', 'obj-3']}
|
|
24
|
+
* cameraSettings={cameraState}
|
|
25
|
+
* generalObjectSettings={generalSettings}
|
|
26
|
+
* apiBaseUrl="http://localhost:3001"
|
|
27
|
+
* />
|
|
28
|
+
*/
|
|
29
|
+
declare const ObjectsRendererApi: React.FC<ObjectsRendererApiProps>;
|
|
30
|
+
export default ObjectsRendererApi;
|
|
31
|
+
//# sourceMappingURL=ObjectsRendererApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectsRendererApi.d.ts","sourceRoot":"","sources":["../../src/components/ObjectsRendererApi.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,EAAE,WAAW,CAAC;IAC5B,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC1G,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAGD;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAyDzD,CAAC;AACF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import ObjectsRenderer from './ObjectsRenderer.js';
|
|
4
|
+
/**
|
|
5
|
+
* ObjectsRendererApi
|
|
6
|
+
*
|
|
7
|
+
* A wrapper component that fetches scene objects by their IDs from the data-center API
|
|
8
|
+
* and passes them to ObjectsRenderer for 3D rendering.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <ObjectsRendererApi
|
|
12
|
+
* objectIds={['obj-1', 'obj-2', 'obj-3']}
|
|
13
|
+
* cameraSettings={cameraState}
|
|
14
|
+
* generalObjectSettings={generalSettings}
|
|
15
|
+
* apiBaseUrl="http://localhost:3001"
|
|
16
|
+
* />
|
|
17
|
+
*/
|
|
18
|
+
const ObjectsRendererApi = ({ objectIds, cameraSettings, generalObjectSettings, apiBaseUrl = 'http://localhost:3001', onObjectsReady, handleObjectClick, onError, onLoading, }) => {
|
|
19
|
+
const [createdObjects, setCreatedObjects] = useState([]);
|
|
20
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
21
|
+
const [error, setError] = useState(null);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const fetchObjects = async () => {
|
|
24
|
+
try {
|
|
25
|
+
setIsLoading(true);
|
|
26
|
+
onLoading?.(true);
|
|
27
|
+
setError(null);
|
|
28
|
+
if (!objectIds || objectIds.length === 0) {
|
|
29
|
+
setCreatedObjects([]);
|
|
30
|
+
setIsLoading(false);
|
|
31
|
+
onLoading?.(false);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Fetch scene objects from the data-center API
|
|
35
|
+
const idsParam = objectIds.join(',');
|
|
36
|
+
const response = await fetch(`${apiBaseUrl}/api/data/scene-objects?ids=${encodeURIComponent(idsParam)}`, {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
headers: {
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
},
|
|
41
|
+
credentials: 'include', // Include cookies for authentication
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
throw new Error(`Failed to fetch scene objects: ${response.status} ${response.statusText}`);
|
|
45
|
+
}
|
|
46
|
+
const data = await response.json();
|
|
47
|
+
const objects = data.sceneObjects;
|
|
48
|
+
// Sort objects by their position in the original objectIds array to maintain order
|
|
49
|
+
const orderedObjects = objectIds
|
|
50
|
+
.map(id => objects.find(obj => obj.id === id))
|
|
51
|
+
.filter((obj) => obj !== undefined);
|
|
52
|
+
setCreatedObjects(orderedObjects);
|
|
53
|
+
setIsLoading(false);
|
|
54
|
+
onLoading?.(false);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
58
|
+
setError(error);
|
|
59
|
+
onError?.(error);
|
|
60
|
+
setIsLoading(false);
|
|
61
|
+
onLoading?.(false);
|
|
62
|
+
console.error('Failed to fetch scene objects:', error);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
fetchObjects();
|
|
66
|
+
}, [objectIds, apiBaseUrl, onError, onLoading]);
|
|
67
|
+
if (isLoading) {
|
|
68
|
+
return (_jsx("group", { children: _jsxs("mesh", { position: [0, 0, 0], children: [_jsx("sphereGeometry", { args: [0.5, 32, 32] }), _jsx("meshStandardMaterial", { color: 0x00ff00, wireframe: true })] }) }));
|
|
69
|
+
}
|
|
70
|
+
if (error) {
|
|
71
|
+
console.error('ObjectsRendererApi Error:', error);
|
|
72
|
+
return (_jsx("group", { children: _jsxs("mesh", { position: [0, 0, 0], children: [_jsx("sphereGeometry", { args: [0.5, 32, 32] }), _jsx("meshStandardMaterial", { color: 0xff0000, wireframe: true })] }) }));
|
|
73
|
+
}
|
|
74
|
+
return (_jsx(ObjectsRenderer, { cameraSettings: cameraSettings, createdObjects: createdObjects, generalObjectSettings: generalObjectSettings, onObjectsReady: onObjectsReady, handleObjectClick: handleObjectClick }));
|
|
75
|
+
};
|
|
76
|
+
export default ObjectsRendererApi;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface OceanProps {
|
|
4
|
+
settings: CreatedObjectSettings;
|
|
5
|
+
}
|
|
6
|
+
declare const Ocean: React.FC<OceanProps>;
|
|
7
|
+
export default Ocean;
|
|
8
|
+
//# sourceMappingURL=Ocean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ocean.d.ts","sourceRoot":"","sources":["../../src/components/Ocean.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,qBAAqB,CAAC;CACnC;AAGD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA6J/B,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { useMaterialApplication } from '../hooks/useMaterialApplication.js';
|
|
6
|
+
import { useWaterEnvironment } from '../hooks/useWaterEnvironment.js';
|
|
7
|
+
import { useWaterReflections } from '../hooks/useWaterReflections.js';
|
|
8
|
+
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
9
|
+
import { useNumericAnimation } from '../hooks/useNumericAnimation.js';
|
|
10
|
+
import { handleTransformAnimations, handleMaterialAnimations, handleTransformMouseMove, handleMaterialMouseMove, } from '@3driseai/3drise-core';
|
|
11
|
+
const Ocean = ({ settings }) => {
|
|
12
|
+
const meshRef = useRef(null);
|
|
13
|
+
const uniformOverrideRef = useRef(null);
|
|
14
|
+
const matAnimCacheRef = useRef({});
|
|
15
|
+
const [meshVisible, setMeshVisible] = useState(null);
|
|
16
|
+
const { meshSettings, materialSettings, animations, mouseMove } = settings;
|
|
17
|
+
const { animateNumeric } = useNumericAnimation();
|
|
18
|
+
const config = settings.config || {
|
|
19
|
+
planeSize: [10000, 10000],
|
|
20
|
+
planeSegments: 64,
|
|
21
|
+
};
|
|
22
|
+
const planeSize = config?.planeSize || [10000, 10000];
|
|
23
|
+
const planeSegments = config?.planeSegments || 64;
|
|
24
|
+
const position = meshSettings.position || [0, -1, 0];
|
|
25
|
+
const rotation = meshSettings.rotation || [-Math.PI / 2, 0, 0];
|
|
26
|
+
const scale = meshSettings.scale || 1;
|
|
27
|
+
useMaterialApplication(meshSettings.visible ? meshRef.current : null, materialSettings);
|
|
28
|
+
useWaterEnvironment(meshSettings.visible ? meshRef : { current: null });
|
|
29
|
+
useWaterReflections(meshSettings.visible ? meshRef : { current: null }, {
|
|
30
|
+
waterPosition: new THREE.Vector3(...position),
|
|
31
|
+
resolution: 256,
|
|
32
|
+
updateFrequency: 1,
|
|
33
|
+
enabled: meshSettings.visible,
|
|
34
|
+
});
|
|
35
|
+
useAnimationEvents({
|
|
36
|
+
onStepStart: (event) => {
|
|
37
|
+
if (!event.step?.transitions)
|
|
38
|
+
return;
|
|
39
|
+
for (const transition of event.step.transitions) {
|
|
40
|
+
if (transition.state !== 'ocean' || !meshRef.current)
|
|
41
|
+
continue;
|
|
42
|
+
const toProps = transition.properties.to || {};
|
|
43
|
+
const fromProps = transition.properties.from || {};
|
|
44
|
+
// visible — update state so JSX visible prop re-renders
|
|
45
|
+
if (toProps.visible !== undefined) {
|
|
46
|
+
setMeshVisible(toProps.visible);
|
|
47
|
+
}
|
|
48
|
+
// numeric uniforms: animate any key in `to` that maps to a shader uniform
|
|
49
|
+
const material = meshRef.current.material;
|
|
50
|
+
const uniforms = material?.uniforms;
|
|
51
|
+
if (!uniforms)
|
|
52
|
+
continue;
|
|
53
|
+
const from = {};
|
|
54
|
+
const to = {};
|
|
55
|
+
for (const key of Object.keys(toProps)) {
|
|
56
|
+
if (key === 'visible')
|
|
57
|
+
continue;
|
|
58
|
+
const toVal = toProps[key];
|
|
59
|
+
if (toVal === undefined)
|
|
60
|
+
continue;
|
|
61
|
+
to[key] = toVal;
|
|
62
|
+
const fromExplicit = fromProps[key];
|
|
63
|
+
if (fromExplicit !== undefined) {
|
|
64
|
+
from[key] = fromExplicit;
|
|
65
|
+
}
|
|
66
|
+
else if (uniforms[key]?.value !== undefined) {
|
|
67
|
+
const liveVal = uniforms[key].value;
|
|
68
|
+
if (typeof liveVal === 'number') {
|
|
69
|
+
from[key] = liveVal;
|
|
70
|
+
}
|
|
71
|
+
else if (liveVal?.toArray) {
|
|
72
|
+
from[key] = liveVal.toArray();
|
|
73
|
+
}
|
|
74
|
+
else if (Array.isArray(liveVal)) {
|
|
75
|
+
from[key] = [...liveVal];
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
from[key] = toVal;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
from[key] = toVal;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (Object.keys(to).length > 0) {
|
|
86
|
+
animateNumeric(from, to, (updated) => {
|
|
87
|
+
uniformOverrideRef.current = { ...uniformOverrideRef.current, ...updated };
|
|
88
|
+
}, () => {
|
|
89
|
+
uniformOverrideRef.current = null;
|
|
90
|
+
if (toProps.visible !== undefined)
|
|
91
|
+
setMeshVisible(null);
|
|
92
|
+
}, event.step?.duration);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
useFrame((state) => {
|
|
98
|
+
const mesh = meshRef.current;
|
|
99
|
+
if (!mesh?.material || !(meshVisible ?? meshSettings.visible))
|
|
100
|
+
return;
|
|
101
|
+
const material = mesh.material;
|
|
102
|
+
const uniforms = material?.uniforms;
|
|
103
|
+
if (!uniforms)
|
|
104
|
+
return;
|
|
105
|
+
const u_time = state.clock.getElapsedTime();
|
|
106
|
+
const mouse = state.pointer;
|
|
107
|
+
if (uniforms.u_time)
|
|
108
|
+
uniforms.u_time.value = u_time;
|
|
109
|
+
if (uniforms.u_cameraPosition)
|
|
110
|
+
uniforms.u_cameraPosition.value.copy(state.camera.position);
|
|
111
|
+
if (uniforms.u_resolution)
|
|
112
|
+
uniforms.u_resolution.value.set(window.innerWidth, window.innerHeight);
|
|
113
|
+
if (uniforms.u_mouse)
|
|
114
|
+
uniforms.u_mouse.value.set(mouse.x, mouse.y);
|
|
115
|
+
// Sequence-driven uniform overrides
|
|
116
|
+
if (uniformOverrideRef.current) {
|
|
117
|
+
for (const [key, val] of Object.entries(uniformOverrideRef.current)) {
|
|
118
|
+
if (!uniforms[key])
|
|
119
|
+
continue;
|
|
120
|
+
const target = uniforms[key].value;
|
|
121
|
+
if (typeof val === 'number') {
|
|
122
|
+
uniforms[key].value = val;
|
|
123
|
+
}
|
|
124
|
+
else if (Array.isArray(val)) {
|
|
125
|
+
if (target?.set) {
|
|
126
|
+
target.set(...val);
|
|
127
|
+
}
|
|
128
|
+
else if (target?.fromArray) {
|
|
129
|
+
target.fromArray(val);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
uniforms[key].value = val;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// ── PER-DOMAIN ANIMATIONS ───────────────────────────────────────────────
|
|
138
|
+
const now = Date.now();
|
|
139
|
+
const transformAnims = animations?.transform?.animations;
|
|
140
|
+
if (transformAnims?.length) {
|
|
141
|
+
handleTransformAnimations({ object: mesh, meshSettings: meshSettings, pathIsActive: false }, transformAnims, now, false);
|
|
142
|
+
}
|
|
143
|
+
const materialAnims = animations?.material?.animations;
|
|
144
|
+
if (materialAnims?.length) {
|
|
145
|
+
handleMaterialAnimations({ object: mesh, materialSettings: materialSettings, startValuesCache: matAnimCacheRef.current }, materialAnims, now, false);
|
|
146
|
+
}
|
|
147
|
+
// ── PER-DOMAIN MOUSE-MOVE ───────────────────────────────────────────────
|
|
148
|
+
const mm = mouseMove;
|
|
149
|
+
const isPerDomain = mm && ('transform' in mm || 'material' in mm);
|
|
150
|
+
if (isPerDomain) {
|
|
151
|
+
const md = mm;
|
|
152
|
+
if (md.transform?.enabled && md.transform.properties?.length) {
|
|
153
|
+
handleTransformMouseMove({ object: mesh, meshSettings: meshSettings }, md.transform.properties, mouse);
|
|
154
|
+
}
|
|
155
|
+
if (md.material?.enabled && md.material.properties?.length) {
|
|
156
|
+
handleMaterialMouseMove({ object: mesh, materialSettings: materialSettings }, md.material.properties, mouse);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
// console.log(rotation)
|
|
161
|
+
return (_jsx("mesh", { ref: meshRef,
|
|
162
|
+
// name={settings.meshSettings.name || 'Water'}
|
|
163
|
+
// position={position}
|
|
164
|
+
// rotation={rotation}
|
|
165
|
+
// scale={scale}
|
|
166
|
+
// visible={meshVisible ?? meshSettings.visible}
|
|
167
|
+
userData: { id: '3drise-water' }, children: _jsx("planeGeometry", { args: [planeSize[0], planeSize[1], planeSegments, planeSegments] }) }));
|
|
168
|
+
};
|
|
169
|
+
export default Ocean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Line } from '@react-three/drei';
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import type { BufferGeometry } from "three";
|
|
4
|
+
import { OutlineMode } from "./extractOutline";
|
|
5
|
+
type DreiLineProps = ComponentProps<typeof Line>;
|
|
6
|
+
export interface OutlineProps extends Omit<DreiLineProps, 'points' | 'segments' | 'ref' | 'geometry'> {
|
|
7
|
+
/** Any host geometry to outline. */
|
|
8
|
+
geometry: BufferGeometry;
|
|
9
|
+
/** '3d' = feature edges (uses `angle`), '2d' = flat front-plane profile. */
|
|
10
|
+
mode?: OutlineMode;
|
|
11
|
+
/** Dihedral threshold in degrees (3d mode only). */
|
|
12
|
+
angle?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Fat-line outline of any host geometry. Resolution-correct pixel width is
|
|
16
|
+
* handled by drei's <Line>. Color / lineWidth / dashed are forwarded straight
|
|
17
|
+
* through, so the parent owns all appearance.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Outline({ geometry, mode, angle, ...lineProps }: OutlineProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=Outline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Outline.d.ts","sourceRoot":"","sources":["../../src/components/Outline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,UAAU,GAAG,KAAK,GAAG,UAAU,CAAC;IACjG,oCAAoC;IACpC,QAAQ,EAAE,cAAc,CAAC;IACzB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAW,EAAE,KAAU,EAAE,GAAG,SAAS,EAAE,EAAE,YAAY,+BAKxF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Line } from '@react-three/drei';
|
|
3
|
+
import { useOutline } from '../hooks/useOutline.js';
|
|
4
|
+
/**
|
|
5
|
+
* Fat-line outline of any host geometry. Resolution-correct pixel width is
|
|
6
|
+
* handled by drei's <Line>. Color / lineWidth / dashed are forwarded straight
|
|
7
|
+
* through, so the parent owns all appearance.
|
|
8
|
+
*/
|
|
9
|
+
export function Outline({ geometry, mode = '3d', angle = 18, ...lineProps }) {
|
|
10
|
+
const points = useOutline(geometry, mode, angle);
|
|
11
|
+
if (points.length === 0)
|
|
12
|
+
return null;
|
|
13
|
+
return _jsx(Line, { points: points, segments: true, ...lineProps });
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ParticlesSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface ParticlesR3fProps {
|
|
4
|
+
particlesSettings: ParticlesSettings;
|
|
5
|
+
cameraFov?: number;
|
|
6
|
+
duration?: number;
|
|
7
|
+
transitionSettings?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
declare const ParticlesR3f: React.FC<ParticlesR3fProps>;
|
|
10
|
+
export default ParticlesR3f;
|
|
11
|
+
//# sourceMappingURL=ParticlesR3f.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParticlesR3f.d.ts","sourceRoot":"","sources":["../../src/components/ParticlesR3f.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,iBAAiB;IACvB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChD;AAMD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiG7C,CAAC;AACF,eAAe,YAAY,CAAC"}
|