@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
|
@@ -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 shieldVert = /* glsl */ `
|
|
7
8
|
varying vec3 vNormal;
|
|
8
9
|
varying vec3 vWorldPos;
|
|
@@ -77,10 +78,11 @@ const shieldFrag = /* glsl */ `
|
|
|
77
78
|
gl_FragColor = vec4(col + uRimColor * ripple * 0.3, alpha);
|
|
78
79
|
}
|
|
79
80
|
`;
|
|
80
|
-
const ForcefieldEffect = ({ boundingRadius, config, animations }) => {
|
|
81
|
+
const ForcefieldEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
81
82
|
const { hexSize, rippleEnabled, shieldColor, rimColor, opacity, speed, intensity } = config;
|
|
82
83
|
const startValuesCacheRef = useRef({});
|
|
83
84
|
const meshRef = useRef(null);
|
|
85
|
+
useObjectReady(meshRef, config, onObjectReady, onObjectDispose);
|
|
84
86
|
const hitSlot = useRef(0);
|
|
85
87
|
const nextHit = useRef(0);
|
|
86
88
|
const mat = useMemo(() => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { HologramConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface HologramEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: HologramConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HologramEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/HologramEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"HologramEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/HologramEffect.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;AAqFD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwDjD,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
|
// Single rich shader handles scanlines, grid, RGB aberration, interference fringes, flicker
|
|
7
8
|
const vertexShader = /* glsl */ `
|
|
8
9
|
varying vec2 vUv;
|
|
@@ -85,9 +86,11 @@ const fragmentShader = /* glsl */ `
|
|
|
85
86
|
gl_FragColor = vec4(hologramColor + uColor * fringe, intensity * uOpacity);
|
|
86
87
|
}
|
|
87
88
|
`;
|
|
88
|
-
const HologramEffect = ({ boundingRadius, config, animations }) => {
|
|
89
|
+
const HologramEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
89
90
|
const { scanlineCount, scanSpeed, scanColor, gridEnabled, flickerAmount, glitchEnabled, opacity, speed, intensity } = config;
|
|
90
91
|
const startValuesCacheRef = useRef({});
|
|
92
|
+
const rootRef = useRef(null);
|
|
93
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
91
94
|
const meshRefs = useRef([]);
|
|
92
95
|
const colorVec = useMemo(() => {
|
|
93
96
|
const c = new THREE.Color(scanColor);
|
|
@@ -135,7 +138,7 @@ const HologramEffect = ({ boundingRadius, config, animations }) => {
|
|
|
135
138
|
applyGenerativeAnimations(materials, animations, startValuesCacheRef.current, Date.now(), false);
|
|
136
139
|
}
|
|
137
140
|
});
|
|
138
|
-
return (_jsx("group", { children: Array.from({ length: scanlineCount }, (_, i) => {
|
|
141
|
+
return (_jsx("group", { ref: rootRef, children: Array.from({ length: scanlineCount }, (_, i) => {
|
|
139
142
|
const y = -boundingRadius * 1.25 + i * stepY;
|
|
140
143
|
return (_jsx("mesh", { ref: el => { meshRefs.current[i] = el; }, material: materials[i], position: [0, y, 0], rotation: [-Math.PI / 2, 0, 0], children: _jsx("planeGeometry", { args: [planeSize, planeSize, 2, 2] }) }, i));
|
|
141
144
|
}) }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { IceCrystalsConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface IceCrystalsEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: IceCrystalsConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IceCrystalsEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceCrystalsEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"IceCrystalsEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceCrystalsEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,sBAAuB,SAAQ,gBAAgB;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAmED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwHvD,CAAC;AACF,eAAe,iBAAiB,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
|
// ── Crystal spike shader ──────────────────────────────────────────────────────
|
|
7
8
|
const spikeVert = /* glsl */ `
|
|
8
9
|
varying vec3 vNormal;
|
|
@@ -67,10 +68,11 @@ const frostFrag = /* glsl */ `
|
|
|
67
68
|
gl_FragColor = vec4(0.85, 0.95, 1.0, g * vA * uOpacity);
|
|
68
69
|
}
|
|
69
70
|
`;
|
|
70
|
-
const IceCrystalsEffect = ({ boundingRadius, config, animations }) => {
|
|
71
|
+
const IceCrystalsEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
71
72
|
const { spikeCount, spikeLength, frostEnabled, iceColor, pulseSpeed, opacity, intensity } = config;
|
|
72
73
|
const startValuesCacheRef = useRef({});
|
|
73
74
|
const groupRef = useRef(null);
|
|
75
|
+
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
74
76
|
const timeRef = useRef(0);
|
|
75
77
|
const r = boundingRadius;
|
|
76
78
|
const N = Math.max(10, Math.min(spikeCount, 60));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { LightningConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface LightningEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: LightningConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightningEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LightningEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"LightningEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LightningEffect.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;AAsDD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwLnD,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
|
// ── Seeded LCG RNG — deterministic, no Math.random ───────────────────────────
|
|
7
8
|
function makeRng(seed) {
|
|
8
9
|
let s = (seed * 1664525 + 1013904223) >>> 0;
|
|
@@ -54,9 +55,11 @@ const glowFrag = /* glsl */ `
|
|
|
54
55
|
}
|
|
55
56
|
`;
|
|
56
57
|
const FADE_DUR = 0.22;
|
|
57
|
-
const LightningEffect = ({ boundingRadius, config, animations }) => {
|
|
58
|
+
const LightningEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
58
59
|
const { boltCount, branchDepth, color, glowColor, opacity, speed, intensity, strikeRadius } = config;
|
|
59
60
|
const startValuesCacheRef = useRef({});
|
|
61
|
+
const rootRef = useRef(null);
|
|
62
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
60
63
|
const depth = Math.min(Math.max(branchDepth, 2), 6);
|
|
61
64
|
const N = Math.pow(2, depth) + 1; // vertex count: 5, 9, 17, 33, 65
|
|
62
65
|
const coreCol = useMemo(() => new THREE.Color(color), [color]);
|
|
@@ -235,6 +238,6 @@ const LightningEffect = ({ boundingRadius, config, animations }) => {
|
|
|
235
238
|
const lineObjects = useMemo(() => bolts.map(bolt => new THREE.Line(bolt.lineGeo, lineMat)),
|
|
236
239
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
237
240
|
[bolts, lineMat]);
|
|
238
|
-
return (_jsx("group", { children: lineObjects.map((lineObj, bi) => (_jsxs("group", { children: [_jsx("primitive", { object: lineObj }), _jsx("points", { geometry: bolts[bi].pointGeo, material: glowMats[bi] })] }, bi))) }));
|
|
241
|
+
return (_jsx("group", { ref: rootRef, children: lineObjects.map((lineObj, bi) => (_jsxs("group", { children: [_jsx("primitive", { object: lineObj }), _jsx("points", { geometry: bolts[bi].pointGeo, material: glowMats[bi] })] }, bi))) }));
|
|
239
242
|
};
|
|
240
243
|
export default LightningEffect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MoleculesConfig, AnimationOptions } from '@3driseai/3drise-core';
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface MoleculesEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: MoleculesConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoleculesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MoleculesEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MoleculesEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/MoleculesEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,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;AA+CD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2HnD,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { useFrame } from '@react-three/fiber';
|
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { getShaderByName } from '@3driseai/3drise-core';
|
|
6
6
|
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
7
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
7
8
|
// Glowing node points at each atom position
|
|
8
9
|
// const nodeVertShader = /* glsl */`
|
|
9
10
|
// attribute float aPhase;
|
|
@@ -48,9 +49,11 @@ import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAn
|
|
|
48
49
|
// gl_FragColor = vec4(col, vAlpha * uOpacity * (glow + spike * 0.6 + core));
|
|
49
50
|
// }
|
|
50
51
|
// `;
|
|
51
|
-
const MoleculesEffect = ({ boundingRadius, config, animations }) => {
|
|
52
|
+
const MoleculesEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
52
53
|
const { atomCount, orbitRadius, atomSize, showBonds, opacity, speed, intensity } = config;
|
|
53
54
|
const startValuesCacheRef = useRef({});
|
|
55
|
+
const rootRef = useRef(null);
|
|
56
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
54
57
|
const shaderData = getShaderByName('Molecules');
|
|
55
58
|
const tRef = useRef(new Float32Array(atomCount));
|
|
56
59
|
const r = boundingRadius * orbitRadius;
|
|
@@ -168,6 +171,6 @@ const MoleculesEffect = ({ boundingRadius, config, animations }) => {
|
|
|
168
171
|
applyGenerativeAnimations([nodeMat, bondMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
169
172
|
}
|
|
170
173
|
});
|
|
171
|
-
return (_jsxs("group", { name: "MoleculesEffect", children: [_jsx("points", { geometry: nodeGeo, material: nodeMat }), showBonds && (_jsx("lineSegments", { geometry: bondGeo, material: bondMat }))] }));
|
|
174
|
+
return (_jsxs("group", { ref: rootRef, name: "MoleculesEffect", children: [_jsx("points", { geometry: nodeGeo, material: nodeMat }), showBonds && (_jsx("lineSegments", { geometry: bondGeo, material: bondMat }))] }));
|
|
172
175
|
};
|
|
173
176
|
export default MoleculesEffect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { NeuralNetworkConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface NeuralNetworkEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: NeuralNetworkConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeuralNetworkEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/NeuralNetworkEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"NeuralNetworkEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/NeuralNetworkEffect.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;AA6BD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA4J3D,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
|
// Glow sprite for pulse signals and node flashes
|
|
7
8
|
const pulseVert = /* glsl */ `
|
|
8
9
|
attribute float aBright;
|
|
@@ -29,10 +30,11 @@ const pulseFrag = /* glsl */ `
|
|
|
29
30
|
}
|
|
30
31
|
`;
|
|
31
32
|
const MAX_PULSES = 4;
|
|
32
|
-
const NeuralNetworkEffect = ({ boundingRadius, config, animations }) => {
|
|
33
|
+
const NeuralNetworkEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
33
34
|
const { nodeCount, signalSpeed, nodeColor, pulseColor, orbitSpeed, opacity, speed, intensity } = config;
|
|
34
35
|
const startValuesCacheRef = useRef({});
|
|
35
36
|
const groupRef = useRef(null);
|
|
37
|
+
useObjectReady(groupRef, config, onObjectReady, onObjectDispose);
|
|
36
38
|
// Node orbit state
|
|
37
39
|
const orbitAngles = useRef(new Float32Array(0));
|
|
38
40
|
const pulses = useRef([]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { OrbConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface OrbEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: OrbConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrbEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/OrbEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"OrbEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/OrbEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,UAAU,cAAe,SAAQ,gBAAgB;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAqLD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4GvC,CAAC;AACF,eAAe,SAAS,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
|
// ── Shared vert (normal + viewDir) ────────────────────────────────────────────
|
|
7
8
|
const sharedVert = /* glsl */ `
|
|
8
9
|
varying vec3 vNormal;
|
|
@@ -181,9 +182,11 @@ const coronaFrag = /* glsl */ `
|
|
|
181
182
|
gl_FragColor = vec4(col * (1.0 + pulse), alpha);
|
|
182
183
|
}
|
|
183
184
|
`;
|
|
184
|
-
const OrbEffect = ({ boundingRadius, config, animations }) => {
|
|
185
|
+
const OrbEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
185
186
|
const { coreSize, glowLayers, innerColor, outerColor, coronaEnabled, coronaColor, noiseAmount, pulseSpeed, opacity, speed, intensity } = config;
|
|
186
187
|
const startValuesCacheRef = useRef({});
|
|
188
|
+
const rootRef = useRef(null);
|
|
189
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
187
190
|
const innerColorVec = useMemo(() => { const c = new THREE.Color(innerColor); return new THREE.Vector3(c.r, c.g, c.b); }, [innerColor]);
|
|
188
191
|
const outerColorVec = useMemo(() => { const c = new THREE.Color(outerColor); return new THREE.Vector3(c.r, c.g, c.b); }, [outerColor]);
|
|
189
192
|
const coronaColorVec = useMemo(() => { const c = new THREE.Color(coronaColor); return new THREE.Vector3(c.r, c.g, c.b); }, [coronaColor]);
|
|
@@ -282,7 +285,7 @@ const OrbEffect = ({ boundingRadius, config, animations }) => {
|
|
|
282
285
|
}
|
|
283
286
|
});
|
|
284
287
|
const glowR = coreR * (3.5 + glowLayers * 0.6);
|
|
285
|
-
return (_jsxs("group", { children: [_jsx("mesh", { material: coreMat, children: _jsx("sphereGeometry", { args: [coreR, 48, 48] }) }), Array.from({ length: glowLayers }, (_, i) => {
|
|
288
|
+
return (_jsxs("group", { ref: rootRef, children: [_jsx("mesh", { material: coreMat, children: _jsx("sphereGeometry", { args: [coreR, 48, 48] }) }), Array.from({ length: glowLayers }, (_, i) => {
|
|
286
289
|
const layerT = glowLayers > 1 ? i / (glowLayers - 1) : 0;
|
|
287
290
|
const r = coreR * (1.35 + layerT * layerT * 1.8);
|
|
288
291
|
return (_jsx("mesh", { material: shellMats[i], children: _jsx("sphereGeometry", { args: [r, 40, 40] }) }, i));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { PortalConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface PortalEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: PortalConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/PortalEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"PortalEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/PortalEffect.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;AAgHD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6E7C,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
|
// Multi-layer vortex disc
|
|
7
8
|
const discVertShader = /* glsl */ `
|
|
8
9
|
varying vec2 vUv;
|
|
@@ -112,9 +113,11 @@ const dustFragShader = /* glsl */ `
|
|
|
112
113
|
gl_FragColor = vec4(uColor, vAlpha * uOpacity * glow);
|
|
113
114
|
}
|
|
114
115
|
`;
|
|
115
|
-
const PortalEffect = ({ boundingRadius, config, animations }) => {
|
|
116
|
+
const PortalEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
116
117
|
const { radius, spiralTurns, innerGlowColor, outerGlowColor, rotationSpeed, particleRingEnabled, particleCount, opacity, speed, intensity } = config;
|
|
117
118
|
const startValuesCacheRef = useRef({});
|
|
119
|
+
const rootRef = useRef(null);
|
|
120
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
118
121
|
const r = boundingRadius * radius;
|
|
119
122
|
const innerColorVec = useMemo(() => { const c = new THREE.Color(innerGlowColor); return new THREE.Vector3(c.r, c.g, c.b); }, [innerGlowColor]);
|
|
120
123
|
const outerColorVec = useMemo(() => { const c = new THREE.Color(outerGlowColor); return new THREE.Vector3(c.r, c.g, c.b); }, [outerGlowColor]);
|
|
@@ -186,6 +189,6 @@ const PortalEffect = ({ boundingRadius, config, animations }) => {
|
|
|
186
189
|
applyGenerativeAnimations([discMaterial, dustMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
187
190
|
}
|
|
188
191
|
});
|
|
189
|
-
return (_jsxs("group", { rotation: [-Math.PI / 2, 0, 0], position: [0, -boundingRadius * 0.75, 0], children: [_jsx("mesh", { material: discMaterial, children: _jsx("circleGeometry", { args: [r, 80] }) }), particleRingEnabled && (_jsx("points", { geometry: dustGeo, material: dustMat }))] }));
|
|
192
|
+
return (_jsxs("group", { ref: rootRef, rotation: [-Math.PI / 2, 0, 0], position: [0, -boundingRadius * 0.75, 0], children: [_jsx("mesh", { material: discMaterial, children: _jsx("circleGeometry", { args: [r, 80] }) }), particleRingEnabled && (_jsx("points", { geometry: dustGeo, material: dustMat }))] }));
|
|
190
193
|
};
|
|
191
194
|
export default PortalEffect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ShockwaveConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface ShockwaveEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: ShockwaveConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShockwaveEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ShockwaveEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ShockwaveEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ShockwaveEffect.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;AAkFD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4EnD,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useRef, useMemo, useEffect } 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
|
// Ring vertex — organic warp + vertical ripple
|
|
7
8
|
const vertexShader = /* glsl */ `
|
|
8
9
|
uniform float uProgress;
|
|
@@ -82,9 +83,11 @@ const flashVert = /* glsl */ `
|
|
|
82
83
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
83
84
|
}
|
|
84
85
|
`;
|
|
85
|
-
const ShockwaveEffect = ({ boundingRadius, config, animations }) => {
|
|
86
|
+
const ShockwaveEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
86
87
|
const { ringCount, expansionRadius, thickness, intervalSeconds, color, rimColor, opacity, speed, intensity } = config;
|
|
87
88
|
const startValuesCacheRef = useRef({});
|
|
89
|
+
const rootRef = useRef(null);
|
|
90
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
88
91
|
const meshRefs = useRef([]);
|
|
89
92
|
const flashRefs = useRef([]);
|
|
90
93
|
const makeRingStates = (count, interval) => Array.from({ length: count }, (_, i) => ({
|
|
@@ -155,6 +158,6 @@ const ShockwaveEffect = ({ boundingRadius, config, animations }) => {
|
|
|
155
158
|
}
|
|
156
159
|
});
|
|
157
160
|
const flashR = radius * 1.05;
|
|
158
|
-
return (_jsx("group", { children: Array.from({ length: ringCount }, (_, i) => (_jsxs("group", { children: [_jsx("mesh", { ref: el => { meshRefs.current[i] = el; }, material: materials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("torusGeometry", { args: [radius, thickness * intensity, 10, 80] }) }), _jsx("mesh", { ref: el => { flashRefs.current[i] = el; }, material: flashMaterials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("circleGeometry", { args: [flashR, 48] }) })] }, i))) }));
|
|
161
|
+
return (_jsx("group", { ref: rootRef, children: Array.from({ length: ringCount }, (_, i) => (_jsxs("group", { children: [_jsx("mesh", { ref: el => { meshRefs.current[i] = el; }, material: materials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("torusGeometry", { args: [radius, thickness * intensity, 10, 80] }) }), _jsx("mesh", { ref: el => { flashRefs.current[i] = el; }, material: flashMaterials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("circleGeometry", { args: [flashR, 48] }) })] }, i))) }));
|
|
159
162
|
};
|
|
160
163
|
export default ShockwaveEffect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SmokePlumeConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface SmokePlumeEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: SmokePlumeConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmokePlumeEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokePlumeEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SmokePlumeEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokePlumeEffect.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,CA8DrD,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
|
// ── Fully GPU-animated smoke puff vertex shader ───────────────────────────────
|
|
7
8
|
// Each particle has a lifetime t ∈ [0,1). It rises, expands, and billows.
|
|
8
9
|
// All motion driven by u_time — zero CPU writes per frame.
|
|
@@ -77,9 +78,11 @@ const smokeFrag = /* glsl */ `
|
|
|
77
78
|
gl_FragColor = vec4(col, g * vAlpha * uOpacity);
|
|
78
79
|
}
|
|
79
80
|
`;
|
|
80
|
-
const SmokePlumeEffect = ({ boundingRadius, config, animations }) => {
|
|
81
|
+
const SmokePlumeEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
81
82
|
const { particleCount, height, spread, smokeColor, turbulence, opacity, speed, intensity } = config;
|
|
82
83
|
const startValuesCacheRef = useRef({});
|
|
84
|
+
const rootRef = useRef(null);
|
|
85
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
83
86
|
const h = boundingRadius * height;
|
|
84
87
|
const s = boundingRadius * spread;
|
|
85
88
|
const { geo, mat } = useMemo(() => {
|
|
@@ -136,6 +139,6 @@ const SmokePlumeEffect = ({ boundingRadius, config, animations }) => {
|
|
|
136
139
|
applyGenerativeAnimations([mat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
137
140
|
}
|
|
138
141
|
});
|
|
139
|
-
return _jsx("points", { geometry: geo, material: mat });
|
|
142
|
+
return _jsx("points", { ref: rootRef, geometry: geo, material: mat });
|
|
140
143
|
};
|
|
141
144
|
export default SmokePlumeEffect;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SmokeRibbonConfig } from '@3driseai/3drise-core';
|
|
2
|
-
|
|
2
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
3
|
+
export interface SmokeRibbonProps extends ObjectReadyProps {
|
|
3
4
|
config?: SmokeRibbonConfig;
|
|
4
5
|
boundingRadius?: number;
|
|
5
6
|
}
|
|
@@ -8,6 +9,6 @@ export interface SmokeRibbonProps {
|
|
|
8
9
|
*
|
|
9
10
|
* <SmokeRibbon position={[0, 0, 0]} config={{ planes: 2, twistStart: 0.2 }} />
|
|
10
11
|
*/
|
|
11
|
-
declare const SmokeRibbon: ({ config, boundingRadius, ...groupProps }: SmokeRibbonProps) => import("react").JSX.Element;
|
|
12
|
+
declare const SmokeRibbon: ({ config, boundingRadius, onObjectReady, onObjectDispose, ...groupProps }: SmokeRibbonProps) => import("react").JSX.Element;
|
|
12
13
|
export default SmokeRibbon;
|
|
13
14
|
//# sourceMappingURL=SmokeRibbon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmokeRibbon.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRibbon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SmokeRibbon.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRibbon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACtD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW,GAAI,2EAAoF,gBAAgB,gCA2DxH,CAAC;AACF,eAAe,WAAW,CAAC"}
|
|
@@ -3,12 +3,13 @@ import { PlaneGeometry } from 'three';
|
|
|
3
3
|
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
4
|
import { useFrame, useThree } from '@react-three/fiber';
|
|
5
5
|
import { SmokeRibbonMaterial } from '@3driseai/3drise-core';
|
|
6
|
+
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
6
7
|
/**
|
|
7
8
|
* Place where you want the smoke to rise from — it climbs the parent's local +Y:
|
|
8
9
|
*
|
|
9
10
|
* <SmokeRibbon position={[0, 0, 0]} config={{ planes: 2, twistStart: 0.2 }} />
|
|
10
11
|
*/
|
|
11
|
-
const SmokeRibbon = ({ config = {}, boundingRadius = 1, ...groupProps }) => {
|
|
12
|
+
const SmokeRibbon = ({ config = {}, boundingRadius = 1, onObjectReady, onObjectDispose, ...groupProps }) => {
|
|
12
13
|
const { width = 1.5, height = 5, segmentsPerLength = 12, planes = 2, color = '#f2f2f7', colorTop = '#b3b8c7', speed = 0.18, detail = 1.4, remapLow = 0.38, remapHigh = 1.0, edgeX = 0.4, edgeY = 0.32, density = 1.0, twistStrength = 9, twistSpeed = 0.4, twistScale = 0.9, twistStart = 0.18, wind = [0.15, 0], animate = true, interactive = false, } = config;
|
|
13
14
|
// One material instance shared across the crossed planes -> one set of uniforms.
|
|
14
15
|
const material = useMemo(() => new SmokeRibbonMaterial(), []);
|
|
@@ -50,6 +51,8 @@ const SmokeRibbon = ({ config = {}, boundingRadius = 1, ...groupProps }) => {
|
|
|
50
51
|
]);
|
|
51
52
|
const { pointer } = useThree();
|
|
52
53
|
const hovering = useRef(false);
|
|
54
|
+
const rootRef = useRef(null);
|
|
55
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
53
56
|
useFrame(({ clock }) => {
|
|
54
57
|
if (animate)
|
|
55
58
|
material.u_time = clock.getElapsedTime();
|
|
@@ -64,6 +67,6 @@ const SmokeRibbon = ({ config = {}, boundingRadius = 1, ...groupProps }) => {
|
|
|
64
67
|
}
|
|
65
68
|
});
|
|
66
69
|
console.log('SmokeRibbon render with config:', config, 'and groupProps:', groupProps);
|
|
67
|
-
return (_jsx("group", { ...groupProps, onPointerOver: interactive ? () => (hovering.current = true) : undefined, onPointerOut: interactive ? () => (hovering.current = false) : undefined, children: angles.map((a, i) => (_jsx("mesh", { geometry: geometry, material: material, "rotation-y": a }, i))) }));
|
|
70
|
+
return (_jsx("group", { ref: rootRef, ...groupProps, onPointerOver: interactive ? () => (hovering.current = true) : undefined, onPointerOut: interactive ? () => (hovering.current = false) : undefined, children: angles.map((a, i) => (_jsx("mesh", { geometry: geometry, material: material, "rotation-y": a }, i))) }));
|
|
68
71
|
};
|
|
69
72
|
export default SmokeRibbon;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SmokeRingConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface SmokeRingEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: SmokeRingConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmokeRingEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRingEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SmokeRingEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/SmokeRingEffect.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;AAiED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2FnD,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
|
// ── Per-ring puff shader (one Points per ring — GPU computes torus positions) ──
|
|
7
8
|
const ringVert = /* glsl */ `
|
|
8
9
|
attribute float aAngle; // 0..TAU position around torus
|
|
@@ -65,9 +66,11 @@ const ringFrag = /* glsl */ `
|
|
|
65
66
|
}
|
|
66
67
|
`;
|
|
67
68
|
const PUFFS_PER_RING = 120;
|
|
68
|
-
const SmokeRingEffect = ({ boundingRadius, config, animations }) => {
|
|
69
|
+
const SmokeRingEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
69
70
|
const { ringCount, expansionRadius, riseSpeed, intervalSeconds, smokeColor, thickness, opacity, speed, intensity } = config;
|
|
70
71
|
const startValuesCacheRef = useRef({});
|
|
72
|
+
const rootRef = useRef(null);
|
|
73
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
71
74
|
const N = Math.max(1, Math.min(ringCount, 4));
|
|
72
75
|
// Ring states — one per slot
|
|
73
76
|
const ringStates = useRef([]);
|
|
@@ -153,6 +156,6 @@ const SmokeRingEffect = ({ boundingRadius, config, animations }) => {
|
|
|
153
156
|
applyGenerativeAnimations(mats, animations, startValuesCacheRef.current, Date.now(), false);
|
|
154
157
|
}
|
|
155
158
|
});
|
|
156
|
-
return (_jsx("group", { children: geos.map((geo, i) => (_jsx("points", { geometry: geo, material: mats[i] }, i))) }));
|
|
159
|
+
return (_jsx("group", { ref: rootRef, children: geos.map((geo, i) => (_jsx("points", { geometry: geo, material: mats[i] }, i))) }));
|
|
157
160
|
};
|
|
158
161
|
export default SmokeRingEffect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { VolumetricFogConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
-
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
interface VolumetricFogEffectProps extends ObjectReadyProps {
|
|
4
5
|
boundingRadius: number;
|
|
5
6
|
config: VolumetricFogConfig;
|
|
6
7
|
animations?: AnimationOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumetricFogEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/VolumetricFogEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"VolumetricFogEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/VolumetricFogEffect.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;AAoDD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAyD3D,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
|
// ── Billboard fog puff — drifts slowly, never rises far ───────────────────────
|
|
7
8
|
const fogVert = /* glsl */ `
|
|
8
9
|
attribute float aT; // stagger offset 0..1
|
|
@@ -52,9 +53,11 @@ const fogFrag = /* glsl */ `
|
|
|
52
53
|
gl_FragColor = vec4(uFogColor, g * vAlpha * uDensity);
|
|
53
54
|
}
|
|
54
55
|
`;
|
|
55
|
-
const VolumetricFogEffect = ({ boundingRadius, config, animations }) => {
|
|
56
|
+
const VolumetricFogEffect = ({ boundingRadius, config, animations, onObjectReady, onObjectDispose }) => {
|
|
56
57
|
const { particleCount, fogRadius, driftSpeed, fogColor, density, opacity, intensity } = config;
|
|
57
58
|
const startValuesCacheRef = useRef({});
|
|
59
|
+
const rootRef = useRef(null);
|
|
60
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
58
61
|
const r = boundingRadius * fogRadius;
|
|
59
62
|
const { geo, mat } = useMemo(() => {
|
|
60
63
|
const N = Math.max(20, Math.min(particleCount, 200));
|
|
@@ -106,6 +109,6 @@ const VolumetricFogEffect = ({ boundingRadius, config, animations }) => {
|
|
|
106
109
|
applyGenerativeAnimations([mat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
107
110
|
}
|
|
108
111
|
});
|
|
109
|
-
return _jsx("points", { geometry: geo, material: mat });
|
|
112
|
+
return _jsx("points", { ref: rootRef, geometry: geo, material: mat });
|
|
110
113
|
};
|
|
111
114
|
export default VolumetricFogEffect;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type { CoronaProps } from './Corona';
|
|
2
|
+
export type { FireProps } from './Fire';
|
|
3
|
+
export type { FlaresProps } from './Flares';
|
|
4
|
+
export type { SmokeRibbonProps } from './SmokeRibbon';
|
|
5
|
+
export { default as AuraEffect } from './AuraEffect';
|
|
6
|
+
export { default as AuroraEffect } from './AuroraEffect';
|
|
7
|
+
export { default as BlackHoleEffect } from './BlackHoleEffect';
|
|
8
|
+
export { default as ConstellationEffect } from './ConstellationEffect';
|
|
9
|
+
export { default as Corona } from './Corona';
|
|
10
|
+
export { default as DataStreamEffect } from './DataStreamEffect';
|
|
11
|
+
export { default as DnaHelixEffect } from './DnaHelixEffect';
|
|
12
|
+
export { default as Fire } from './Fire';
|
|
13
|
+
export { default as FireEffect } from './FireEffect';
|
|
14
|
+
export { default as Flares } from './Flares';
|
|
15
|
+
export { default as ForcefieldEffect } from './ForcefieldEffect';
|
|
16
|
+
export { default as HologramEffect } from './HologramEffect';
|
|
17
|
+
export { default as IceCrystalsEffect } from './IceCrystalsEffect';
|
|
18
|
+
export { default as LightningEffect } from './LightningEffect';
|
|
19
|
+
export { default as MoleculesEffect } from './MoleculesEffect';
|
|
20
|
+
export { default as NeuralNetworkEffect } from './NeuralNetworkEffect';
|
|
21
|
+
export { default as OrbEffect } from './OrbEffect';
|
|
22
|
+
export { default as PortalEffect } from './PortalEffect';
|
|
23
|
+
export { default as ShockwaveEffect } from './ShockwaveEffect';
|
|
24
|
+
export { default as SmokePlumeEffect } from './SmokePlumeEffect';
|
|
25
|
+
export { default as SmokeRibbon } from './SmokeRibbon';
|
|
26
|
+
export { default as SmokeRingEffect } from './SmokeRingEffect';
|
|
27
|
+
export { default as VolumetricFogEffect } from './VolumetricFogEffect';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/effects/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,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,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,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,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|