@3driseai/3drise-viewer 0.1.2 → 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 +3 -2
- package/dist/components/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +17 -6
- 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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Cursor click actions — one-shot effects spawned on pointer down.
|
|
2
|
+
export { default as BoltFlashAction } from './BoltFlashAction.js';
|
|
3
|
+
export { default as GlyphInscriptionAction } from './GlyphInscriptionAction.js';
|
|
4
|
+
export { default as ImplosionAction } from './ImplosionAction.js';
|
|
5
|
+
export { default as PhaseShiftAction } from './PhaseShiftAction.js';
|
|
6
|
+
export { default as PlasmaBombAction } from './PlasmaBombAction.js';
|
|
7
|
+
export { default as RealityTearAction } from './RealityTearAction.js';
|
|
8
|
+
export { default as ShockwaveAction } from './ShockwaveAction.js';
|
|
9
|
+
export { default as SparklesBurstAction } from './SparklesBurstAction.js';
|
|
10
|
+
export { default as VoronoiFractureAction } from './VoronoiFractureAction.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type { CursorActionsProps } from './CursorActions';
|
|
2
|
+
export type { CursorControllerProps } from './CursorController';
|
|
3
|
+
export type { CursorEffectsProps, CursorTypeProps } from './CursorEffects';
|
|
4
|
+
export { default as CursorController } from './CursorController';
|
|
5
|
+
export { default as CursorActions } from './CursorActions';
|
|
6
|
+
export { default as CursorEffects } from './CursorEffects';
|
|
7
|
+
export { default as AuraCursor } from './AuraCursor';
|
|
8
|
+
export { default as AuroraCursor } from './AuroraCursor';
|
|
9
|
+
export { default as BubblesCursor } from './BubblesCursor';
|
|
10
|
+
export { default as CometCursor } from './CometCursor';
|
|
11
|
+
export { default as CrosshairCursor } from './CrosshairCursor';
|
|
12
|
+
export { default as FerrofluidCursor } from './FerrofluidCursor';
|
|
13
|
+
export { default as GlyphRingCursor } from './GlyphRingCursor';
|
|
14
|
+
export { default as LightningCursor } from './LightningCursor';
|
|
15
|
+
export { default as LiquidMetalCursor } from './LiquidMetalCursor';
|
|
16
|
+
export { default as OrbCursor } from './OrbCursor';
|
|
17
|
+
export { default as PlasmaWhipCursor } from './PlasmaWhipCursor';
|
|
18
|
+
export { default as SparklesCursor } from './SparklesCursor';
|
|
19
|
+
export { default as TeslaCursor } from './TeslaCursor';
|
|
20
|
+
export * from './clickActions';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/cursor/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvD,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Cursor module — cursor controller, effect renderers and per-cursor visuals.
|
|
2
|
+
export { default as CursorController } from './CursorController.js';
|
|
3
|
+
export { default as CursorActions } from './CursorActions.js';
|
|
4
|
+
export { default as CursorEffects } from './CursorEffects.js';
|
|
5
|
+
// Cursor variants
|
|
6
|
+
export { default as AuraCursor } from './AuraCursor.js';
|
|
7
|
+
export { default as AuroraCursor } from './AuroraCursor.js';
|
|
8
|
+
export { default as BubblesCursor } from './BubblesCursor.js';
|
|
9
|
+
export { default as CometCursor } from './CometCursor.js';
|
|
10
|
+
export { default as CrosshairCursor } from './CrosshairCursor.js';
|
|
11
|
+
export { default as FerrofluidCursor } from './FerrofluidCursor.js';
|
|
12
|
+
export { default as GlyphRingCursor } from './GlyphRingCursor.js';
|
|
13
|
+
export { default as LightningCursor } from './LightningCursor.js';
|
|
14
|
+
export { default as LiquidMetalCursor } from './LiquidMetalCursor.js';
|
|
15
|
+
export { default as OrbCursor } from './OrbCursor.js';
|
|
16
|
+
export { default as PlasmaWhipCursor } from './PlasmaWhipCursor.js';
|
|
17
|
+
export { default as SparklesCursor } from './SparklesCursor.js';
|
|
18
|
+
export { default as TeslaCursor } from './TeslaCursor.js';
|
|
19
|
+
export * from './clickActions/index.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { AuraConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface AuraEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: AuraConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuraEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/AuraEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"AuraEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/AuraEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,eAAgB,SAAQ,gBAAgB;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAgFD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6CzC,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
|
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
const vertexShader = /* glsl */ `
|
|
7
8
|
varying vec3 vNormal;
|
|
8
9
|
varying vec3 vViewDir;
|
|
@@ -80,9 +81,11 @@ const fragmentShader = /* glsl */ `
|
|
|
80
81
|
gl_FragColor = vec4(col, alpha);
|
|
81
82
|
}
|
|
82
83
|
`;
|
|
83
|
-
const AuraEffect = ({ boundingRadius, config, animations }) => {
|
|
84
|
+
const AuraEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
84
85
|
const { layerCount, fresnelPower, pulseSpeed, innerColor, outerColor, noiseAmount, sizeMultiplier, opacity, speed, intensity } = config;
|
|
85
86
|
const startValuesCacheRef = useRef({});
|
|
87
|
+
const rootRef = useRef(null);
|
|
88
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
86
89
|
// Derive a single base hue from the innerColor
|
|
87
90
|
const baseHue = useMemo(() => {
|
|
88
91
|
const c = new THREE.Color(innerColor);
|
|
@@ -117,7 +120,7 @@ const AuraEffect = ({ boundingRadius, config, animations }) => {
|
|
|
117
120
|
}
|
|
118
121
|
});
|
|
119
122
|
const baseR = boundingRadius * sizeMultiplier;
|
|
120
|
-
return (_jsx("group", { children: Array.from({ length: layerCount }, (_, i) => {
|
|
123
|
+
return (_jsx("group", { ref: rootRef, children: Array.from({ length: layerCount }, (_, i) => {
|
|
121
124
|
// Non-linear layer spacing: outer layers spread wider
|
|
122
125
|
const layerT = layerCount > 1 ? i / (layerCount - 1) : 0;
|
|
123
126
|
const r = baseR * (1 + layerT * layerT * 0.5);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { AuroraConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface AuroraEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: AuroraConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuroraEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/AuroraEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"AuroraEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/AuroraEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,iBAAkB,SAAQ,gBAAgB;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqDD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwD7C,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
|
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
const ribbonVert = /* glsl */ `
|
|
7
8
|
uniform float u_time;
|
|
8
9
|
uniform float uPhase;
|
|
@@ -53,9 +54,10 @@ const ribbonFrag = /* glsl */ `
|
|
|
53
54
|
gl_FragColor = vec4(col, alpha);
|
|
54
55
|
}
|
|
55
56
|
`;
|
|
56
|
-
const AuroraEffect = ({ boundingRadius, config, animations }) => {
|
|
57
|
+
const AuroraEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
57
58
|
const { ribbonCount, waveAmplitude, colorShift, arcWidth, opacity, speed, intensity } = config;
|
|
58
59
|
const groupRef = useRef(null);
|
|
60
|
+
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
59
61
|
const ribbons = useMemo(() => {
|
|
60
62
|
const N = Math.max(3, Math.min(ribbonCount, 10));
|
|
61
63
|
const r = boundingRadius;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { BlackHoleConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface BlackHoleEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: BlackHoleConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlackHoleEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/BlackHoleEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"BlackHoleEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/BlackHoleEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAsHD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwEnD,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
|
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
// ── Accretion disk shader ─────────────────────────────────────────────────────
|
|
7
8
|
const diskVert = /* glsl */ `
|
|
8
9
|
varying vec2 vUv;
|
|
@@ -118,10 +119,11 @@ const jetFrag = /* glsl */ `
|
|
|
118
119
|
gl_FragColor = vec4(uJetColor, a);
|
|
119
120
|
}
|
|
120
121
|
`;
|
|
121
|
-
const BlackHoleEffect = ({ boundingRadius, config, animations }) => {
|
|
122
|
+
const BlackHoleEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
122
123
|
const { diskColor, jetEnabled, jetColor, rotationSpeed, tilt, opacity, speed, intensity } = config;
|
|
123
124
|
const startValuesCacheRef = useRef({});
|
|
124
125
|
const groupRef = useRef(null);
|
|
126
|
+
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
125
127
|
const r = boundingRadius;
|
|
126
128
|
const { diskMat, lensMat, jetMat1, jetMat2, jetGeo } = useMemo(() => {
|
|
127
129
|
const dc = new THREE.Color(diskColor);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ConstellationConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface ConstellationEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: ConstellationConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstellationEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ConstellationEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConstellationEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ConstellationEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,wBAAyB,SAAQ,gBAAgB;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAiGD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAyF3D,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
|
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
// Stars: per-particle twinkle + size variation
|
|
7
8
|
const starVertShader = /* glsl */ `
|
|
8
9
|
attribute float aPhase;
|
|
@@ -97,10 +98,11 @@ function fibonacciSphere(count, radius) {
|
|
|
97
98
|
}
|
|
98
99
|
return positions;
|
|
99
100
|
}
|
|
100
|
-
const ConstellationEffect = ({ boundingRadius, config, animations }) => {
|
|
101
|
+
const ConstellationEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
101
102
|
const { starCount, connectRadius, orbitRadius, twinkleSpeed, lineOpacity, starSize, color, opacity, speed } = config;
|
|
102
103
|
const startValuesCacheRef = useRef({});
|
|
103
104
|
const groupRef = useRef(null);
|
|
105
|
+
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
104
106
|
const r = boundingRadius * orbitRadius;
|
|
105
107
|
const connR = boundingRadius * connectRadius;
|
|
106
108
|
const colorVec = useMemo(() => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
declare global {
|
|
3
|
+
namespace JSX {
|
|
4
|
+
interface IntrinsicElements {
|
|
5
|
+
sunCoronaMaterial: any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
10
|
+
export type CoronaProps = ObjectReadyProps & {
|
|
11
|
+
/** Radius of the core this corona surrounds. Default 1. */
|
|
12
|
+
radius?: number;
|
|
13
|
+
/** Shell size relative to the core. Default 1.25. Synced with u_shellScale. */
|
|
14
|
+
shellScale?: number;
|
|
15
|
+
/** Uniform overrides for SunCoronaMaterial (u_intensity, u_innerColor, ...). */
|
|
16
|
+
uniforms?: Record<string, number | THREE.Vector3 | number[]>;
|
|
17
|
+
};
|
|
18
|
+
export default function Corona({ radius, shellScale, uniforms, onObjectReady, onObjectDispose }: CoronaProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=Corona.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Corona.d.ts","sourceRoot":"","sources":["../../../src/components/effects/Corona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,GAAG,CAAC;QACV,UAAU,iBAAiB;YACvB,iBAAiB,EAAE,GAAG,CAAC;SAC1B;KACJ;CACJ;AAGD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG;IACzC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAU,EAAE,UAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,WAAW,+BAStH"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { useFrame } from "@react-three/fiber";
|
|
5
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
|
+
export default function Corona({ radius = 1, shellScale = 1.25, uniforms, onObjectReady, onObjectDispose }) {
|
|
7
|
+
const matRef = useRef(null);
|
|
8
|
+
const rootRef = useRef(null);
|
|
9
|
+
useObjectReady(rootRef, { radius, shellScale, uniforms }, onObjectReady, onObjectDispose);
|
|
10
|
+
useFrame((_, delta) => {
|
|
11
|
+
if (matRef.current)
|
|
12
|
+
matRef.current.u_time += delta;
|
|
13
|
+
});
|
|
14
|
+
return (_jsxs("mesh", { ref: rootRef, scale: radius * shellScale, children: [_jsx("sphereGeometry", { args: [1, 64, 64] }), _jsx("coronaMaterial", { ref: matRef, u_shellScale: shellScale, side: THREE.BackSide, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, ...uniforms })] }));
|
|
15
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { DataStreamConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface DataStreamEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: DataStreamConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataStreamEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/DataStreamEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataStreamEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/DataStreamEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,qBAAsB,SAAQ,gBAAgB;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqFD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmDrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
|
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
// Dual counter-rotating helices with cold→hot color gradient.
|
|
7
8
|
// All animation is GPU-side — only u_time updates per frame.
|
|
8
9
|
const vertexShader = /* glsl */ `
|
|
@@ -85,9 +86,11 @@ const fragmentShader = /* glsl */ `
|
|
|
85
86
|
gl_FragColor = vec4(vColor, vAlpha * uOpacity * (glow + star));
|
|
86
87
|
}
|
|
87
88
|
`;
|
|
88
|
-
const DataStreamEffect = ({ boundingRadius, config, animations }) => {
|
|
89
|
+
const DataStreamEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
89
90
|
const { particleCount, spiralTurns, streamRadius, inward, particleSize, opacity, speed, intensity } = config;
|
|
90
91
|
const startValuesCacheRef = useRef({});
|
|
92
|
+
const rootRef = useRef(null);
|
|
93
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
91
94
|
const r = boundingRadius * streamRadius;
|
|
92
95
|
const h = boundingRadius * 2.6;
|
|
93
96
|
const { geometry, material } = useMemo(() => {
|
|
@@ -133,6 +136,6 @@ const DataStreamEffect = ({ boundingRadius, config, animations }) => {
|
|
|
133
136
|
applyGenerativeAnimations([material], animations, startValuesCacheRef.current, Date.now(), false);
|
|
134
137
|
}
|
|
135
138
|
});
|
|
136
|
-
return _jsx("points", { geometry: geometry, material: material });
|
|
139
|
+
return _jsx("points", { ref: rootRef, geometry: geometry, material: material });
|
|
137
140
|
};
|
|
138
141
|
export default DataStreamEffect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { DnaHelixConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface DnaHelixEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: DnaHelixConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DnaHelixEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/DnaHelixEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"DnaHelixEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/DnaHelixEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,mBAAoB,SAAQ,gBAAgB;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA0ED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0OjD,CAAC;AACF,eAAe,cAAc,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useRef, useMemo } from 'react';
|
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
// ── Pulsing junction-dot shader ───────────────────────────────────────────────
|
|
7
8
|
const dotVert = /* glsl */ `
|
|
8
9
|
attribute float aPhase;
|
|
@@ -74,10 +75,11 @@ function helixAt(t, si, numStrands, r, h) {
|
|
|
74
75
|
return new THREE.Vector3(Math.cos(angle) * r, t * h - h / 2, Math.sin(angle) * r);
|
|
75
76
|
}
|
|
76
77
|
// ── Component ─────────────────────────────────────────────────────────────────
|
|
77
|
-
const DnaHelixEffect = ({ boundingRadius, config, animations }) => {
|
|
78
|
+
const DnaHelixEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
78
79
|
const { particleCount, strandCount, helixRadius, helixHeight, basePairColor, runningLightEnabled, opacity, speed, intensity, } = config;
|
|
79
80
|
const startValuesCacheRef = useRef({});
|
|
80
81
|
const groupRef = useRef(null);
|
|
82
|
+
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
81
83
|
const washProgress = useRef(0);
|
|
82
84
|
const r = boundingRadius * helixRadius;
|
|
83
85
|
const h = boundingRadius * helixHeight;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Object3D } from 'three';
|
|
2
2
|
import { AnimationOptions, FireConfig } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
export interface FireProps extends ObjectReadyProps {
|
|
4
5
|
/**
|
|
5
6
|
* Host object to wrap. When provided, the fire auto-fits the host's
|
|
6
7
|
* bounding sphere. mode 'wrap' scatters flame tongues across the host's
|
|
@@ -15,6 +16,6 @@ export interface FireProps {
|
|
|
15
16
|
config: FireConfig;
|
|
16
17
|
animations?: AnimationOptions[];
|
|
17
18
|
}
|
|
18
|
-
declare const Fire: ({ hostRef, config, animations }: FireProps) => import("react").JSX.Element;
|
|
19
|
+
declare const Fire: ({ hostRef, config, animations, onObjectReady, onObjectDispose }: FireProps) => import("react").JSX.Element;
|
|
19
20
|
export default Fire;
|
|
20
21
|
//# sourceMappingURL=Fire.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fire.d.ts","sourceRoot":"","sources":["../../../src/components/effects/Fire.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Fire.d.ts","sourceRoot":"","sources":["../../../src/components/effects/Fire.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IAC/C;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqFD,QAAA,MAAM,IAAI,GAAI,iEAAiE,SAAS,gCAyHvF,CAAC;AACF,eAAe,IAAI,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box3, Sphere, Color, Vector3, Matrix4, PlaneGeometry, InstancedBufferGeometry, InstancedBufferAttribute, } from 'three';
|
|
3
3
|
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
5
6
|
// Add to FireConfig in 3drize-core:
|
|
6
7
|
// mode?: 'crown' | 'wrap' // wrap scatters tongues over the host surface
|
|
7
8
|
// coverage?: number // 0..1 — how far down the host burns (wrap)
|
|
@@ -84,8 +85,9 @@ function sampleSurface(host, count) {
|
|
|
84
85
|
}
|
|
85
86
|
return points;
|
|
86
87
|
}
|
|
87
|
-
const Fire = ({ hostRef, config, animations }) => {
|
|
88
|
+
const Fire = ({ hostRef, config, animations, onObjectReady, onObjectDispose }) => {
|
|
88
89
|
const group = useRef(null);
|
|
90
|
+
useObjectReady(group, config, onObjectReady, onObjectDispose);
|
|
89
91
|
const material = useRef(null);
|
|
90
92
|
const lightRef = useRef(null);
|
|
91
93
|
const { radius = 1, height = 2.5, radiusScale = 1, heightScale = 1, intensity = 1, speed = 1, turbulence = 1.5, sway = 1, tint = '#ffffff', light = true, mode = 'tongues', coverage = 0.85, tongues = 36, } = config;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FireConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface FireEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: FireConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FireEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FireEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"FireEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/FireEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,eAAgB,SAAQ,gBAAgB;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAwGD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwFzC,CAAC;AACF,eAAe,UAAU,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useMemo, useRef } from 'react';
|
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
// ── Flame particle vertex shader ──────────────────────────────────────────────
|
|
7
8
|
const flameVert = /* glsl */ `
|
|
8
9
|
attribute float aT; // lifetime position 0..1 (base→tip)
|
|
@@ -104,9 +105,11 @@ const emberFrag = /* glsl */ `
|
|
|
104
105
|
gl_FragColor = vec4(1.0, 0.65 + (1.0 - vT) * 0.35, 0.2 * (1.0 - vT), alpha);
|
|
105
106
|
}
|
|
106
107
|
`;
|
|
107
|
-
const FireEffect = ({ boundingRadius, config, animations }) => {
|
|
108
|
+
const FireEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
108
109
|
const { particleCount, height, spread, flameColor, tipColor, opacity, speed, intensity } = config;
|
|
109
110
|
const startValuesCacheRef = useRef({});
|
|
111
|
+
const rootRef = useRef(null);
|
|
112
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
110
113
|
const h = boundingRadius * height;
|
|
111
114
|
const s = boundingRadius * spread;
|
|
112
115
|
const { flameGeo, flameMat, emberGeo, emberMat } = useMemo(() => {
|
|
@@ -189,6 +192,6 @@ const FireEffect = ({ boundingRadius, config, animations }) => {
|
|
|
189
192
|
applyGenerativeAnimations([flameMat, emberMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
190
193
|
}
|
|
191
194
|
});
|
|
192
|
-
return (_jsxs("group", { position: [0, boundingRadius * 0.1, 0], children: [_jsx("points", { geometry: flameGeo, material: flameMat }), _jsx("points", { geometry: emberGeo, material: emberMat })] }));
|
|
195
|
+
return (_jsxs("group", { ref: rootRef, position: [0, boundingRadius * 0.1, 0], children: [_jsx("points", { geometry: flameGeo, material: flameMat }), _jsx("points", { geometry: emberGeo, material: emberMat })] }));
|
|
193
196
|
};
|
|
194
197
|
export default FireEffect;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Vector3, Object3D } from "three";
|
|
2
|
+
import { AnimationOptions, FlaresConfig } from "@3driseai/3drise-core";
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
flareMaterial: any;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
11
|
+
export type FlaresProps = ObjectReadyProps & {
|
|
12
|
+
/**
|
|
13
|
+
* true -> silhouette mode: bursts root on the enclosing object's actual
|
|
14
|
+
* screen silhouette (mask render pass).
|
|
15
|
+
* false -> plane mode: circular limb billboard (default).
|
|
16
|
+
*/
|
|
17
|
+
hostRef?: Object3D | null;
|
|
18
|
+
/** Root the bursts at the center (shooting from source) instead of the limb. */
|
|
19
|
+
config: FlaresConfig;
|
|
20
|
+
/** Uniform overrides for FlareMaterial (u_frequency, u_reach, ...). */
|
|
21
|
+
uniforms?: Record<string, number | Vector3 | number[]>;
|
|
22
|
+
animations?: AnimationOptions[];
|
|
23
|
+
};
|
|
24
|
+
export default function Flares({ hostRef, config, uniforms, animations, onObjectReady, onObjectDispose }: FlaresProps): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=Flares.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flares.d.ts","sourceRoot":"","sources":["../../../src/components/effects/Flares.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwE,OAAO,EAA8B,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5I,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,GAAG,CAAC;QACV,UAAU,iBAAiB;YACvB,aAAa,EAAE,GAAG,CAAC;SACtB;KACJ;CACJ;AAGD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG;IACzC;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,gFAAgF;IAChF,MAAM,EAAE,YAAY,CAAC;IACrB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;IACvD,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC,CAAC;AAUF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,WAAW,+BA2HpH"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { useFrame, useThree } from "@react-three/fiber";
|
|
4
|
+
import { WebGLRenderTarget, MeshBasicMaterial, AdditiveBlending, Box3, Sphere, Vector3, Vector2, Quaternion, Color, Object3D } from "three";
|
|
5
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
|
+
const tmpBox = new Box3();
|
|
7
|
+
const tmpSphere = new Sphere();
|
|
8
|
+
const tmpVec = new Vector3();
|
|
9
|
+
const tmpVec2 = new Vector2();
|
|
10
|
+
const tmpQuat = new Quaternion();
|
|
11
|
+
const tmpRight = new Vector3();
|
|
12
|
+
const tmpColor = new Color();
|
|
13
|
+
export default function Flares({ hostRef, config, uniforms, animations, onObjectReady, onObjectDispose }) {
|
|
14
|
+
const { gl, scene } = useThree();
|
|
15
|
+
const anchorRef = useRef(null);
|
|
16
|
+
useObjectReady(anchorRef, config, onObjectReady, onObjectDispose);
|
|
17
|
+
const meshRef = useRef(null);
|
|
18
|
+
const matRef = useRef(null);
|
|
19
|
+
const { radius, padding = 1.2, fitKey, shooting, maskResolution = 512, maskLayer = 31 } = config;
|
|
20
|
+
const maskTarget = useMemo(() => hostRef
|
|
21
|
+
? new WebGLRenderTarget(maskResolution, maskResolution, {
|
|
22
|
+
depthBuffer: true,
|
|
23
|
+
stencilBuffer: false,
|
|
24
|
+
samples: 4 // MSAA mask (WebGL2) -> smooth silhouette edges
|
|
25
|
+
})
|
|
26
|
+
: null, [hostRef, maskResolution]);
|
|
27
|
+
const maskMaterial = useMemo(() => new MeshBasicMaterial({ color: 0xffffff }), []);
|
|
28
|
+
useEffect(() => () => maskTarget?.dispose(), [maskTarget]);
|
|
29
|
+
// Fit the billboard to the host object + tag the host for the mask pass.
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const anchor = anchorRef.current;
|
|
32
|
+
const mesh = meshRef.current;
|
|
33
|
+
if (!anchor || !mesh)
|
|
34
|
+
return;
|
|
35
|
+
const host = hostRef && hostRef instanceof Object3D ? hostRef : anchor;
|
|
36
|
+
// Silhouette mode: tag every host node (except us) with the mask layer.
|
|
37
|
+
if (hostRef && host) {
|
|
38
|
+
host.traverse((o) => o.layers.enable(maskLayer));
|
|
39
|
+
anchor.traverse((o) => o.layers.disable(maskLayer));
|
|
40
|
+
}
|
|
41
|
+
if (radius !== undefined) {
|
|
42
|
+
anchor.position.set(0, 0, 0);
|
|
43
|
+
mesh.scale.setScalar(radius * padding);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!host)
|
|
47
|
+
return;
|
|
48
|
+
// Bounding box of every sibling except ourselves (world space).
|
|
49
|
+
tmpBox.makeEmpty();
|
|
50
|
+
let hasGeometry = false;
|
|
51
|
+
for (const child of host.children) {
|
|
52
|
+
if (child === anchor)
|
|
53
|
+
continue;
|
|
54
|
+
const childBox = new Box3().setFromObject(child);
|
|
55
|
+
if (!childBox.isEmpty()) {
|
|
56
|
+
tmpBox.union(childBox);
|
|
57
|
+
hasGeometry = true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Host itself may be a mesh (Flares nested directly inside it).
|
|
61
|
+
if (host.geometry) {
|
|
62
|
+
const g = host.geometry;
|
|
63
|
+
if (!g.boundingBox)
|
|
64
|
+
g.computeBoundingBox();
|
|
65
|
+
if (g.boundingBox) {
|
|
66
|
+
tmpBox.union(g.boundingBox.clone().applyMatrix4(host.matrixWorld));
|
|
67
|
+
hasGeometry = true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!hasGeometry)
|
|
71
|
+
return;
|
|
72
|
+
tmpBox.getBoundingSphere(tmpSphere);
|
|
73
|
+
host.updateWorldMatrix(true, false);
|
|
74
|
+
const localCenter = host.worldToLocal(tmpSphere.center.clone());
|
|
75
|
+
host.getWorldScale(tmpVec);
|
|
76
|
+
const worldScale = Math.max(tmpVec.x, tmpVec.y, tmpVec.z) || 1;
|
|
77
|
+
anchor.position.copy(localCenter);
|
|
78
|
+
mesh.scale.setScalar((tmpSphere.radius / worldScale) * padding);
|
|
79
|
+
}, [radius, padding, fitKey, hostRef, maskLayer]);
|
|
80
|
+
useFrame(({ camera: cam }, delta) => {
|
|
81
|
+
const mat = matRef.current;
|
|
82
|
+
const mesh = meshRef.current;
|
|
83
|
+
if (mat)
|
|
84
|
+
mat.u_time += delta;
|
|
85
|
+
// World-space billboard: compensate for inherited rotation.
|
|
86
|
+
if (mesh && hostRef) {
|
|
87
|
+
hostRef.getWorldQuaternion(tmpQuat).invert();
|
|
88
|
+
mesh.quaternion.copy(tmpQuat).multiply(cam.quaternion);
|
|
89
|
+
}
|
|
90
|
+
// --- Silhouette mask pass: render only the host, white on black. ---
|
|
91
|
+
if (hostRef && maskTarget && mat && mesh) {
|
|
92
|
+
const prevOverride = scene.overrideMaterial;
|
|
93
|
+
const prevBackground = scene.background;
|
|
94
|
+
const prevTarget = gl.getRenderTarget();
|
|
95
|
+
const prevLayers = cam.layers.mask;
|
|
96
|
+
gl.getClearColor(tmpColor);
|
|
97
|
+
const prevClearAlpha = gl.getClearAlpha();
|
|
98
|
+
scene.overrideMaterial = maskMaterial;
|
|
99
|
+
scene.background = null;
|
|
100
|
+
cam.layers.set(maskLayer);
|
|
101
|
+
gl.setRenderTarget(maskTarget);
|
|
102
|
+
gl.setClearColor(0x000000, 1);
|
|
103
|
+
gl.clear();
|
|
104
|
+
gl.render(scene, cam);
|
|
105
|
+
gl.setRenderTarget(prevTarget);
|
|
106
|
+
gl.setClearColor(tmpColor, prevClearAlpha);
|
|
107
|
+
scene.overrideMaterial = prevOverride;
|
|
108
|
+
scene.background = prevBackground;
|
|
109
|
+
cam.layers.mask = prevLayers;
|
|
110
|
+
// Feed the shader: mask, buffer size, host center in screen UV.
|
|
111
|
+
mat.u_mask = maskTarget.texture;
|
|
112
|
+
gl.getDrawingBufferSize(tmpVec2);
|
|
113
|
+
mat.u_resolution.set(tmpVec2.x, tmpVec2.y);
|
|
114
|
+
const anchor = anchorRef.current;
|
|
115
|
+
anchor.getWorldPosition(tmpVec).project(cam);
|
|
116
|
+
const cx = tmpVec.x * 0.5 + 0.5;
|
|
117
|
+
const cy = tmpVec.y * 0.5 + 0.5;
|
|
118
|
+
mat.u_center.set(cx, cy);
|
|
119
|
+
// Bounding-silhouette radius in aspect-corrected screen UV: project a
|
|
120
|
+
// point one limb-unit to the camera's right of the center.
|
|
121
|
+
mesh.getWorldScale(tmpVec);
|
|
122
|
+
const worldLimb = Math.max(tmpVec.x, tmpVec.y, tmpVec.z);
|
|
123
|
+
tmpRight.setFromMatrixColumn(cam.matrixWorld, 0).multiplyScalar(worldLimb);
|
|
124
|
+
anchor.getWorldPosition(tmpVec).add(tmpRight).project(cam);
|
|
125
|
+
const aspect = tmpVec2.x / tmpVec2.y;
|
|
126
|
+
const dx = (tmpVec.x * 0.5 + 0.5 - cx) * aspect;
|
|
127
|
+
const dy = tmpVec.y * 0.5 + 0.5 - cy;
|
|
128
|
+
mat.u_limbScreen = Math.max(Math.hypot(dx, dy), 1e-4);
|
|
129
|
+
mat.u_maskEnabled = 1;
|
|
130
|
+
}
|
|
131
|
+
else if (mat) {
|
|
132
|
+
mat.u_maskEnabled = 0;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
return (_jsx("group", { ref: anchorRef, children: _jsxs("mesh", { ref: meshRef, renderOrder: 2, children: [_jsx("planeGeometry", { args: [4.4, 4.4] }), _jsx("flareMaterial", { ref: matRef, transparent: true, depthWrite: false, depthTest: !hostRef && !shooting, blending: AdditiveBlending, u_shootEnabled: shooting ? 1 : 0, ...uniforms })] }) }));
|
|
136
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ForcefieldConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface ForcefieldEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: ForcefieldConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForcefieldEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ForcefieldEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ForcefieldEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ForcefieldEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,qBAAsB,SAAQ,gBAAgB;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AA6ED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoDrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|