@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,177 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
import { useFrame } from "@react-three/fiber";
|
|
3
|
+
import { animateUniforms, cacheChildrenWithMaterials, handleEdgesAnimations, handleMaterialAnimations, handleMaterialEffects, handleTransformAnimations, handleTransformEffect } from "@3driseai/3drise-core";
|
|
4
|
+
import usePathAnimation from "./usePathAnimation.js";
|
|
5
|
+
// â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
|
|
6
|
+
// DEBUG LOGGING
|
|
7
|
+
// â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
|
|
8
|
+
export const DEBUG_CONTINUOUS_EFFECTS = false;
|
|
9
|
+
const log = (message, ...args) => {
|
|
10
|
+
if (DEBUG_CONTINUOUS_EFFECTS) {
|
|
11
|
+
console.log(`[ObjectAnimations] ${message}`, ...args);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export const useContinuousEffects = (
|
|
15
|
+
// object: Object3D | null,
|
|
16
|
+
objectSettings, options = {}, object) => {
|
|
17
|
+
const { enabled = true, animateMaterial = true, hovered = false } = options;
|
|
18
|
+
// console.log("useObjectAnimation called with:", {
|
|
19
|
+
// object
|
|
20
|
+
// });
|
|
21
|
+
// const { object } = ref || {};
|
|
22
|
+
// Path animation hook for animations with pathId
|
|
23
|
+
const { startPathAnimation, updatePathAnimation, isAnimating: isPathAnimating, stopPathAnimation, } = usePathAnimation();
|
|
24
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
25
|
+
// REFS
|
|
26
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
27
|
+
// Track which path animation is currently active
|
|
28
|
+
const activePathIdRef = useRef(null);
|
|
29
|
+
const effectStateRef = useRef(null);
|
|
30
|
+
// Cache children with materials to avoid traverse() every frame
|
|
31
|
+
const childrenWithMaterialsRef = useRef([]);
|
|
32
|
+
const lastObjectRef = useRef(null);
|
|
33
|
+
// Cache start values for material animations
|
|
34
|
+
const startValuesRef = useRef({});
|
|
35
|
+
// Cache start values for edges animations
|
|
36
|
+
const edgesStartValuesRef = useRef({});
|
|
37
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
38
|
+
// DERIVED STATE (read from new continuous structure)
|
|
39
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
// Transform domain - now supports multiple effects (one per category)
|
|
41
|
+
const transformAnimations = objectSettings?.animations?.transform?.animations || [];
|
|
42
|
+
const transformEffects = objectSettings?.animations?.transform?.effects || [];
|
|
43
|
+
const enabledTransformEffects = transformEffects.filter(effect => effect.enabled);
|
|
44
|
+
const hasTransformEffects = enabledTransformEffects.length > 0;
|
|
45
|
+
const speed = objectSettings?.config?.speed ?? 1;
|
|
46
|
+
// Skip transform animations if any effect is enabled (effects take precedence)
|
|
47
|
+
const activeTransformAnimations = hasTransformEffects ? [] : transformAnimations;
|
|
48
|
+
const hasTransformAnimations = activeTransformAnimations.length > 0;
|
|
49
|
+
// Edges domain
|
|
50
|
+
const edgesAnimations = objectSettings?.animations?.edges?.animations || [];
|
|
51
|
+
const hasEdgesAnimations = edgesAnimations.length > 0;
|
|
52
|
+
// const effectsAnimations = objectSettings?.effects?.animations || [];
|
|
53
|
+
// const hasEffectsAnimations = effectsAnimations.length > 0;
|
|
54
|
+
// Material domain
|
|
55
|
+
const materialAnimations = objectSettings?.animations?.material?.animations || [];
|
|
56
|
+
const materialEffects = objectSettings?.animations?.material?.effects || [];
|
|
57
|
+
const enabledMaterialEffects = materialEffects.filter(effect => effect.enabled);
|
|
58
|
+
const hasMaterialEffects = enabledMaterialEffects.length > 0;
|
|
59
|
+
// Skip material animations if any effect is enabled (effects take precedence)
|
|
60
|
+
const activeMaterialAnimations = hasMaterialEffects ? [] : materialAnimations;
|
|
61
|
+
const hasMaterialAnimations = activeMaterialAnimations.length > 0;
|
|
62
|
+
// Combined check for any animations
|
|
63
|
+
const hasAnimations = hasTransformAnimations || hasMaterialAnimations;
|
|
64
|
+
// Continuous effects config
|
|
65
|
+
const applyToChildren = false;
|
|
66
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
67
|
+
// CACHE CHILDREN WITH MATERIALS
|
|
68
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!object || object === lastObjectRef.current)
|
|
71
|
+
return;
|
|
72
|
+
lastObjectRef.current = object;
|
|
73
|
+
childrenWithMaterialsRef.current = cacheChildrenWithMaterials(object);
|
|
74
|
+
log('cached children with materials', {
|
|
75
|
+
count: childrenWithMaterialsRef.current.length,
|
|
76
|
+
objectName: object.name
|
|
77
|
+
});
|
|
78
|
+
// Reset start values cache when object changes
|
|
79
|
+
startValuesRef.current = {};
|
|
80
|
+
edgesStartValuesRef.current = {};
|
|
81
|
+
}, [object]);
|
|
82
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
83
|
+
// PATH ANIMATION LIFECYCLE
|
|
84
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!enabled || !object)
|
|
87
|
+
return;
|
|
88
|
+
// Path animations come from transform.animations
|
|
89
|
+
const animations = objectSettings?.animations?.transform?.animations || [];
|
|
90
|
+
const pathAnimation = animations.find(anim => anim.pathId && anim.active);
|
|
91
|
+
if (pathAnimation?.pathId) {
|
|
92
|
+
// Start path animation if not already active or if pathId changed
|
|
93
|
+
if (activePathIdRef.current !== pathAnimation.pathId) {
|
|
94
|
+
activePathIdRef.current = pathAnimation.pathId;
|
|
95
|
+
log('starting path animation', { pathId: pathAnimation.pathId, duration: pathAnimation.duration });
|
|
96
|
+
startPathAnimation(pathAnimation.pathId, pathAnimation.duration / 1000, {
|
|
97
|
+
ease: pathAnimation.ease,
|
|
98
|
+
loop: pathAnimation.loop,
|
|
99
|
+
yoyo: pathAnimation.yoyo,
|
|
100
|
+
applyRotation: pathAnimation.applyRotation,
|
|
101
|
+
offset: pathAnimation.offset,
|
|
102
|
+
keepOriginalTransform: pathAnimation.keepOriginalTransform,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (activePathIdRef.current) {
|
|
107
|
+
// Stop path animation if no longer active
|
|
108
|
+
// log('stopping path animation', { pathId: activePathIdRef.current });
|
|
109
|
+
stopPathAnimation();
|
|
110
|
+
activePathIdRef.current = null;
|
|
111
|
+
}
|
|
112
|
+
}, [enabled, objectSettings?.animations?.transform?.animations, object, startPathAnimation, stopPathAnimation]);
|
|
113
|
+
// console.log(objectSettings?.meshSettings.name, hovered)
|
|
114
|
+
useFrame((state, delta) => {
|
|
115
|
+
// console.log({
|
|
116
|
+
// enabled,
|
|
117
|
+
// object,
|
|
118
|
+
// objectSettings,
|
|
119
|
+
// })
|
|
120
|
+
if (!enabled || !object || !objectSettings)
|
|
121
|
+
return;
|
|
122
|
+
const time = state.clock.getElapsedTime();
|
|
123
|
+
const mouse = state.pointer;
|
|
124
|
+
const currentTime = Date.now();
|
|
125
|
+
// Update path animation if active
|
|
126
|
+
const pathIsActive = isPathAnimating();
|
|
127
|
+
if (pathIsActive) {
|
|
128
|
+
updatePathAnimation(delta, object);
|
|
129
|
+
}
|
|
130
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
131
|
+
// TRANSFORM DOMAIN
|
|
132
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
133
|
+
if (hasTransformAnimations) {
|
|
134
|
+
handleTransformAnimations({
|
|
135
|
+
object,
|
|
136
|
+
meshSettings: objectSettings.meshSettings || {},
|
|
137
|
+
pathIsActive,
|
|
138
|
+
}, activeTransformAnimations, currentTime, hovered);
|
|
139
|
+
}
|
|
140
|
+
// Handle transform effect (wave, float, spin, etc.) - now supports multiple effects
|
|
141
|
+
if (hasTransformEffects) {
|
|
142
|
+
handleTransformEffect(object, enabledTransformEffects, time, delta, effectStateRef, hovered);
|
|
143
|
+
}
|
|
144
|
+
if (hasEdgesAnimations) {
|
|
145
|
+
handleEdgesAnimations({ object, startValuesCache: edgesStartValuesRef.current }, edgesAnimations, currentTime, hovered);
|
|
146
|
+
}
|
|
147
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
148
|
+
// MATERIAL DOMAIN
|
|
149
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
150
|
+
if (animateMaterial) {
|
|
151
|
+
// Handle material animations (any material property)
|
|
152
|
+
if (hasMaterialAnimations) {
|
|
153
|
+
handleMaterialAnimations({
|
|
154
|
+
object,
|
|
155
|
+
materialSettings: objectSettings.materialSettings || {},
|
|
156
|
+
startValuesCache: startValuesRef.current,
|
|
157
|
+
}, activeMaterialAnimations, currentTime, hovered);
|
|
158
|
+
}
|
|
159
|
+
// Handle material effects (color effects)
|
|
160
|
+
if (enabledMaterialEffects.length > 0) {
|
|
161
|
+
handleMaterialEffects(object, enabledMaterialEffects, time, delta, effectStateRef, applyToChildren);
|
|
162
|
+
}
|
|
163
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
164
|
+
// EDGES DOMAIN
|
|
165
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
166
|
+
// Animate uniforms (u_time, u_mouse, u_camera_position)
|
|
167
|
+
// console.log(time)
|
|
168
|
+
}
|
|
169
|
+
// console.log(enabled)
|
|
170
|
+
animateUniforms(childrenWithMaterialsRef.current, time * speed, mouse, state.camera.position);
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
isPathAnimating,
|
|
174
|
+
effectStateRef,
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export default useContinuousEffects;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { TimeSettings, HdrSettings } from '@3driseai/3drise-core';
|
|
3
|
+
export interface UseCubeCameraOptions {
|
|
4
|
+
hdrSettings: HdrSettings;
|
|
5
|
+
skyVisible: boolean;
|
|
6
|
+
sunSystemVisible: boolean;
|
|
7
|
+
timeSettings: TimeSettings;
|
|
8
|
+
resolution?: number;
|
|
9
|
+
position?: THREE.Vector3;
|
|
10
|
+
onEnvironmentUpdate?: (texture: THREE.Texture) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useCubeCamera: (options: UseCubeCameraOptions) => {
|
|
13
|
+
cubeCamera: THREE.CubeCamera | null;
|
|
14
|
+
updateEnvironment: () => THREE.Texture | null;
|
|
15
|
+
initializeCubeCamera: () => THREE.CubeCamera | null;
|
|
16
|
+
dispose: () => void;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useCubeCamera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCubeCamera.d.ts","sourceRoot":"","sources":["../../src/hooks/useCubeCamera.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB,KAAG;IACtD,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IACpC,iBAAiB,EAAE,MAAM,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;IAC9C,oBAAoB,EAAE,MAAM,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IACpD,OAAO,EAAE,MAAM,IAAI,CAAC;CAqE3B,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import { useThree, useFrame } from '@react-three/fiber';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { createCubeCamera, updateCubeCamera, disposeCubeCamera, setSceneEnvironment, clearSceneEnvironment, } from '@3driseai/3drise-core';
|
|
5
|
+
export const useCubeCamera = (options) => {
|
|
6
|
+
const { hdrSettings, skyVisible, sunSystemVisible, timeSettings, resolution = 512, position = new THREE.Vector3(0, 50, 0), onEnvironmentUpdate } = options;
|
|
7
|
+
const { scene, gl: renderer } = useThree();
|
|
8
|
+
const cubeCameraRef = useRef(null);
|
|
9
|
+
const isUpdatingRef = useRef(false);
|
|
10
|
+
const hdrActive = hdrSettings.visible && (hdrSettings.name || (hdrSettings.urls && hdrSettings.urls.length > 0)) ? true : false;
|
|
11
|
+
const initializeCubeCamera = useCallback(() => {
|
|
12
|
+
if (!renderer || !scene)
|
|
13
|
+
return null;
|
|
14
|
+
if (cubeCameraRef.current)
|
|
15
|
+
disposeCubeCamera(cubeCameraRef.current, scene);
|
|
16
|
+
cubeCameraRef.current = createCubeCamera(scene, resolution, position);
|
|
17
|
+
return cubeCameraRef.current;
|
|
18
|
+
}, [scene, renderer, resolution, position]);
|
|
19
|
+
const updateEnvironment = useCallback(() => {
|
|
20
|
+
if (!cubeCameraRef.current || !renderer || !scene)
|
|
21
|
+
return null;
|
|
22
|
+
if (isUpdatingRef.current)
|
|
23
|
+
return null;
|
|
24
|
+
try {
|
|
25
|
+
isUpdatingRef.current = true;
|
|
26
|
+
const texture = updateCubeCamera(cubeCameraRef.current, renderer, scene);
|
|
27
|
+
setSceneEnvironment(scene, texture);
|
|
28
|
+
onEnvironmentUpdate?.(texture);
|
|
29
|
+
return texture;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
isUpdatingRef.current = false;
|
|
36
|
+
}
|
|
37
|
+
}, [scene, renderer, onEnvironmentUpdate]);
|
|
38
|
+
const dispose = useCallback(() => {
|
|
39
|
+
if (cubeCameraRef.current && scene) {
|
|
40
|
+
disposeCubeCamera(cubeCameraRef.current, scene);
|
|
41
|
+
cubeCameraRef.current = null;
|
|
42
|
+
}
|
|
43
|
+
}, [scene]);
|
|
44
|
+
// Create or dispose cube camera based on active sky / HDR state
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (hdrActive) {
|
|
47
|
+
dispose();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (skyVisible || sunSystemVisible) {
|
|
51
|
+
initializeCubeCamera();
|
|
52
|
+
updateEnvironment();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
dispose();
|
|
56
|
+
clearSceneEnvironment(scene);
|
|
57
|
+
}
|
|
58
|
+
}, [hdrActive, skyVisible, sunSystemVisible]);
|
|
59
|
+
// Live update when auto-animating (sky moves, environment changes)
|
|
60
|
+
const UPDATE_INTERVAL_MS = 300;
|
|
61
|
+
useFrame((state) => {
|
|
62
|
+
if (hdrActive || !(skyVisible || sunSystemVisible))
|
|
63
|
+
return;
|
|
64
|
+
if (!timeSettings.autoAnimate)
|
|
65
|
+
return;
|
|
66
|
+
if (state.clock.getElapsedTime() * 1000 > UPDATE_INTERVAL_MS) {
|
|
67
|
+
updateEnvironment();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
// Cleanup on unmount
|
|
71
|
+
useEffect(() => () => dispose(), [dispose]);
|
|
72
|
+
return { cubeCamera: cubeCameraRef.current, updateEnvironment, initializeCubeCamera, dispose };
|
|
73
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TimeSettings } from '@3driseai/3drise-core';
|
|
2
|
+
export interface UseEnvironmentEffectsOptions {
|
|
3
|
+
updateEnvironment: () => void;
|
|
4
|
+
skyVisible: boolean;
|
|
5
|
+
sunSystemVisible: boolean;
|
|
6
|
+
timeSettings: TimeSettings;
|
|
7
|
+
updateDelay?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const useEnvironmentEffects: (options: UseEnvironmentEffectsOptions) => {
|
|
10
|
+
triggerUpdate: () => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useEnvironmentEffects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEnvironmentEffects.d.ts","sourceRoot":"","sources":["../../src/hooks/useEnvironmentEffects.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,4BAA4B;IACzC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,GAAI,SAAS,4BAA4B,KAAG;IACtE,aAAa,EAAE,MAAM,IAAI,CAAC;CAoBjC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import { createDebouncedUpdate } from '@3driseai/3drise-core';
|
|
3
|
+
export const useEnvironmentEffects = (options) => {
|
|
4
|
+
const { updateEnvironment, skyVisible, sunSystemVisible, timeSettings, updateDelay = 50 } = options;
|
|
5
|
+
const debouncedUpdate = useRef(createDebouncedUpdate(updateEnvironment, updateDelay));
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
debouncedUpdate.current = createDebouncedUpdate(updateEnvironment, updateDelay);
|
|
8
|
+
}, [updateEnvironment, updateDelay]);
|
|
9
|
+
// Trigger debounced update when sky visibility changes
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
debouncedUpdate.current();
|
|
12
|
+
}, [skyVisible, sunSystemVisible]);
|
|
13
|
+
// Trigger update when time settings change
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (timeSettings.enabled)
|
|
16
|
+
updateEnvironment();
|
|
17
|
+
}, [timeSettings, updateEnvironment]);
|
|
18
|
+
const triggerUpdate = useCallback(() => {
|
|
19
|
+
updateEnvironment();
|
|
20
|
+
}, [updateEnvironment]);
|
|
21
|
+
return { triggerUpdate };
|
|
22
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import type { CameraState, Vector2Array } from "@3driseai/3drise-core";
|
|
3
|
+
interface FrameAnimationOptions {
|
|
4
|
+
distance?: number;
|
|
5
|
+
scale?: Vector2Array;
|
|
6
|
+
duration?: number;
|
|
7
|
+
ease?: string;
|
|
8
|
+
onComplete?: () => void;
|
|
9
|
+
onStart?: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Custom hook for frame animations (moveToFront and zoom)
|
|
13
|
+
* Can be used in any component that needs to animate frames
|
|
14
|
+
*/
|
|
15
|
+
export declare const useFrameAnimations: (cameraSettings: CameraState) => {
|
|
16
|
+
moveToFront: (object: THREE.Object3D, options?: FrameAnimationOptions) => void;
|
|
17
|
+
zoomToFrame: (object: THREE.Object3D, options?: FrameAnimationOptions) => void;
|
|
18
|
+
restoreOriginalTransform: (object: THREE.Object3D, options?: FrameAnimationOptions) => void;
|
|
19
|
+
storeOriginalTransform: (object: THREE.Object3D) => void;
|
|
20
|
+
restoreCamera: (options?: FrameAnimationOptions) => void;
|
|
21
|
+
storeOriginalCameraState: () => void;
|
|
22
|
+
};
|
|
23
|
+
export default useFrameAnimations;
|
|
24
|
+
//# sourceMappingURL=useFrameAnimations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFrameAnimations.d.ts","sourceRoot":"","sources":["../../src/hooks/useFrameAnimations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACvE,UAAU,qBAAqB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AASD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,WAAW,KAAG;IACzD,WAAW,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC/E,WAAW,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC/E,wBAAwB,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC5F,sBAAsB,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzD,wBAAwB,EAAE,MAAM,IAAI,CAAC;CAyM5C,CAAC;AACF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import cameraManager from "../utils/CameraSingleton.js";
|
|
4
|
+
import { useGsapAnimation } from "../hooks/useGsapAnimation.js";
|
|
5
|
+
import useCameraAnimation from "./useCameraAnimation.js";
|
|
6
|
+
const DEFAULT_OPTIONS = {
|
|
7
|
+
distance: 5,
|
|
8
|
+
scale: [2, 2],
|
|
9
|
+
duration: 1.0,
|
|
10
|
+
ease: "power2.out"
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Custom hook for frame animations (moveToFront and zoom)
|
|
14
|
+
* Can be used in any component that needs to animate frames
|
|
15
|
+
*/
|
|
16
|
+
export const useFrameAnimations = (cameraSettings) => {
|
|
17
|
+
const { animateObjects } = useGsapAnimation();
|
|
18
|
+
const { animateCamera } = useCameraAnimation({
|
|
19
|
+
autoAnimate: false,
|
|
20
|
+
defaultDuration: 1.0,
|
|
21
|
+
defaultEase: "power2.out"
|
|
22
|
+
});
|
|
23
|
+
// Store original transforms for each object by its UUID - use useRef to persist across renders
|
|
24
|
+
const originalTransformsRef = useRef(new Map());
|
|
25
|
+
const originalTransforms = originalTransformsRef.current;
|
|
26
|
+
// Store original camera state - use useRef to persist across renders
|
|
27
|
+
const originalCameraStateRef = useRef(null);
|
|
28
|
+
/**
|
|
29
|
+
* Stores the current camera position and controls target before animation
|
|
30
|
+
*/
|
|
31
|
+
const storeOriginalCameraState = () => {
|
|
32
|
+
if (!originalCameraStateRef.current) {
|
|
33
|
+
const cameraPos = cameraManager.getPosition();
|
|
34
|
+
const currentTarget = cameraSettings.controls.target;
|
|
35
|
+
if (cameraPos && currentTarget) {
|
|
36
|
+
originalCameraStateRef.current = {
|
|
37
|
+
position: cameraPos.clone(),
|
|
38
|
+
target: new THREE.Vector3(currentTarget[0], currentTarget[1], currentTarget[2])
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Restores the camera to its original position and controls target
|
|
45
|
+
* @param options - Configuration options for the animation
|
|
46
|
+
*/
|
|
47
|
+
const restoreCamera = (options = {}) => {
|
|
48
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
49
|
+
const original = originalCameraStateRef.current;
|
|
50
|
+
if (!original) {
|
|
51
|
+
console.warn("No original camera state found");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// Animate camera back to original position
|
|
55
|
+
animateCamera({
|
|
56
|
+
position: [original.position.x, original.position.y, original.position.z]
|
|
57
|
+
}, opts.duration, opts.ease, [original.target.x, original.target.y, original.target.z]).then(() => {
|
|
58
|
+
// Clear stored camera state after restoring
|
|
59
|
+
originalCameraStateRef.current = null;
|
|
60
|
+
opts.onComplete?.();
|
|
61
|
+
});
|
|
62
|
+
// Call onStart callback if provided
|
|
63
|
+
opts.onStart?.();
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Stores the current transform of an object before animation
|
|
67
|
+
* @param object - The THREE.Group object to store transforms for
|
|
68
|
+
*/
|
|
69
|
+
const storeOriginalTransform = (object) => {
|
|
70
|
+
if (!originalTransforms.has(object.uuid)) {
|
|
71
|
+
originalTransforms.set(object.uuid, {
|
|
72
|
+
position: object.position.clone(),
|
|
73
|
+
rotation: object.rotation.clone(),
|
|
74
|
+
scale: object.scale.clone()
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Restores an object to its original transform
|
|
80
|
+
* @param object - The THREE.Group object to restore
|
|
81
|
+
* @param options - Configuration options for the animation
|
|
82
|
+
*/
|
|
83
|
+
const restoreOriginalTransform = (object, options = {}) => {
|
|
84
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
85
|
+
const original = originalTransforms.get(object.uuid);
|
|
86
|
+
if (!original) {
|
|
87
|
+
console.warn("No original transform found for object", object.uuid);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// Animate back to original transform
|
|
91
|
+
animateObjects([object], {
|
|
92
|
+
duration: opts.duration,
|
|
93
|
+
ease: opts.ease,
|
|
94
|
+
position: [original.position.x, original.position.y, original.position.z],
|
|
95
|
+
rotation: [original.rotation.x, original.rotation.y, original.rotation.z],
|
|
96
|
+
scale: [original.scale.x, original.scale.y, original.scale.z],
|
|
97
|
+
onComplete: () => {
|
|
98
|
+
// Remove from stored transforms after restoring
|
|
99
|
+
originalTransforms.delete(object.uuid);
|
|
100
|
+
opts.onComplete?.();
|
|
101
|
+
},
|
|
102
|
+
onStart: opts.onStart
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Moves a frame to appear in front of the camera
|
|
107
|
+
* The frame will be positioned relative to the camera's current position and direction
|
|
108
|
+
* @param object - The THREE.Group object representing the frame
|
|
109
|
+
* @param options - Configuration options for the animation
|
|
110
|
+
*/
|
|
111
|
+
const moveToFront = (object, options = {}) => {
|
|
112
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
113
|
+
// Store original transform before animating
|
|
114
|
+
storeOriginalTransform(object);
|
|
115
|
+
// Get camera information from singleton
|
|
116
|
+
const cameraPos = cameraManager.getPosition();
|
|
117
|
+
const cameraDirection = cameraManager.getWorldDirection();
|
|
118
|
+
if (!cameraPos || !cameraDirection) {
|
|
119
|
+
console.warn("Camera not available for moveToFront animation");
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
// Calculate target position in world space (in front of camera)
|
|
123
|
+
const targetWorldPosition = cameraPos.clone()
|
|
124
|
+
.add(cameraDirection.multiplyScalar(opts.distance));
|
|
125
|
+
// Convert world position to local position relative to parent
|
|
126
|
+
const parent = object.parent;
|
|
127
|
+
const targetLocalPosition = targetWorldPosition.clone();
|
|
128
|
+
if (parent) {
|
|
129
|
+
parent.worldToLocal(targetLocalPosition);
|
|
130
|
+
}
|
|
131
|
+
// Calculate rotation to face camera in world space
|
|
132
|
+
const directionToCamera = new THREE.Vector3()
|
|
133
|
+
.subVectors(cameraPos, targetWorldPosition)
|
|
134
|
+
.normalize();
|
|
135
|
+
// Create world quaternion that faces the camera
|
|
136
|
+
const frameDefaultForward = new THREE.Vector3(0, 0, 1);
|
|
137
|
+
const worldQuaternion = new THREE.Quaternion().setFromUnitVectors(frameDefaultForward, directionToCamera);
|
|
138
|
+
// Convert world quaternion to local quaternion relative to parent
|
|
139
|
+
const localQuaternion = worldQuaternion.clone();
|
|
140
|
+
if (parent) {
|
|
141
|
+
const parentWorldQuaternion = new THREE.Quaternion();
|
|
142
|
+
parent.getWorldQuaternion(parentWorldQuaternion);
|
|
143
|
+
const parentWorldQuaternionInverse = parentWorldQuaternion.clone().invert();
|
|
144
|
+
localQuaternion.premultiply(parentWorldQuaternionInverse);
|
|
145
|
+
}
|
|
146
|
+
// Convert local quaternion to Euler angles for GSAP animation
|
|
147
|
+
const targetRotation = new THREE.Euler().setFromQuaternion(localQuaternion);
|
|
148
|
+
// Animate the frame using GSAP
|
|
149
|
+
animateObjects([object], {
|
|
150
|
+
duration: opts.duration,
|
|
151
|
+
ease: opts.ease,
|
|
152
|
+
position: [targetLocalPosition.x, targetLocalPosition.y, targetLocalPosition.z],
|
|
153
|
+
rotation: [targetRotation.x, targetRotation.y, targetRotation.z],
|
|
154
|
+
scale: [opts.scale[0], opts.scale[1], 1],
|
|
155
|
+
onComplete: opts.onComplete,
|
|
156
|
+
onStart: opts.onStart
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Zooms the camera to focus on a specific frame
|
|
161
|
+
* The camera will move to a position in front of the frame from the current camera direction
|
|
162
|
+
* @param object - The THREE.Group object representing the frame
|
|
163
|
+
* @param options - Configuration options for the animation
|
|
164
|
+
*/
|
|
165
|
+
const zoomToFrame = (object, options = {}) => {
|
|
166
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
167
|
+
// Store original camera state before animating
|
|
168
|
+
storeOriginalCameraState();
|
|
169
|
+
// Get current camera position
|
|
170
|
+
const cameraPos = cameraManager.getPosition();
|
|
171
|
+
if (!cameraPos) {
|
|
172
|
+
console.warn("Camera not available for zoomToFrame animation");
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// Get frame's world position
|
|
176
|
+
const frameWorldPos = new THREE.Vector3();
|
|
177
|
+
object.getWorldPosition(frameWorldPos);
|
|
178
|
+
// Get frame's forward direction in world space (positive Z axis by default)
|
|
179
|
+
const frameForward = new THREE.Vector3(0, 0, 1);
|
|
180
|
+
const frameWorldQuaternion = new THREE.Quaternion();
|
|
181
|
+
object.getWorldQuaternion(frameWorldQuaternion);
|
|
182
|
+
frameForward.applyQuaternion(frameWorldQuaternion);
|
|
183
|
+
// Calculate the direction from frame to current camera position
|
|
184
|
+
const frameToCameraDirection = new THREE.Vector3()
|
|
185
|
+
.subVectors(cameraPos, frameWorldPos)
|
|
186
|
+
.normalize();
|
|
187
|
+
// Determine which side of the frame the camera is on
|
|
188
|
+
// by checking the dot product of the frame's forward vector and the frame-to-camera direction
|
|
189
|
+
const dotProduct = frameForward.dot(frameToCameraDirection);
|
|
190
|
+
// If dot product is negative, camera is on the back side, so flip the forward direction
|
|
191
|
+
const adjustedForward = frameForward.clone();
|
|
192
|
+
if (dotProduct < 0) {
|
|
193
|
+
adjustedForward.negate();
|
|
194
|
+
}
|
|
195
|
+
// Position camera in front of the frame on the same side as current camera position
|
|
196
|
+
const targetCameraPos = frameWorldPos.clone()
|
|
197
|
+
.add(adjustedForward.multiplyScalar(opts.distance));
|
|
198
|
+
// Animate camera to new position
|
|
199
|
+
animateCamera({
|
|
200
|
+
position: [targetCameraPos.x, targetCameraPos.y, targetCameraPos.z]
|
|
201
|
+
}, opts.duration, opts.ease, [frameWorldPos.x, frameWorldPos.y, frameWorldPos.z]).then(() => {
|
|
202
|
+
// Call onComplete callback if provided
|
|
203
|
+
opts.onComplete?.();
|
|
204
|
+
});
|
|
205
|
+
// Call onStart callback if provided
|
|
206
|
+
opts.onStart?.();
|
|
207
|
+
};
|
|
208
|
+
return {
|
|
209
|
+
moveToFront,
|
|
210
|
+
zoomToFrame,
|
|
211
|
+
restoreOriginalTransform,
|
|
212
|
+
storeOriginalTransform,
|
|
213
|
+
restoreCamera,
|
|
214
|
+
storeOriginalCameraState
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
export default useFrameAnimations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFrameEffects.d.ts","sourceRoot":"","sources":["../../src/hooks/useFrameEffects.ts"],"names":[],"mappings":"AACA,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG;IAC5C,kBAAkB,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;CACpB,CAiBJ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback, useState, useRef } from "react";
|
|
2
|
+
export function useFrameEffects(isActive) {
|
|
3
|
+
const [hovered, setHovered] = useState(false);
|
|
4
|
+
const hoveredRef = useRef(false);
|
|
5
|
+
const handlePointerEnter = useCallback((e) => {
|
|
6
|
+
e.stopPropagation();
|
|
7
|
+
if (!isActive && !hoveredRef.current) {
|
|
8
|
+
hoveredRef.current = true;
|
|
9
|
+
setHovered(true);
|
|
10
|
+
}
|
|
11
|
+
}, [isActive]);
|
|
12
|
+
const handlePointerLeave = useCallback(() => {
|
|
13
|
+
if (!isActive && hoveredRef.current) {
|
|
14
|
+
hoveredRef.current = false;
|
|
15
|
+
setHovered(false);
|
|
16
|
+
}
|
|
17
|
+
}, [isActive]);
|
|
18
|
+
return { handlePointerEnter, handlePointerLeave, hovered };
|
|
19
|
+
}
|