@3driseai/3drise-viewer 0.1.1 → 0.1.3
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 +2 -1
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +11 -3
- package/dist/components/Bubbles.d.ts +2 -1
- package/dist/components/Bubbles.d.ts.map +1 -1
- package/dist/components/Bubbles.js +5 -2
- package/dist/components/CameraController.d.ts +9 -1
- package/dist/components/CameraController.d.ts.map +1 -1
- package/dist/components/CameraController.js +12 -1
- package/dist/components/Clouds.d.ts +2 -1
- package/dist/components/Clouds.d.ts.map +1 -1
- package/dist/components/Clouds.js +3 -1
- package/dist/components/CreatedObject.d.ts +2 -2
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +5 -6
- package/dist/components/CustomPrimitive.d.ts +2 -2
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +6 -2
- package/dist/components/Earth.d.ts +2 -4
- package/dist/components/Earth.d.ts.map +1 -1
- package/dist/components/Earth.js +6 -4
- package/dist/components/EffectsGenerator.d.ts +2 -1
- package/dist/components/EffectsGenerator.d.ts.map +1 -1
- package/dist/components/EffectsGenerator.js +26 -25
- package/dist/components/EffectsGroup.d.ts +2 -1
- package/dist/components/EffectsGroup.d.ts.map +1 -1
- package/dist/components/EffectsGroup.js +7 -2
- package/dist/components/EnvironmentManager.js +2 -2
- package/dist/components/EnvironmentObject.d.ts +2 -1
- package/dist/components/EnvironmentObject.d.ts.map +1 -1
- package/dist/components/EnvironmentObject.js +2 -2
- package/dist/components/Frame.d.ts +3 -2
- package/dist/components/Frame.d.ts.map +1 -1
- package/dist/components/Frame.js +3 -1
- package/dist/components/Galaxy.d.ts +2 -3
- package/dist/components/Galaxy.d.ts.map +1 -1
- package/dist/components/Galaxy.js +10 -10
- package/dist/components/GalleryLayout.d.ts +2 -1
- package/dist/components/GalleryLayout.d.ts.map +1 -1
- package/dist/components/GalleryLayout.js +3 -1
- package/dist/components/GeometryShape.d.ts +4 -6
- package/dist/components/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +50 -31
- package/dist/components/Glyphs.d.ts +2 -1
- package/dist/components/Glyphs.d.ts.map +1 -1
- package/dist/components/Glyphs.js +6 -2
- package/dist/components/GridHelper.d.ts +2 -1
- package/dist/components/GridHelper.d.ts.map +1 -1
- package/dist/components/GridHelper.js +3 -1
- package/dist/components/GridsGenerator.d.ts +2 -1
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +12 -4
- package/dist/components/HdrPlaylistRenderer.d.ts +2 -1
- package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -1
- package/dist/components/HdrPlaylistRenderer.js +3 -1
- package/dist/components/Lensflare.d.ts +2 -1
- package/dist/components/Lensflare.d.ts.map +1 -1
- package/dist/components/Lensflare.js +3 -1
- package/dist/components/Letter.d.ts +3 -2
- package/dist/components/Letter.d.ts.map +1 -1
- package/dist/components/Letter.js +3 -1
- package/dist/components/Letters.d.ts +3 -2
- package/dist/components/Letters.d.ts.map +1 -1
- package/dist/components/Letters.js +3 -1
- package/dist/components/LightObject.d.ts +2 -1
- package/dist/components/LightObject.d.ts.map +1 -1
- package/dist/components/LightObject.js +11 -7
- package/dist/components/LightsManager.d.ts +2 -1
- package/dist/components/LightsManager.d.ts.map +1 -1
- package/dist/components/LightsManager.js +6 -3
- package/dist/components/Lines.d.ts +2 -1
- package/dist/components/Lines.d.ts.map +1 -1
- package/dist/components/Lines.js +2 -2
- package/dist/components/Moon.d.ts +2 -3
- package/dist/components/Moon.d.ts.map +1 -1
- package/dist/components/Moon.js +6 -4
- package/dist/components/MyGrid.d.ts +3 -2
- package/dist/components/MyGrid.d.ts.map +1 -1
- package/dist/components/MyGrid.js +5 -2
- package/dist/components/ObjectNode.d.ts +2 -2
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +29 -24
- package/dist/components/ObjectNodeApi.d.ts +2 -2
- package/dist/components/ObjectNodeApi.d.ts.map +1 -1
- package/dist/components/ObjectNodeApi.js +2 -2
- package/dist/components/ObjectsRenderer.d.ts +2 -1
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +15 -4
- package/dist/components/ObjectsRendererApi.d.ts +2 -1
- package/dist/components/ObjectsRendererApi.d.ts.map +1 -1
- package/dist/components/ObjectsRendererApi.js +2 -2
- package/dist/components/Ocean.d.ts +2 -1
- package/dist/components/Ocean.d.ts.map +1 -1
- package/dist/components/Ocean.js +3 -1
- package/dist/components/Outline.d.ts +3 -2
- package/dist/components/Outline.d.ts.map +1 -1
- package/dist/components/Outline.js +6 -2
- package/dist/components/ParticlesR3f.d.ts +2 -1
- package/dist/components/ParticlesR3f.d.ts.map +1 -1
- package/dist/components/ParticlesR3f.js +3 -1
- package/dist/components/Path.d.ts +2 -1
- package/dist/components/Path.d.ts.map +1 -1
- package/dist/components/Path.js +14 -3
- package/dist/components/PathGeometry.d.ts +2 -1
- package/dist/components/PathGeometry.d.ts.map +1 -1
- package/dist/components/PathGeometry.js +6 -2
- package/dist/components/PathRenderer.d.ts +2 -1
- package/dist/components/PathRenderer.d.ts.map +1 -1
- package/dist/components/PathRenderer.js +6 -2
- package/dist/components/Planet.d.ts +2 -3
- package/dist/components/Planet.d.ts.map +1 -1
- package/dist/components/Planet.js +6 -4
- package/dist/components/PointCloud.d.ts +2 -1
- package/dist/components/PointCloud.d.ts.map +1 -1
- package/dist/components/PointCloud.js +3 -1
- package/dist/components/ProjectLoader.d.ts +2 -1
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +6 -3
- package/dist/components/Rain.d.ts +2 -1
- package/dist/components/Rain.d.ts.map +1 -1
- package/dist/components/Rain.js +7 -1
- package/dist/components/SceneBuilder.d.ts +2 -1
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +2 -2
- package/dist/components/ShootingStar.d.ts +2 -1
- package/dist/components/ShootingStar.d.ts.map +1 -1
- package/dist/components/ShootingStar.js +5 -2
- package/dist/components/ShootingStars.d.ts +2 -1
- package/dist/components/ShootingStars.d.ts.map +1 -1
- package/dist/components/ShootingStars.js +2 -2
- package/dist/components/SkyController.d.ts +3 -2
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +9 -6
- package/dist/components/SkyMesh.d.ts +2 -3
- package/dist/components/SkyMesh.d.ts.map +1 -1
- package/dist/components/SkyMesh.js +3 -5
- package/dist/components/SkySystem.d.ts +2 -1
- package/dist/components/SkySystem.d.ts.map +1 -1
- package/dist/components/SkySystem.js +6 -2
- package/dist/components/Skybox.d.ts +2 -1
- package/dist/components/Skybox.d.ts.map +1 -1
- package/dist/components/Skybox.js +5 -2
- package/dist/components/SolarSystem.d.ts +2 -4
- package/dist/components/SolarSystem.d.ts.map +1 -1
- package/dist/components/SolarSystem.js +3 -1
- package/dist/components/SparklesBurst.d.ts +2 -1
- package/dist/components/SparklesBurst.d.ts.map +1 -1
- package/dist/components/SparklesBurst.js +5 -2
- package/dist/components/Stars.d.ts +2 -3
- package/dist/components/Stars.d.ts.map +1 -1
- package/dist/components/Stars.js +3 -2
- package/dist/components/Sun.d.ts +3 -2
- package/dist/components/Sun.d.ts.map +1 -1
- package/dist/components/Sun.js +7 -3
- package/dist/components/SunCore.d.ts +3 -2
- package/dist/components/SunCore.d.ts.map +1 -1
- package/dist/components/SunCore.js +3 -1
- package/dist/components/SunLight.d.ts +2 -1
- package/dist/components/SunLight.d.ts.map +1 -1
- package/dist/components/SunLight.js +3 -1
- package/dist/components/Text2D.d.ts +2 -1
- package/dist/components/Text2D.d.ts.map +1 -1
- package/dist/components/Text2D.js +3 -1
- package/dist/components/Text3D.d.ts +2 -1
- package/dist/components/Text3D.d.ts.map +1 -1
- package/dist/components/Text3D.js +2 -2
- package/dist/components/VolumePoints.d.ts +3 -2
- package/dist/components/VolumePoints.d.ts.map +1 -1
- package/dist/components/VolumePoints.js +6 -2
- package/dist/components/cursor/AuraCursor.d.ts.map +1 -1
- package/dist/components/cursor/AuraCursor.js +3 -1
- package/dist/components/cursor/AuroraCursor.d.ts.map +1 -1
- package/dist/components/cursor/AuroraCursor.js +5 -2
- package/dist/components/cursor/BubblesCursor.d.ts.map +1 -1
- package/dist/components/cursor/BubblesCursor.js +5 -2
- package/dist/components/cursor/CometCursor.d.ts.map +1 -1
- package/dist/components/cursor/CometCursor.js +6 -3
- package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -1
- package/dist/components/cursor/CrosshairCursor.js +6 -3
- package/dist/components/cursor/CursorActions.d.ts +2 -1
- package/dist/components/cursor/CursorActions.d.ts.map +1 -1
- package/dist/components/cursor/CursorActions.js +12 -10
- package/dist/components/cursor/CursorController.d.ts +2 -1
- package/dist/components/cursor/CursorController.d.ts.map +1 -1
- package/dist/components/cursor/CursorController.js +1 -1
- package/dist/components/cursor/CursorEffects.d.ts +3 -2
- package/dist/components/cursor/CursorEffects.d.ts.map +1 -1
- package/dist/components/cursor/CursorEffects.js +3 -1
- package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -1
- package/dist/components/cursor/FerrofluidCursor.js +3 -1
- package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -1
- package/dist/components/cursor/GlyphRingCursor.js +3 -1
- package/dist/components/cursor/LightningCursor.d.ts.map +1 -1
- package/dist/components/cursor/LightningCursor.js +3 -1
- package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -1
- package/dist/components/cursor/LiquidMetalCursor.js +3 -1
- package/dist/components/cursor/OrbCursor.d.ts.map +1 -1
- package/dist/components/cursor/OrbCursor.js +3 -1
- package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -1
- package/dist/components/cursor/PlasmaWhipCursor.js +3 -1
- package/dist/components/cursor/SparklesCursor.d.ts.map +1 -1
- package/dist/components/cursor/SparklesCursor.js +5 -2
- package/dist/components/cursor/TeslaCursor.d.ts.map +1 -1
- package/dist/components/cursor/TeslaCursor.js +6 -9
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/BoltFlashAction.js +5 -2
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +3 -1
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/ImplosionAction.js +3 -1
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/PhaseShiftAction.js +5 -2
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/PlasmaBombAction.js +5 -2
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/RealityTearAction.js +3 -1
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/ShockwaveAction.js +5 -2
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/SparklesBurstAction.js +3 -1
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/VoronoiFractureAction.js +3 -1
- package/dist/components/cursor/clickActions/index.d.ts +11 -0
- package/dist/components/cursor/clickActions/index.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/index.js +10 -0
- package/dist/components/cursor/index.d.ts +21 -0
- package/dist/components/cursor/index.d.ts.map +1 -0
- package/dist/components/cursor/index.js +19 -0
- package/dist/components/effects/AuraEffect.d.ts +2 -1
- package/dist/components/effects/AuraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuraEffect.js +5 -2
- package/dist/components/effects/AuroraEffect.d.ts +2 -1
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuroraEffect.js +3 -1
- package/dist/components/effects/BlackHoleEffect.d.ts +2 -1
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
- package/dist/components/effects/BlackHoleEffect.js +3 -1
- package/dist/components/effects/ConstellationEffect.d.ts +2 -1
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
- package/dist/components/effects/ConstellationEffect.js +3 -1
- package/dist/components/effects/Corona.d.ts +19 -0
- package/dist/components/effects/Corona.d.ts.map +1 -0
- package/dist/components/effects/Corona.js +15 -0
- package/dist/components/effects/DataStreamEffect.d.ts +2 -1
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
- package/dist/components/effects/DataStreamEffect.js +5 -2
- package/dist/components/effects/DnaHelixEffect.d.ts +2 -1
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
- package/dist/components/effects/DnaHelixEffect.js +3 -1
- package/dist/components/effects/Fire.d.ts +3 -2
- package/dist/components/effects/Fire.d.ts.map +1 -1
- package/dist/components/effects/Fire.js +3 -1
- package/dist/components/effects/FireEffect.d.ts +2 -1
- package/dist/components/effects/FireEffect.d.ts.map +1 -1
- package/dist/components/effects/FireEffect.js +5 -2
- package/dist/components/effects/Flares.d.ts +25 -0
- package/dist/components/effects/Flares.d.ts.map +1 -0
- package/dist/components/effects/Flares.js +136 -0
- package/dist/components/effects/ForcefieldEffect.d.ts +2 -1
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
- package/dist/components/effects/ForcefieldEffect.js +3 -1
- package/dist/components/effects/HologramEffect.d.ts +2 -1
- package/dist/components/effects/HologramEffect.d.ts.map +1 -1
- package/dist/components/effects/HologramEffect.js +5 -2
- package/dist/components/effects/IceCrystalsEffect.d.ts +2 -1
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
- package/dist/components/effects/IceCrystalsEffect.js +3 -1
- package/dist/components/effects/LightningEffect.d.ts +2 -1
- package/dist/components/effects/LightningEffect.d.ts.map +1 -1
- package/dist/components/effects/LightningEffect.js +5 -2
- package/dist/components/effects/MoleculesEffect.d.ts +2 -1
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
- package/dist/components/effects/MoleculesEffect.js +5 -2
- package/dist/components/effects/NeuralNetworkEffect.d.ts +2 -1
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +3 -1
- package/dist/components/effects/OrbEffect.d.ts +2 -1
- package/dist/components/effects/OrbEffect.d.ts.map +1 -1
- package/dist/components/effects/OrbEffect.js +5 -2
- package/dist/components/effects/PortalEffect.d.ts +2 -1
- package/dist/components/effects/PortalEffect.d.ts.map +1 -1
- package/dist/components/effects/PortalEffect.js +5 -2
- package/dist/components/effects/ShockwaveEffect.d.ts +2 -1
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
- package/dist/components/effects/ShockwaveEffect.js +5 -2
- package/dist/components/effects/SmokePlumeEffect.d.ts +2 -1
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokePlumeEffect.js +5 -2
- package/dist/components/effects/SmokeRibbon.d.ts +3 -2
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
- package/dist/components/effects/SmokeRibbon.js +5 -2
- package/dist/components/effects/SmokeRingEffect.d.ts +2 -1
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokeRingEffect.js +5 -2
- package/dist/components/effects/VolumetricFogEffect.d.ts +2 -1
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
- package/dist/components/effects/VolumetricFogEffect.js +5 -2
- package/dist/components/effects/index.d.ts +28 -0
- package/dist/components/effects/index.d.ts.map +1 -0
- package/dist/components/effects/index.js +24 -0
- package/dist/components/index.d.ts +112 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +77 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/hooks/index.d.ts +55 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +46 -1
- package/dist/hooks/useObjectReady.d.ts +29 -0
- package/dist/hooks/useObjectReady.d.ts.map +1 -0
- package/dist/hooks/useObjectReady.js +59 -0
- package/dist/index.d.ts +4 -135
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -108
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/objectReady.d.ts +24 -0
- package/dist/types/objectReady.d.ts.map +1 -0
- package/dist/types/objectReady.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkySystem.d.ts","sourceRoot":"","sources":["../../src/components/SkySystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMnJ,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SkySystem.d.ts","sourceRoot":"","sources":["../../src/components/SkySystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMnJ,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,sBAAsB,CAAC,EAAE,gBAAgB,CAAC;IAC1C,qBAAqB,CAAC,EAAE,WAAW,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAGD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,yBAAyB,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAoCjG,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useLayoutEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
4
|
import * as THREE from 'three';
|
|
4
5
|
import { useFrame } from '@react-three/fiber';
|
|
@@ -8,8 +9,11 @@ import Lensflare from './Lensflare.js';
|
|
|
8
9
|
import SunLight from './SunLight.js';
|
|
9
10
|
import SkyController from './SkyController.js';
|
|
10
11
|
import SceneFog from './SceneFog.js';
|
|
11
|
-
const SkySystem = forwardRef(({ timeSettings, visible = true, sunSystemVisible = false, sunSize = 1, moonSize = 1, skyboxScale = 1000, sunIntensity = 1, castShadow = true, shadowMapSize = 2048, playerPosition = new THREE.Vector3(0, 0, 0), starsSettings, cloudsSettings, cloudsMaterialSettings, skyControllerSettings, rainSettings, fogSettings, onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
12
|
+
const SkySystem = forwardRef(({ timeSettings, visible = true, sunSystemVisible = false, sunSize = 1, moonSize = 1, skyboxScale = 1000, sunIntensity = 1, castShadow = true, shadowMapSize = 2048, playerPosition = new THREE.Vector3(0, 0, 0), starsSettings, cloudsSettings, cloudsMaterialSettings, skyControllerSettings, rainSettings, fogSettings, onTimeOfDayChange, onTimeUpdate, onObjectReady, onObjectDispose, }, ref) => {
|
|
12
13
|
const previousTimeOfDayRef = useRef(null);
|
|
14
|
+
const rootRef = useRef(null);
|
|
15
|
+
const ready = { onObjectReady, onObjectDispose };
|
|
16
|
+
useObjectReady(rootRef, { timeSettings, sunSystemVisible, skyboxScale, sunIntensity, skyControllerSettings, fogSettings }, onObjectReady, onObjectDispose);
|
|
13
17
|
useImperativeHandle(ref, () => ({
|
|
14
18
|
setTime: (h, m) => skySystemManager.setTime(h, m),
|
|
15
19
|
getTime: () => skySystemManager.getTime(),
|
|
@@ -40,7 +44,7 @@ const SkySystem = forwardRef(({ timeSettings, visible = true, sunSystemVisible =
|
|
|
40
44
|
});
|
|
41
45
|
if (!visible)
|
|
42
46
|
return null;
|
|
43
|
-
return (_jsxs("group", { children: [skyControllerSettings && !sunSystemVisible && (_jsx(SkyController, { settings: skyControllerSettings, timeSettings: timeSettings, scale: skyboxScale })), sunSystemVisible && (_jsxs(_Fragment, { children: [_jsx(Skybox, { visible: true, scale: skyboxScale, sunSize: sunSize, moonSize: moonSize, timeSettings: timeSettings }), _jsx(Lensflare, { visible: true, intensity: sunIntensity, timeSettings: timeSettings }), _jsx(SunLight, { visible: true, timeSettings: timeSettings, targetPosition: playerPosition, intensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize })] })), fogSettings && (_jsx(SceneFog, { fog: fogSettings }))] }));
|
|
47
|
+
return (_jsxs("group", { ref: rootRef, children: [skyControllerSettings && !sunSystemVisible && (_jsx(SkyController, { settings: skyControllerSettings, timeSettings: timeSettings, scale: skyboxScale, ...ready })), sunSystemVisible && (_jsxs(_Fragment, { children: [_jsx(Skybox, { visible: true, scale: skyboxScale, sunSize: sunSize, moonSize: moonSize, timeSettings: timeSettings, ...ready }), _jsx(Lensflare, { visible: true, intensity: sunIntensity, timeSettings: timeSettings, ...ready }), _jsx(SunLight, { visible: true, timeSettings: timeSettings, targetPosition: playerPosition, intensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, ...ready })] })), fogSettings && (_jsx(SceneFog, { fog: fogSettings }))] }));
|
|
44
48
|
});
|
|
45
49
|
SkySystem.displayName = 'SkySystem';
|
|
46
50
|
export default SkySystem;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { TimeSettings } from '@3driseai/3drise-core';
|
|
2
3
|
import React from "react";
|
|
3
|
-
export interface SkyboxProps {
|
|
4
|
+
export interface SkyboxProps extends ObjectReadyProps {
|
|
4
5
|
visible?: boolean;
|
|
5
6
|
scale?: number;
|
|
6
7
|
sunSize?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skybox.d.ts","sourceRoot":"","sources":["../../src/components/Skybox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Skybox.d.ts","sourceRoot":"","sources":["../../src/components/Skybox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC9B;AAkDD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsCjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useCallback, useEffect } from 'react';
|
|
3
4
|
import * as THREE from 'three';
|
|
4
5
|
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
@@ -52,8 +53,10 @@ function sampleSkyKeyframes(timeInHours, outHorizon, outHigh, outSun) {
|
|
|
52
53
|
outHigh.copy(last.high);
|
|
53
54
|
outSun.copy(last.sun);
|
|
54
55
|
}
|
|
55
|
-
const Skybox = ({ visible = true, scale = 100000, sunSize = 1, moonSize = 1, timeSettings, }) => {
|
|
56
|
+
const Skybox = ({ visible = true, scale = 100000, sunSize = 1, moonSize = 1, timeSettings, onObjectReady, onObjectDispose, }) => {
|
|
56
57
|
const materialRef = useRef(null);
|
|
58
|
+
const rootRef = useRef(null);
|
|
59
|
+
useObjectReady(rootRef, { visible, scale, sunSize, moonSize, timeSettings }, onObjectReady, onObjectDispose);
|
|
57
60
|
const sunColorRef = useRef(new THREE.Color(0xffe5b0));
|
|
58
61
|
const skyColorLowRef = useRef(new THREE.Color(0x6fa2ef));
|
|
59
62
|
const skyColorHighRef = useRef(new THREE.Color(0x2053ff));
|
|
@@ -87,6 +90,6 @@ const Skybox = ({ visible = true, scale = 100000, sunSize = 1, moonSize = 1, tim
|
|
|
87
90
|
if (!visible)
|
|
88
91
|
return null;
|
|
89
92
|
// console.log(sunSize)
|
|
90
|
-
return (_jsxs("mesh", { scale: scale, children: [_jsx("boxGeometry", { args: [1, 1, 1] }), _jsx("skyboxMaterial", { ref: materialRef, side: THREE.BackSide, depthWrite: false, fog: false })] }));
|
|
93
|
+
return (_jsxs("mesh", { ref: rootRef, scale: scale, children: [_jsx("boxGeometry", { args: [1, 1, 1] }), _jsx("skyboxMaterial", { ref: materialRef, side: THREE.BackSide, depthWrite: false, fog: false })] }));
|
|
91
94
|
};
|
|
92
95
|
export default Skybox;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { SolarSystemConfig } from "@3driseai/3drise-core";
|
|
4
|
-
declare const SolarSystem: React.FC<SolarSystemConfig &
|
|
5
|
-
onObjectReady?: (ref: Group) => void;
|
|
6
|
-
}>;
|
|
4
|
+
declare const SolarSystem: React.FC<SolarSystemConfig & ObjectReadyProps>;
|
|
7
5
|
export default SolarSystem;
|
|
8
6
|
//# sourceMappingURL=SolarSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolarSystem.d.ts","sourceRoot":"","sources":["../../src/components/SolarSystem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolarSystem.d.ts","sourceRoot":"","sources":["../../src/components/SolarSystem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAiD1D,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,gBAAgB,CAqB/D,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useMemo, useState, useCallback } from 'react';
|
|
3
4
|
import { BufferGeometry, BufferAttribute, Vector3 } from 'three';
|
|
4
5
|
import { useFrame } from '@react-three/fiber';
|
|
@@ -52,10 +53,11 @@ const OrbitedBody = ({ orbitRadius, orbitSpeed, spinSpeed, axialTilt, enableOrbi
|
|
|
52
53
|
});
|
|
53
54
|
return (_jsx("group", { ref: orbitRef, "rotation-y": initialPhase, children: _jsx("group", { position: [orbitRadius, 0, 0], "rotation-z": axialTilt, children: _jsx("group", { ref: spinRef, children: children }) }) }));
|
|
54
55
|
};
|
|
55
|
-
const SolarSystem = ({ enableOrbit = true, enableSelfRotation = true, showOrbitRings = true, orbitSpeedMultiplier = 1, sunColor = '#ffd27a', sunRadius = 8, sunIntensity = 3, orbitRingColor = '#444444', orbitRingOpacity = 0.35, }) => {
|
|
56
|
+
const SolarSystem = ({ enableOrbit = true, enableSelfRotation = true, showOrbitRings = true, orbitSpeedMultiplier = 1, sunColor = '#ffd27a', sunRadius = 8, sunIntensity = 3, orbitRingColor = '#444444', orbitRingOpacity = 0.35, onObjectReady, onObjectDispose, }) => {
|
|
56
57
|
const [earthSunPos, setEarthSunPos] = useState([1, 0, 0]);
|
|
57
58
|
const lastEarthSyncRef = useRef(0);
|
|
58
59
|
const ref = useRef(null);
|
|
60
|
+
useObjectReady(ref, { enableOrbit, enableSelfRotation, showOrbitRings, orbitSpeedMultiplier, sunColor, sunRadius, sunIntensity, orbitRingColor, orbitRingOpacity }, onObjectReady, onObjectDispose);
|
|
59
61
|
const handleEarthWorld = useCallback((p) => {
|
|
60
62
|
const now = performance.now();
|
|
61
63
|
if (now - lastEarthSyncRef.current < 100)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { SparklesBurstConfig } from '@3driseai/3drise-core';
|
|
2
3
|
import React from "react";
|
|
3
|
-
export interface SparklesBurstProps {
|
|
4
|
+
export interface SparklesBurstProps extends ObjectReadyProps {
|
|
4
5
|
config: SparklesBurstConfig;
|
|
5
6
|
boundingRadius?: number;
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklesBurst.d.ts","sourceRoot":"","sources":["../../src/components/SparklesBurst.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SparklesBurst.d.ts","sourceRoot":"","sources":["../../src/components/SparklesBurst.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyD/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useMemo, useRef } from 'react';
|
|
3
4
|
import { useFrame } from '@react-three/fiber';
|
|
4
5
|
import * as THREE from 'three';
|
|
5
6
|
import { SparklesBurstMaterial } from '@3driseai/3drise-core';
|
|
6
|
-
const SparklesBurst = ({ config, boundingRadius }) => {
|
|
7
|
+
const SparklesBurst = ({ config, boundingRadius, onObjectReady, onObjectDispose }) => {
|
|
7
8
|
// console.log("Rendering SparklesBurst with config:", config, "and boundingRadius:", boundingRadius);
|
|
8
9
|
const planeSize = useMemo(() => Math.max(0.05, config.scale ?? 2.5), [config.scale]);
|
|
9
10
|
const geometry = useMemo(() => new THREE.PlaneGeometry(planeSize, planeSize, 1, 1), [planeSize]);
|
|
@@ -40,6 +41,8 @@ const SparklesBurst = ({ config, boundingRadius }) => {
|
|
|
40
41
|
// Track elapsed time JS-side so loop on/off toggles cleanly without
|
|
41
42
|
// depending on the global clock for the progress phase.
|
|
42
43
|
const startRef = useRef(null);
|
|
44
|
+
const rootRef = useRef(null);
|
|
45
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
43
46
|
// Reset start when loop toggles so behaviour is predictable.
|
|
44
47
|
useEffect(() => { startRef.current = null; }, [config.loop, config.durationMs]);
|
|
45
48
|
useFrame((state) => {
|
|
@@ -57,6 +60,6 @@ const SparklesBurst = ({ config, boundingRadius }) => {
|
|
|
57
60
|
});
|
|
58
61
|
if (!config.enabled)
|
|
59
62
|
return null;
|
|
60
|
-
return _jsx("mesh", { geometry: geometry, material: material, frustumCulled: false });
|
|
63
|
+
return _jsx("mesh", { ref: rootRef, geometry: geometry, material: material, frustumCulled: false });
|
|
61
64
|
};
|
|
62
65
|
export default SparklesBurst;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import { BufferGeometry } from 'three';
|
|
2
|
-
import type { Object3D } from 'three';
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { CreatedObjectSettings } from "@3driseai/3drise-core";
|
|
5
5
|
import type { TimeSettings } from "@3driseai/3drise-core";
|
|
6
|
-
export interface StarsProps {
|
|
6
|
+
export interface StarsProps extends ObjectReadyProps {
|
|
7
7
|
settings: CreatedObjectSettings;
|
|
8
8
|
timeSettings?: TimeSettings;
|
|
9
9
|
sunSystemEnabled?: boolean;
|
|
10
|
-
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
11
10
|
}
|
|
12
11
|
export declare function generateStarsGeometry(count: number): BufferGeometry;
|
|
13
12
|
declare const Stars: React.FC<StarsProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stars.d.ts","sourceRoot":"","sources":["../../src/components/Stars.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Stars.d.ts","sourceRoot":"","sources":["../../src/components/Stars.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAA4C,MAAM,OAAO,CAAC;AAQjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAChD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAOD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAuDnE;AAYD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwK/B,CAAC;AACF,eAAe,KAAK,CAAC"}
|
package/dist/components/Stars.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useMemo, useCallback, useState, useEffect } from 'react';
|
|
3
4
|
import { BufferGeometry, BufferAttribute, AdditiveBlending, Color } from 'three';
|
|
4
5
|
import { useFrame } from '@react-three/fiber';
|
|
@@ -78,8 +79,9 @@ const DEFAULT_TIME_SETTINGS = {
|
|
|
78
79
|
autoAnimate: false,
|
|
79
80
|
syncWithRealTime: false,
|
|
80
81
|
};
|
|
81
|
-
const Stars = ({ settings, timeSettings, sunSystemEnabled = false, onObjectReady }) => {
|
|
82
|
+
const Stars = ({ settings, timeSettings, sunSystemEnabled = false, onObjectReady, onObjectDispose }) => {
|
|
82
83
|
const pointsRef = useRef(null);
|
|
84
|
+
useObjectReady(pointsRef, settings, onObjectReady, onObjectDispose);
|
|
83
85
|
const materialRef = useRef(null);
|
|
84
86
|
const { meshSettings, config, animations, mouseMove } = settings;
|
|
85
87
|
const { position, rotation, scale, visible } = meshSettings;
|
|
@@ -102,7 +104,6 @@ const Stars = ({ settings, timeSettings, sunSystemEnabled = false, onObjectReady
|
|
|
102
104
|
});
|
|
103
105
|
const geometry = useMemo(() => generateStarsGeometry(count), [count]);
|
|
104
106
|
useEffect(() => {
|
|
105
|
-
onObjectReady && onObjectReady(settings, pointsRef.current);
|
|
106
107
|
return () => { geometry.dispose(); };
|
|
107
108
|
}, [geometry]);
|
|
108
109
|
useEffect(() => {
|
package/dist/components/Sun.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
type
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
2
|
+
type SunProps = ObjectReadyProps & {
|
|
2
3
|
/** Radius of the sun core. Default 1. */
|
|
3
4
|
radius?: number;
|
|
4
5
|
/** Corona shell size relative to the core. Default 1.25. */
|
|
@@ -10,6 +11,6 @@ type SunProps = {
|
|
|
10
11
|
/** Uniform overrides for SunFlareMaterial. */
|
|
11
12
|
flareUniforms?: Record<string, any>;
|
|
12
13
|
};
|
|
13
|
-
export default function Sun({ radius, coronaScale, coreUniforms, coronaUniforms, flareUniforms, }: SunProps): import("react").JSX.Element;
|
|
14
|
+
export default function Sun({ radius, coronaScale, coreUniforms, coronaUniforms, flareUniforms, onObjectReady, onObjectDispose, }: SunProps): import("react").JSX.Element;
|
|
14
15
|
export {};
|
|
15
16
|
//# sourceMappingURL=Sun.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sun.d.ts","sourceRoot":"","sources":["../../src/components/Sun.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sun.d.ts","sourceRoot":"","sources":["../../src/components/Sun.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,KAAK,QAAQ,GAAG,gBAAgB,GAAG;IAC/B,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,MAAU,EAAE,WAAkB,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,GAAG,EAAE,QAAQ,+BAIrJ"}
|
package/dist/components/Sun.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
4
|
// import { ReactNode } from "react";
|
|
3
5
|
import SunCore from "./SunCore.js";
|
|
4
|
-
import Corona from "./Corona.js";
|
|
5
|
-
export default function Sun({ radius = 1, coronaScale = 1.25, coreUniforms, coronaUniforms, flareUniforms, }) {
|
|
6
|
-
|
|
6
|
+
import Corona from "./effects/Corona.js";
|
|
7
|
+
export default function Sun({ radius = 1, coronaScale = 1.25, coreUniforms, coronaUniforms, flareUniforms, onObjectReady, onObjectDispose, }) {
|
|
8
|
+
const rootRef = useRef(null);
|
|
9
|
+
useObjectReady(rootRef, { radius, coronaScale }, onObjectReady, onObjectDispose);
|
|
10
|
+
return (_jsxs("group", { ref: rootRef, children: [_jsx(SunCore, { radius: radius, uniforms: coreUniforms }), _jsx(Corona, { radius: radius, shellScale: coronaScale, uniforms: coronaUniforms }), _jsx("pointLight", { color: "#ffa544", intensity: 6, distance: 60, decay: 1.6 })] }));
|
|
7
11
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type * as THREE from "three";
|
|
2
3
|
declare global {
|
|
3
4
|
namespace JSX {
|
|
@@ -6,7 +7,7 @@ declare global {
|
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
|
-
export type SunCoreProps = {
|
|
10
|
+
export type SunCoreProps = ObjectReadyProps & {
|
|
10
11
|
/** Radius of the core. Default 1. */
|
|
11
12
|
radius?: number;
|
|
12
13
|
/** Self-rotation speed in rad/s. Default 0.02. */
|
|
@@ -14,5 +15,5 @@ export type SunCoreProps = {
|
|
|
14
15
|
/** Uniform overrides for SunCoreMaterial (u_speed, u_cellScale, u_color1..5, ...). */
|
|
15
16
|
uniforms?: Record<string, number | THREE.Vector3 | number[]>;
|
|
16
17
|
};
|
|
17
|
-
export default function SunCore({ radius, rotationSpeed, uniforms }: SunCoreProps): import("react").JSX.Element;
|
|
18
|
+
export default function SunCore({ radius, rotationSpeed, uniforms, onObjectReady, onObjectDispose }: SunCoreProps): import("react").JSX.Element;
|
|
18
19
|
//# sourceMappingURL=SunCore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SunCore.d.ts","sourceRoot":"","sources":["../../src/components/SunCore.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SunCore.d.ts","sourceRoot":"","sources":["../../src/components/SunCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,GAAG,CAAC;QACV,UAAU,iBAAiB;YACvB,eAAe,EAAE,GAAG,CAAC;SACxB;KACJ;CACJ;AAED,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAC1C,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,MAAU,EAAE,aAAoB,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,YAAY,+BAW3H"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef } from "react";
|
|
3
4
|
import { useFrame } from "@react-three/fiber";
|
|
4
|
-
export default function SunCore({ radius = 1, rotationSpeed = 0.02, uniforms }) {
|
|
5
|
+
export default function SunCore({ radius = 1, rotationSpeed = 0.02, uniforms, onObjectReady, onObjectDispose }) {
|
|
5
6
|
const meshRef = useRef(null);
|
|
7
|
+
useObjectReady(meshRef, { radius, rotationSpeed, uniforms }, onObjectReady, onObjectDispose);
|
|
6
8
|
// drei's shaderMaterial exposes each uniform as a property on the instance.
|
|
7
9
|
const matRef = useRef(null);
|
|
8
10
|
useFrame((_, delta) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import * as THREE from 'three';
|
|
2
3
|
import React from "react";
|
|
3
4
|
import type { TimeSettings } from "@3driseai/3drise-core";
|
|
4
|
-
export interface SunLightProps {
|
|
5
|
+
export interface SunLightProps extends ObjectReadyProps {
|
|
5
6
|
visible?: boolean;
|
|
6
7
|
timeSettings: TimeSettings;
|
|
7
8
|
targetPosition?: THREE.Vector3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SunLight.d.ts","sourceRoot":"","sources":["../../src/components/SunLight.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SunLight.d.ts","sourceRoot":"","sources":["../../src/components/SunLight.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAaD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0CrC,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useCallback } from 'react';
|
|
3
4
|
import * as THREE from 'three';
|
|
4
5
|
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
@@ -12,8 +13,9 @@ const SUNRISE = 6;
|
|
|
12
13
|
const SUNSET = 21;
|
|
13
14
|
const DARKNESS_START = 20.42;
|
|
14
15
|
const DARKNESS_END = 6.58;
|
|
15
|
-
const SunLight = ({ visible = true, timeSettings, targetPosition = new THREE.Vector3(0, 0, 0), shadowDistance = 300, intensity: intensityMultiplier = 1, castShadow = true, shadowMapSize = 2048, }) => {
|
|
16
|
+
const SunLight = ({ visible = true, timeSettings, targetPosition = new THREE.Vector3(0, 0, 0), shadowDistance = 300, intensity: intensityMultiplier = 1, castShadow = true, shadowMapSize = 2048, onObjectReady, onObjectDispose, }) => {
|
|
16
17
|
const lightRef = useRef(null);
|
|
18
|
+
useObjectReady(lightRef, { visible, timeSettings, intensity: intensityMultiplier, castShadow, shadowMapSize }, onObjectReady, onObjectDispose);
|
|
17
19
|
const colorRef = useRef(new THREE.Color(0xffe5b0));
|
|
18
20
|
const targetColorRef = useRef(new THREE.Color(0xffe5b0));
|
|
19
21
|
const intensityRef = useRef(1);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { TextSettings } from '@3driseai/3drise-core';
|
|
2
3
|
import React from "react";
|
|
3
|
-
export interface Text2DProps {
|
|
4
|
+
export interface Text2DProps extends ObjectReadyProps {
|
|
4
5
|
textSettings: TextSettings;
|
|
5
6
|
onTextClick?: (textSettings: TextSettings) => void;
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text2D.d.ts","sourceRoot":"","sources":["../../src/components/Text2D.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text2D.d.ts","sourceRoot":"","sources":["../../src/components/Text2D.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAM7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACtD;AAGD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgDjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useState, useCallback, useMemo } from 'react';
|
|
3
4
|
import { useFrame } from '@react-three/fiber';
|
|
4
5
|
import { Text, useCursor } from '@react-three/drei';
|
|
5
6
|
import { createDefaultEffectState, applyTransformEffects } from '@3driseai/3drise-core';
|
|
6
7
|
import { fontManager } from '@3driseai/3drise-core';
|
|
7
8
|
import { getTextEffectProps } from '../utils/textEffects.js';
|
|
8
|
-
const Text2D = ({ textSettings, onTextClick }) => {
|
|
9
|
+
const Text2D = ({ textSettings, onTextClick, onObjectReady, onObjectDispose }) => {
|
|
9
10
|
const groupRef = useRef(null);
|
|
11
|
+
useObjectReady(groupRef, textSettings, onObjectReady, onObjectDispose);
|
|
10
12
|
const textRef = useRef(null);
|
|
11
13
|
const [hovered, setHovered] = useState(false);
|
|
12
14
|
const [clicked, setClicked] = useState(false);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import React from "react";
|
|
2
3
|
import type { TextSettings } from "@3driseai/3drise-core";
|
|
3
4
|
import type { LetterData } from "./Letter";
|
|
4
|
-
export interface Text3DProps {
|
|
5
|
+
export interface Text3DProps extends ObjectReadyProps {
|
|
5
6
|
textSettings: TextSettings;
|
|
6
7
|
onLetterClick?: (letterData: LetterData) => void;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text3D.d.ts","sourceRoot":"","sources":["../../src/components/Text3D.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text3D.d.ts","sourceRoot":"","sources":["../../src/components/Text3D.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;CACpD;AAGD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAIjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Letters from './Letters.js';
|
|
3
|
-
const Text3D = ({ textSettings, onLetterClick }) => {
|
|
3
|
+
const Text3D = ({ textSettings, onLetterClick, onObjectReady, onObjectDispose }) => {
|
|
4
4
|
const { config, materialSettings } = textSettings;
|
|
5
5
|
const { text } = config;
|
|
6
|
-
return (_jsx(Letters, { text: text, config: config, materialSettings: materialSettings, hoverSettings: { sensitivity: 0.5, applyToChildren: false }, transformEffects: textSettings.animations?.transform?.effects || [], onLetterClick: onLetterClick }));
|
|
6
|
+
return (_jsx(Letters, { text: text, config: config, materialSettings: materialSettings, hoverSettings: { sensitivity: 0.5, applyToChildren: false }, transformEffects: textSettings.animations?.transform?.effects || [], onLetterClick: onLetterClick, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }));
|
|
7
7
|
};
|
|
8
8
|
export default Text3D;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
import type { BufferGeometry } from "three";
|
|
3
4
|
import type { ThreeElements } from "@react-three/fiber";
|
|
4
|
-
export interface VolumePointsProps extends Omit<ThreeElements['points'], 'geometry'
|
|
5
|
+
export interface VolumePointsProps extends Omit<ThreeElements['points'], 'geometry'>, ObjectReadyProps {
|
|
5
6
|
/** Any closed host geometry to fill with interior points. */
|
|
6
7
|
geometry: BufferGeometry;
|
|
7
8
|
/** Target number of interior points. */
|
|
@@ -15,5 +16,5 @@ export interface VolumePointsProps extends Omit<ThreeElements['points'], 'geomet
|
|
|
15
16
|
*/
|
|
16
17
|
children?: ReactNode;
|
|
17
18
|
}
|
|
18
|
-
export declare function VolumePoints({ geometry, count, oversample, children, ...props }: VolumePointsProps): import("react").JSX.Element;
|
|
19
|
+
export declare function VolumePoints({ geometry, count, oversample, children, onObjectReady, onObjectDispose, ...props }: VolumePointsProps): import("react").JSX.Element;
|
|
19
20
|
//# sourceMappingURL=VolumePoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumePoints.d.ts","sourceRoot":"","sources":["../../src/components/VolumePoints.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VolumePoints.d.ts","sourceRoot":"","sources":["../../src/components/VolumePoints.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,EAAE,gBAAgB;IAClG,6DAA6D;IAC7D,QAAQ,EAAE,cAAc,CAAC;IACzB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAGD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAOzI"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
4
|
import { useVolumePoints } from '../hooks/useVolumePoints.js';
|
|
3
|
-
export function VolumePoints({ geometry, count = 8000, oversample, children, ...props }) {
|
|
5
|
+
export function VolumePoints({ geometry, count = 8000, oversample, children, onObjectReady, onObjectDispose, ...props }) {
|
|
6
|
+
const rootRef = useRef(null);
|
|
7
|
+
useObjectReady(rootRef, { count, oversample }, onObjectReady, onObjectDispose);
|
|
4
8
|
const pointsGeometry = useVolumePoints(geometry, count, { oversample });
|
|
5
9
|
if (!pointsGeometry)
|
|
6
10
|
return null;
|
|
7
|
-
return (_jsx("points", { geometry: pointsGeometry, ...props, children: children ?? _jsx("pointsMaterial", { size: 0.02, sizeAttenuation: true }) }));
|
|
11
|
+
return (_jsx("points", { ref: rootRef, geometry: pointsGeometry, ...props, children: children ?? _jsx("pointsMaterial", { size: 0.02, sizeAttenuation: true }) }));
|
|
8
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuraCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/AuraCursor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuraCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/AuraCursor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAyB3D,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
2
3
|
import { useMemo, useRef } from 'react';
|
|
3
4
|
import { useFrame } from '@react-three/fiber';
|
|
4
5
|
import AuraEffect from '../effects/AuraEffect.js';
|
|
5
|
-
const AuraCursor = ({ config, worldPosRef, idleMsRef, }) => {
|
|
6
|
+
const AuraCursor = ({ config, worldPosRef, idleMsRef, onObjectReady, onObjectDispose, }) => {
|
|
6
7
|
const groupRef = useRef(null);
|
|
8
|
+
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
7
9
|
const auraConfig = useMemo(() => ({
|
|
8
10
|
enabled: true,
|
|
9
11
|
intensity: config.intensity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuroraCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/AuroraCursor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuroraCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/AuroraCursor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAsE1D,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAuI/D,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useMemo, useRef } from 'react';
|
|
3
4
|
import { useFrame, useThree } from '@react-three/fiber';
|
|
4
5
|
import * as THREE from 'three';
|
|
@@ -70,7 +71,7 @@ const fragmentShader = /* glsl */ `
|
|
|
70
71
|
gl_FragColor = vec4(aurora, alpha);
|
|
71
72
|
}
|
|
72
73
|
`;
|
|
73
|
-
const AuroraCursor = ({ config, worldPosRef, hoverRef, idleMsRef, }) => {
|
|
74
|
+
const AuroraCursor = ({ config, worldPosRef, hoverRef, idleMsRef, onObjectReady, onObjectDispose, }) => {
|
|
74
75
|
const N = Math.min(MAX_TRAIL, Math.max(4, config.trailLength));
|
|
75
76
|
const { camera } = useThree();
|
|
76
77
|
// History positions (newest at index 0, oldest at N-1)
|
|
@@ -132,6 +133,8 @@ const AuroraCursor = ({ config, worldPosRef, hoverRef, idleMsRef, }) => {
|
|
|
132
133
|
}, [config.color, config.opacity, config.flowSpeed, material]);
|
|
133
134
|
useEffect(() => () => { geometry.dispose(); material.dispose(); }, [geometry, material]);
|
|
134
135
|
const firstFrame = useRef(true);
|
|
136
|
+
const rootRef = useRef(null);
|
|
137
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
135
138
|
const tmpTangent = useMemo(() => new THREE.Vector3(), []);
|
|
136
139
|
const tmpToCam = useMemo(() => new THREE.Vector3(), []);
|
|
137
140
|
const tmpSide = useMemo(() => new THREE.Vector3(), []);
|
|
@@ -202,6 +205,6 @@ const AuroraCursor = ({ config, worldPosRef, hoverRef, idleMsRef, }) => {
|
|
|
202
205
|
geometry.attributes.aT.needsUpdate = true;
|
|
203
206
|
geometry.setDrawRange(0, (N - 1) * 6);
|
|
204
207
|
});
|
|
205
|
-
return _jsx("mesh", { geometry: geometry, material: material, frustumCulled: false });
|
|
208
|
+
return _jsx("mesh", { ref: rootRef, geometry: geometry, material: material, frustumCulled: false });
|
|
206
209
|
};
|
|
207
210
|
export default AuroraCursor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubblesCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/BubblesCursor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BubblesCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/BubblesCursor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA6E1D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAyGjE,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useMemo, useRef } from 'react';
|
|
3
4
|
import { useFrame } from '@react-three/fiber';
|
|
4
5
|
import * as THREE from 'three';
|
|
@@ -77,7 +78,7 @@ const pointsFragmentShader = /* glsl */ `
|
|
|
77
78
|
gl_FragColor = vec4(col * (1.0 + spec + popFlash), alpha);
|
|
78
79
|
}
|
|
79
80
|
`;
|
|
80
|
-
const BubblesCursor = ({ config, worldPosRef, velocityRef, hoverRef, idleMsRef, }) => {
|
|
81
|
+
const BubblesCursor = ({ config, worldPosRef, velocityRef, hoverRef, idleMsRef, onObjectReady, onObjectDispose, }) => {
|
|
81
82
|
const positions = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
|
|
82
83
|
const velocities = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
|
|
83
84
|
const ages = useMemo(() => new Float32Array(MAX_BUBBLES), []);
|
|
@@ -119,6 +120,8 @@ const BubblesCursor = ({ config, worldPosRef, velocityRef, hoverRef, idleMsRef,
|
|
|
119
120
|
}, [config.color, config.scale, config.opacity, config.iridescence, material]);
|
|
120
121
|
useEffect(() => () => { geometry.dispose(); material.dispose(); }, [geometry, material]);
|
|
121
122
|
const spawnAccum = useRef(0);
|
|
123
|
+
const rootRef = useRef(null);
|
|
124
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
122
125
|
const startTime = useRef(0);
|
|
123
126
|
useFrame((state, delta) => {
|
|
124
127
|
material.uniforms.uTime.value = state.clock.getElapsedTime();
|
|
@@ -179,6 +182,6 @@ const BubblesCursor = ({ config, worldPosRef, velocityRef, hoverRef, idleMsRef,
|
|
|
179
182
|
geometry.attributes.aBaseSize.needsUpdate = true;
|
|
180
183
|
geometry.attributes.aPhase.needsUpdate = true;
|
|
181
184
|
});
|
|
182
|
-
return _jsx("points", { geometry: geometry, material: material, frustumCulled: false });
|
|
185
|
+
return _jsx("points", { ref: rootRef, geometry: geometry, material: material, frustumCulled: false });
|
|
183
186
|
};
|
|
184
187
|
export default BubblesCursor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CometCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/CometCursor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CometCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/CometCursor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA2D1D,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAqI7D,CAAC;AACF,eAAe,WAAW,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useMemo, useRef } from 'react';
|
|
3
4
|
import { useFrame } from '@react-three/fiber';
|
|
4
5
|
import * as THREE from 'three';
|
|
@@ -59,8 +60,10 @@ const impactVert = /* glsl */ `
|
|
|
59
60
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
60
61
|
}
|
|
61
62
|
`;
|
|
62
|
-
const CometCursor = ({ config, worldPosRef, hoverRef, idleMsRef, }) => {
|
|
63
|
+
const CometCursor = ({ config, worldPosRef, hoverRef, idleMsRef, onObjectReady, onObjectDispose, }) => {
|
|
63
64
|
// Packed newest-first layout: slot 0 = newest, slot count-1 = oldest.
|
|
65
|
+
const ref = useRef(null);
|
|
66
|
+
useObjectReady(ref, config, onObjectReady, onObjectDispose);
|
|
64
67
|
const positions = useMemo(() => new Float32Array(MAX_TRAIL * 3), []);
|
|
65
68
|
const indices = useMemo(() => {
|
|
66
69
|
const arr = new Float32Array(MAX_TRAIL);
|
|
@@ -186,6 +189,6 @@ const CometCursor = ({ config, worldPosRef, hoverRef, idleMsRef, }) => {
|
|
|
186
189
|
impact.visible = impactOpacity.current > 0.005;
|
|
187
190
|
}
|
|
188
191
|
});
|
|
189
|
-
return (_jsxs(
|
|
192
|
+
return (_jsxs("group", { ref: ref, children: [_jsx("points", { geometry: geometry, material: material, frustumCulled: false }), _jsx("mesh", { ref: impactRef, geometry: impactGeom, material: impactMat, visible: false })] }));
|
|
190
193
|
};
|
|
191
194
|
export default CometCursor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrosshairCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/CrosshairCursor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CrosshairCursor.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/CrosshairCursor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAe1D,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAqIrE,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useMemo, useRef } from 'react';
|
|
3
4
|
import { useFrame } from '@react-three/fiber';
|
|
4
5
|
import * as THREE from 'three';
|
|
@@ -15,8 +16,10 @@ function hasValidPositions(geo) {
|
|
|
15
16
|
}
|
|
16
17
|
return true;
|
|
17
18
|
}
|
|
18
|
-
const CrosshairCursor = ({ config, worldPosRef, hoverRef, idleMsRef, }) => {
|
|
19
|
+
const CrosshairCursor = ({ config, worldPosRef, hoverRef, idleMsRef, onObjectReady, onObjectDispose, }) => {
|
|
19
20
|
// Billboarded reticle group (ring + ticks)
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
useObjectReady(ref, config, onObjectReady, onObjectDispose);
|
|
20
23
|
const reticleRef = useRef(null);
|
|
21
24
|
const ringRef = useRef(null);
|
|
22
25
|
// World-space outline group (NOT billboarded) for the hovered object outline
|
|
@@ -137,6 +140,6 @@ const CrosshairCursor = ({ config, worldPosRef, hoverRef, idleMsRef, }) => {
|
|
|
137
140
|
ringMat.opacity = config.opacity * (0.4 + 0.6 * idleFactor);
|
|
138
141
|
tickMat.opacity = config.opacity * (0.4 + 0.6 * idleFactor);
|
|
139
142
|
});
|
|
140
|
-
return (_jsxs(
|
|
143
|
+
return (_jsxs("group", { ref: ref, children: [_jsxs("group", { ref: reticleRef, children: [_jsx("mesh", { ref: ringRef, geometry: ringGeom, material: ringMat }), _jsx("lineSegments", { geometry: tickGeom, material: tickMat })] }), _jsx("group", { ref: outlineGroupRef, children: _jsx("lineSegments", { ref: outlineRef, material: outlineMat, visible: false }) })] }));
|
|
141
144
|
};
|
|
142
145
|
export default CrosshairCursor;
|