@ntalmagor/3drize-viewer 0.1.25 → 0.1.27

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.
Files changed (157) hide show
  1. package/dist/components/Bubbles.d.ts +9 -0
  2. package/dist/components/Bubbles.d.ts.map +1 -0
  3. package/dist/components/Bubbles.js +105 -0
  4. package/dist/components/Clouds.js +18 -10
  5. package/dist/components/Corona.d.ts +26 -0
  6. package/dist/components/Corona.d.ts.map +1 -0
  7. package/dist/components/Corona.js +12 -0
  8. package/dist/components/CreatedObject.js +1 -1
  9. package/dist/components/CustomPrimitive.d.ts.map +1 -1
  10. package/dist/components/CustomPrimitive.js +46 -40
  11. package/dist/components/Earth.d.ts +8 -0
  12. package/dist/components/Earth.d.ts.map +1 -0
  13. package/dist/components/Earth.js +38 -0
  14. package/dist/components/EffectsGenerator.d.ts +1 -1
  15. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  16. package/dist/components/EffectsGenerator.js +10 -2
  17. package/dist/components/EffectsGroup.d.ts.map +1 -1
  18. package/dist/components/EffectsGroup.js +3 -1
  19. package/dist/components/Flares.d.ts +64 -0
  20. package/dist/components/Flares.d.ts.map +1 -0
  21. package/dist/components/Flares.js +134 -0
  22. package/dist/components/Frame.js +1 -0
  23. package/dist/components/GalleryLayout.d.ts.map +1 -1
  24. package/dist/components/GalleryLayout.js +5 -5
  25. package/dist/components/Glyphs.d.ts +9 -0
  26. package/dist/components/Glyphs.d.ts.map +1 -0
  27. package/dist/components/Glyphs.js +58 -0
  28. package/dist/components/GridHelper.js +1 -1
  29. package/dist/components/ImageGeometry.js +1 -1
  30. package/dist/components/Lensflare.d.ts +1 -1
  31. package/dist/components/Lensflare.d.ts.map +1 -1
  32. package/dist/components/Lensflare.js +1 -1
  33. package/dist/components/Moon.d.ts +2 -2
  34. package/dist/components/Moon.d.ts.map +1 -1
  35. package/dist/components/Moon.js +23 -9
  36. package/dist/components/ObjectNode.d.ts.map +1 -1
  37. package/dist/components/ObjectNode.js +25 -5
  38. package/dist/components/PathRenderer.d.ts +0 -2
  39. package/dist/components/PathRenderer.d.ts.map +1 -1
  40. package/dist/components/PathRenderer.js +4 -1
  41. package/dist/components/Planet.d.ts +16 -0
  42. package/dist/components/Planet.d.ts.map +1 -0
  43. package/dist/components/Planet.js +60 -0
  44. package/dist/components/ProjectLoader.d.ts.map +1 -1
  45. package/dist/components/ProjectLoader.js +1 -7
  46. package/dist/components/SceneBuilder.d.ts.map +1 -1
  47. package/dist/components/SceneBuilder.js +2 -1
  48. package/dist/components/ShootingStars.d.ts.map +1 -1
  49. package/dist/components/ShootingStars.js +1 -0
  50. package/dist/components/SkySystem.d.ts.map +1 -1
  51. package/dist/components/SkySystem.js +2 -2
  52. package/dist/components/Skybox.js +1 -1
  53. package/dist/components/SolarSystem.d.ts +5 -0
  54. package/dist/components/SolarSystem.d.ts.map +1 -0
  55. package/dist/components/SolarSystem.js +76 -0
  56. package/dist/components/SparklesBurst.d.ts +9 -0
  57. package/dist/components/SparklesBurst.d.ts.map +1 -0
  58. package/dist/components/SparklesBurst.js +62 -0
  59. package/dist/components/Sun.d.ts +34 -0
  60. package/dist/components/Sun.d.ts.map +1 -0
  61. package/dist/components/Sun.js +7 -0
  62. package/dist/components/SunCore.d.ts +26 -0
  63. package/dist/components/SunCore.d.ts.map +1 -0
  64. package/dist/components/SunCore.js +14 -0
  65. package/dist/components/cursor/AuraCursor.d.ts +6 -0
  66. package/dist/components/cursor/AuraCursor.d.ts.map +1 -0
  67. package/dist/components/cursor/AuraCursor.js +30 -0
  68. package/dist/components/cursor/AuroraCursor.d.ts +6 -0
  69. package/dist/components/cursor/AuroraCursor.d.ts.map +1 -0
  70. package/dist/components/cursor/AuroraCursor.js +207 -0
  71. package/dist/components/cursor/BubblesCursor.d.ts +6 -0
  72. package/dist/components/cursor/BubblesCursor.d.ts.map +1 -0
  73. package/dist/components/cursor/BubblesCursor.js +184 -0
  74. package/dist/components/cursor/CometCursor.d.ts +6 -0
  75. package/dist/components/cursor/CometCursor.d.ts.map +1 -0
  76. package/dist/components/cursor/CometCursor.js +191 -0
  77. package/dist/components/cursor/CrosshairCursor.d.ts +6 -0
  78. package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -0
  79. package/dist/components/cursor/CrosshairCursor.js +142 -0
  80. package/dist/components/cursor/CursorActions.d.ts +8 -0
  81. package/dist/components/cursor/CursorActions.d.ts.map +1 -0
  82. package/dist/components/cursor/CursorActions.js +124 -0
  83. package/dist/components/cursor/CursorController.d.ts +10 -0
  84. package/dist/components/cursor/CursorController.d.ts.map +1 -0
  85. package/dist/components/cursor/CursorController.js +5 -0
  86. package/dist/components/cursor/CursorEffects.d.ts +16 -0
  87. package/dist/components/cursor/CursorEffects.d.ts.map +1 -0
  88. package/dist/components/cursor/CursorEffects.js +110 -0
  89. package/dist/components/cursor/FerrofluidCursor.d.ts +6 -0
  90. package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -0
  91. package/dist/components/cursor/FerrofluidCursor.js +102 -0
  92. package/dist/components/cursor/GlyphRingCursor.d.ts +6 -0
  93. package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -0
  94. package/dist/components/cursor/GlyphRingCursor.js +123 -0
  95. package/dist/components/cursor/LightningCursor.d.ts +6 -0
  96. package/dist/components/cursor/LightningCursor.d.ts.map +1 -0
  97. package/dist/components/cursor/LightningCursor.js +28 -0
  98. package/dist/components/cursor/LiquidMetalCursor.d.ts +6 -0
  99. package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -0
  100. package/dist/components/cursor/LiquidMetalCursor.js +61 -0
  101. package/dist/components/cursor/OrbCursor.d.ts +6 -0
  102. package/dist/components/cursor/OrbCursor.d.ts.map +1 -0
  103. package/dist/components/cursor/OrbCursor.js +32 -0
  104. package/dist/components/cursor/PlasmaWhipCursor.d.ts +6 -0
  105. package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -0
  106. package/dist/components/cursor/PlasmaWhipCursor.js +134 -0
  107. package/dist/components/cursor/SparklesCursor.d.ts +6 -0
  108. package/dist/components/cursor/SparklesCursor.d.ts.map +1 -0
  109. package/dist/components/cursor/SparklesCursor.js +151 -0
  110. package/dist/components/cursor/TeslaCursor.d.ts +6 -0
  111. package/dist/components/cursor/TeslaCursor.d.ts.map +1 -0
  112. package/dist/components/cursor/TeslaCursor.js +223 -0
  113. package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +11 -0
  114. package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -0
  115. package/dist/components/cursor/clickActions/BoltFlashAction.js +62 -0
  116. package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +11 -0
  117. package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -0
  118. package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +114 -0
  119. package/dist/components/cursor/clickActions/ImplosionAction.d.ts +11 -0
  120. package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -0
  121. package/dist/components/cursor/clickActions/ImplosionAction.js +93 -0
  122. package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +11 -0
  123. package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -0
  124. package/dist/components/cursor/clickActions/PhaseShiftAction.js +71 -0
  125. package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +11 -0
  126. package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -0
  127. package/dist/components/cursor/clickActions/PlasmaBombAction.js +98 -0
  128. package/dist/components/cursor/clickActions/RealityTearAction.d.ts +11 -0
  129. package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -0
  130. package/dist/components/cursor/clickActions/RealityTearAction.js +92 -0
  131. package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +11 -0
  132. package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -0
  133. package/dist/components/cursor/clickActions/ShockwaveAction.js +55 -0
  134. package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +11 -0
  135. package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -0
  136. package/dist/components/cursor/clickActions/SparklesBurstAction.js +99 -0
  137. package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +11 -0
  138. package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -0
  139. package/dist/components/cursor/clickActions/VoronoiFractureAction.js +149 -0
  140. package/dist/components/effects/Fire.d.ts +29 -0
  141. package/dist/components/effects/Fire.d.ts.map +1 -0
  142. package/dist/components/effects/Fire.js +208 -0
  143. package/dist/hooks/useContinuousEffects.js +2 -7
  144. package/dist/hooks/useMeshController.d.ts.map +1 -1
  145. package/dist/hooks/useMeshController.js +83 -29
  146. package/dist/hooks/useSequenceAnimation.d.ts.map +1 -1
  147. package/dist/hooks/useSequenceAnimation.js +38 -17
  148. package/dist/index.d.ts +6 -1
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +6 -1
  151. package/dist/utils/CameraSingleton.d.ts +8 -1
  152. package/dist/utils/CameraSingleton.d.ts.map +1 -1
  153. package/dist/utils/CameraSingleton.js +22 -1
  154. package/dist/utils/cursorPicking.d.ts +8 -0
  155. package/dist/utils/cursorPicking.d.ts.map +1 -0
  156. package/dist/utils/cursorPicking.js +35 -0
  157. package/package.json +2 -2
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { BubblesConfig } from '@ntalmagor/3drize-core';
3
+ export interface BubblesProps {
4
+ config: BubblesConfig;
5
+ boundingRadius?: number;
6
+ }
7
+ declare const Bubbles: React.FC<BubblesProps>;
8
+ export default Bubbles;
9
+ //# sourceMappingURL=Bubbles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bubbles.d.ts","sourceRoot":"","sources":["../../src/components/Bubbles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAyB,MAAM,wBAAwB,CAAC;AAKnF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8GnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef } from 'react';
3
+ import { useFrame } from '@react-three/fiber';
4
+ import * as THREE from 'three';
5
+ import { BubblesPointsMaterial } from '@ntalmagor/3drize-core';
6
+ const MAX_BUBBLES = 256;
7
+ const Bubbles = ({ config }) => {
8
+ const positions = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
9
+ const velocities = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
10
+ const ages = useMemo(() => new Float32Array(MAX_BUBBLES), []);
11
+ const lives = useMemo(() => new Float32Array(MAX_BUBBLES), []);
12
+ const baseSizes = useMemo(() => new Float32Array(MAX_BUBBLES), []);
13
+ const phases = useMemo(() => new Float32Array(MAX_BUBBLES), []);
14
+ const alive = useMemo(() => new Uint8Array(MAX_BUBBLES), []);
15
+ const geometry = useMemo(() => {
16
+ const g = new THREE.BufferGeometry();
17
+ g.setAttribute('position', new THREE.BufferAttribute(positions, 3));
18
+ g.setAttribute('aAge', new THREE.BufferAttribute(ages, 1));
19
+ g.setAttribute('aLife', new THREE.BufferAttribute(lives, 1));
20
+ g.setAttribute('aBaseSize', new THREE.BufferAttribute(baseSizes, 1));
21
+ g.setAttribute('aPhase', new THREE.BufferAttribute(phases, 1));
22
+ for (let i = 0; i < MAX_BUBBLES; i++)
23
+ positions[i * 3 + 1] = -1e6;
24
+ return g;
25
+ }, [positions, ages, lives, baseSizes, phases]);
26
+ const material = useMemo(() => {
27
+ const m = new BubblesPointsMaterial();
28
+ m.transparent = true;
29
+ m.depthWrite = false;
30
+ m.blending = THREE.NormalBlending;
31
+ return m;
32
+ }, []);
33
+ useEffect(() => {
34
+ const u = material.uniforms;
35
+ const [cA, cB, cC] = config.colors ?? ['#aaccff', '#ffaadd', '#aaffcc'];
36
+ u.uColorA.value.set(cA);
37
+ u.uColorB.value.set(cB);
38
+ u.uColorC.value.set(cC);
39
+ u.uScale.value = (config.scale ?? 1) / 10;
40
+ u.uOpacity.value = config.opacity ?? 0.6;
41
+ u.uIridescence.value = config.iridescence ?? 0.7;
42
+ u.uSpeed.value = config.speed ?? 1;
43
+ }, [config.colors, config.scale, config.opacity, config.iridescence, config.speed, material]);
44
+ useEffect(() => () => { geometry.dispose(); material.dispose(); }, [geometry, material]);
45
+ const spawnAccum = useRef(0);
46
+ useFrame((state, delta) => {
47
+ material.uniforms.uTime.value = state.clock.getElapsedTime();
48
+ const scale = config.scale ?? 1;
49
+ const spawnRate = config.spawnRate ?? 8;
50
+ const floatSpeed = (config.floatSpeed ?? 0.5) * (config.speed ?? 1);
51
+ const lifetimeMs = config.lifetimeMs ?? 4000;
52
+ const speed = config.speed ?? 1;
53
+ spawnAccum.current += spawnRate * delta;
54
+ let toSpawn = Math.floor(spawnAccum.current);
55
+ spawnAccum.current -= toSpawn;
56
+ const dtMs = delta * 1000 * speed;
57
+ let scan = 0;
58
+ while (toSpawn > 0 && scan < MAX_BUBBLES) {
59
+ if (alive[scan] === 0) {
60
+ const base = scan * 3;
61
+ // Spawn at local origin with small lateral jitter — parent group's
62
+ // transform places the system in world space.
63
+ positions[base + 0] = (Math.random() - 0.5) * 0.2 * scale;
64
+ positions[base + 1] = (Math.random() - 0.5) * 0.1 * scale;
65
+ positions[base + 2] = (Math.random() - 0.5) * 0.2 * scale;
66
+ velocities[base + 0] = (Math.random() - 0.5) * 0.4;
67
+ velocities[base + 1] = floatSpeed * (0.7 + Math.random() * 0.6);
68
+ velocities[base + 2] = (Math.random() - 0.5) * 0.4;
69
+ ages[scan] = 0;
70
+ lives[scan] = lifetimeMs * (0.7 + Math.random() * 0.6);
71
+ baseSizes[scan] = (16 + Math.random() * 28) * (scale / 10);
72
+ phases[scan] = Math.random() * 100;
73
+ alive[scan] = 1;
74
+ toSpawn--;
75
+ }
76
+ scan++;
77
+ }
78
+ for (let j = 0; j < MAX_BUBBLES; j++) {
79
+ if (alive[j] === 0)
80
+ continue;
81
+ const base = j * 3;
82
+ ages[j] += dtMs;
83
+ if (ages[j] >= lives[j]) {
84
+ alive[j] = 0;
85
+ positions[base + 1] = -1e6;
86
+ continue;
87
+ }
88
+ velocities[base + 0] *= 0.99;
89
+ velocities[base + 2] *= 0.99;
90
+ const wobble = Math.sin(state.clock.getElapsedTime() * 1.3 * speed + phases[j]) * 0.05;
91
+ positions[base + 0] += velocities[base + 0] * delta + wobble * delta;
92
+ positions[base + 1] += velocities[base + 1] * delta;
93
+ positions[base + 2] += velocities[base + 2] * delta;
94
+ }
95
+ geometry.attributes.position.needsUpdate = true;
96
+ geometry.attributes.aAge.needsUpdate = true;
97
+ geometry.attributes.aLife.needsUpdate = true;
98
+ geometry.attributes.aBaseSize.needsUpdate = true;
99
+ geometry.attributes.aPhase.needsUpdate = true;
100
+ });
101
+ if (!config.enabled)
102
+ return null;
103
+ return _jsx("points", { geometry: geometry, material: material, frustumCulled: false });
104
+ };
105
+ export default Bubbles;
@@ -5,7 +5,7 @@ import { useThree, useFrame } from '@react-three/fiber';
5
5
  import { useSkySystem } from '../hooks/useSkySystem.js';
6
6
  import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
7
7
  import { useNumericAnimation } from '../hooks/useNumericAnimation.js';
8
- import { calculateTimeProgress, applyEasing, gsapEasingMap, interpolateValue, handleTransformMouseMove, handleMaterialMouseMove, interpolateMouseMoveProperty, } from '@ntalmagor/3drize-core';
8
+ import { calculateTimeProgress, applyEasing, gsapEasingMap, interpolateValue, interpolateMouseMoveProperty, } from '@ntalmagor/3drize-core';
9
9
  const CLOUD_COLORS = {
10
10
  night: new THREE.Color(0.1, 0.1, 0.2),
11
11
  sunrise: new THREE.Color(0.8, 0.4, 0.4),
@@ -189,7 +189,7 @@ const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
189
189
  const now = Date.now();
190
190
  const pointer = state.pointer;
191
191
  // ── PER-DOMAIN ANIMATIONS ────────────────────────────────────────────────
192
- const mm = settings.mouseMove;
192
+ const mouseMove = settings.mouseMove;
193
193
  // const isPerDomain = mm && ('transform' in mm || 'material' in mm || 'edges' in mm || 'light' in mm || 'clouds' in mm);
194
194
  // transform: position / rotation / scale
195
195
  // const transformAnims = settings.animations?.transform?.animations;
@@ -214,14 +214,22 @@ const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
214
214
  // clouds: speed
215
215
  applyCloudsKeyframeAnimations(settings.animations?.clouds?.animations, cloudsAnimCacheRef.current, config, animatedOverrideRef.current, now);
216
216
  // ── PER-DOMAIN MOUSE-MOVE ─────────────────────────────────────────────────
217
- if (mm) {
218
- const perDomain = mm;
219
- if (perDomain.transform?.enabled && perDomain.transform.properties?.length) {
220
- handleTransformMouseMove({ object: mesh, meshSettings: meshSettings }, perDomain.transform.properties, pointer);
221
- }
222
- if (perDomain.material?.enabled && perDomain.material.properties?.length) {
223
- handleMaterialMouseMove({ object: mesh, materialSettings: materialSettings }, perDomain.material.properties, pointer);
224
- }
217
+ if (mouseMove) {
218
+ const perDomain = mouseMove;
219
+ // if (perDomain.transform?.enabled && perDomain.transform.properties?.length) {
220
+ // handleTransformMouseMove(
221
+ // { object: mesh, meshSettings: meshSettings as any },
222
+ // perDomain.transform.properties,
223
+ // pointer,
224
+ // );
225
+ // }
226
+ // if (perDomain.material?.enabled && perDomain.material.properties?.length) {
227
+ // handleMaterialMouseMove(
228
+ // { object: mesh, materialSettings: materialSettings as any },
229
+ // perDomain.material.properties,
230
+ // pointer,
231
+ // );
232
+ // }
225
233
  applyCloudsMouseMove(perDomain.clouds?.enabled ? perDomain.clouds.properties : undefined, config, mouseOverrideRef.current, pointer);
226
234
  }
227
235
  // ── EFFECTIVE SPEED + UNIFORM UPDATES ─────────────────────────────────────
@@ -0,0 +1,26 @@
1
+ import * as THREE from "three";
2
+ /**
3
+ * <Corona />
4
+ * The halo: an inverted (BackSide) sphere shell driven by SunCoronaMaterial,
5
+ * additively blended. The shell scale is kept in sync with the material's
6
+ * u_shellScale so the falloff math stays correct at any size.
7
+ *
8
+ * Note: additive blending — reads best against a dark scene background.
9
+ */
10
+ declare global {
11
+ namespace JSX {
12
+ interface IntrinsicElements {
13
+ sunCoronaMaterial: any;
14
+ }
15
+ }
16
+ }
17
+ export type CoronaProps = {
18
+ /** Radius of the core this corona surrounds. Default 1. */
19
+ radius?: number;
20
+ /** Shell size relative to the core. Default 1.25. Synced with u_shellScale. */
21
+ shellScale?: number;
22
+ /** Uniform overrides for SunCoronaMaterial (u_intensity, u_innerColor, ...). */
23
+ uniforms?: Record<string, number | THREE.Vector3 | number[]>;
24
+ };
25
+ export default function Corona({ radius, shellScale, uniforms }: CoronaProps): import("react/jsx-runtime").JSX.Element;
26
+ //# sourceMappingURL=Corona.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Corona.d.ts","sourceRoot":"","sources":["../../src/components/Corona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;GAOG;AAEH,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,iBAAiB,EAAE,GAAG,CAAC;SACxB;KACF;CACF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,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;CAC9D,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,MAAU,EACV,UAAiB,EACjB,QAAQ,EACT,EAAE,WAAW,2CAsBb"}
@@ -0,0 +1,12 @@
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
+ export default function Corona({ radius = 1, shellScale = 1.25, uniforms }) {
6
+ const matRef = useRef(null);
7
+ useFrame((_, delta) => {
8
+ if (matRef.current)
9
+ matRef.current.u_time += delta;
10
+ });
11
+ return (_jsxs("mesh", { 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 })] }));
12
+ }
@@ -15,7 +15,7 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
15
15
  // const { handleObjectClick: contextHandleObjectClick } = useSceneClick();
16
16
  const meshRef = useRef(null);
17
17
  const transformRef = useRef(null);
18
- const baseColorRef = useRef(("color" in createdObject.materialSettings && createdObject.materialSettings.color) || '#ffffff');
18
+ // const baseColorRef = useRef<string>(("color" in createdObject.materialSettings && createdObject.materialSettings.color) || '#ffffff');
19
19
  // const [hovered, setHovered] = useState(false);
20
20
  const [animatedTransform, setAnimatedTransform] = useState({
21
21
  position: createdObject.meshSettings.position,
@@ -1 +1 @@
1
- {"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAoB,KAAK,qBAAqB,EAKzC,MAAM,wBAAwB,CAAC;AAI3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,UAAU,oBAAoB;IAC5B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgFlD,CAAC;AAIH,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAEvD,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAQ,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,UAAU,oBAAoB;IAC5B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAiFlD,CAAC;AAIH,eAAe,eAAe,CAAC"}
@@ -1,53 +1,59 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useRef, memo } from "react";
3
- import { ObjectManager } from "@ntalmagor/3drize-core";
2
+ import { useRef, useEffect, memo } from "react";
3
+ import { createMeshByType, ObjectManager, } from "@ntalmagor/3drize-core";
4
+ import { Mesh } from "three";
4
5
  import MaterialLibrary from "./MaterialLibrary.js";
5
6
  const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick, }) => {
6
- // const { handleObjectClick } = useSceneClick();
7
- // console.log("Rendering CustomPrimitive with settings:", createdObject.name, createdObject);
8
7
  const meshRef = useRef(null);
9
- // const effectStateRef = useRef<EffectState | null>(null);
10
- // const [animatedTransform, setAnimatedTransform] = React.useState<AnimatedTransform>({
11
- // position: createdObject.meshSettings.position,
12
- // rotation: createdObject.meshSettings.rotation,
13
- // scale: createdObject.meshSettings.scale,
14
- // });
15
- // Initialize transform controls
16
- // const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(true);
17
- // useEffect(() => {
18
- // setAnimatedTransform({
19
- // position: createdObject.meshSettings.position,
20
- // rotation: createdObject.meshSettings.rotation,
21
- // scale: createdObject.meshSettings.scale,
22
- // });
23
- // }, [createdObject.meshSettings.position, createdObject.meshSettings.rotation, createdObject.meshSettings.scale]);
8
+ useEffect(() => {
9
+ if (createdObject.type !== 'mesh')
10
+ return;
11
+ const managedObject = ObjectManager.getObject(createdObject.id);
12
+ if (!managedObject || !(managedObject.object instanceof Mesh))
13
+ return;
14
+ const targetMesh = managedObject.object;
15
+ const meshType = createdObject.config?.type || managedObject.object.userData?.type || 'box';
16
+ const meshData = {
17
+ position: [targetMesh.position.x, targetMesh.position.y, targetMesh.position.z],
18
+ rotation: [targetMesh.rotation.x, targetMesh.rotation.y, targetMesh.rotation.z],
19
+ scale: [targetMesh.scale.x, targetMesh.scale.y, targetMesh.scale.z],
20
+ visible: targetMesh.visible,
21
+ name: targetMesh.name || createdObject.name,
22
+ ...createdObject.config,
23
+ type: meshType,
24
+ id: createdObject.id,
25
+ };
26
+ const generated = createMeshByType(meshData);
27
+ if (!generated)
28
+ return;
29
+ if (targetMesh.geometry !== generated.mesh.geometry) {
30
+ targetMesh.geometry?.dispose();
31
+ targetMesh.geometry = generated.mesh.geometry;
32
+ }
33
+ targetMesh.userData = {
34
+ ...targetMesh.userData,
35
+ type: meshType,
36
+ id: createdObject.id,
37
+ options: generated.config,
38
+ };
39
+ if (generated.mesh.material && generated.mesh.material !== targetMesh.material) {
40
+ if (Array.isArray(generated.mesh.material)) {
41
+ generated.mesh.material.forEach((m) => m.dispose());
42
+ }
43
+ else {
44
+ generated.mesh.material.dispose();
45
+ }
46
+ }
47
+ }, [
48
+ createdObject.config,
49
+ ]);
24
50
  const useDreiMaterials = createdObject.materialSettings.materialType === "advanced";
25
- // const apply3driseMaterials = !useDreiMaterials;
26
- // const willApplyMaterial = apply3driseMaterials && !!createdObject.materialSettings.materialVariant;
27
- // const [materialReady, setMaterialReady] = useState(!willApplyMaterial);
28
- // get initial object from ObjectManager to add to scene with primitive, then use findById to get updated reference with materials applied by useMaterialApplication
29
51
  const obj = ObjectManager.getObject(createdObject.id);
30
- // const object = findById(createdObject.id);
31
- // useMaterialApplication(object ?? null, createdObject.materialSettings, apply3driseMaterials, () => setMaterialReady(true));
32
52
  if (!obj) {
33
53
  // console.warn(`CustomPrimitive - Object with ID ${createdObject.id} not found.`);
34
54
  return null;
35
55
  }
36
- return (
37
- // <Select enabled={isSelected}>
38
- // <CreatedObject createdObject={createdObject}
39
- // shouldApply3driseMaterial={false} // Material is owned by useMaterialApplication above (applied to obj.object directly)
40
- // handleObjectClick={handleObjectClick}
41
- // onObjectReady={(object, ref) => {
42
- // onObjectReady && onObjectReady(object, ref);
43
- // }}
44
- // >
45
- _jsx("primitive", { ref: meshRef, name: obj.name, object: obj.object, visible: createdObject.meshSettings.visible, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: useDreiMaterials && createdObject.type === 'mesh' && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }, obj.id)
46
- // {/* <LineEdges object={obj.object} />
47
- // <MeshEdges object={obj.object} /> */}
48
- // </CreatedObject>
49
- // {/* </Select> */}
50
- );
56
+ return (_jsx("primitive", { ref: meshRef, name: obj.name, object: obj.object, visible: createdObject.meshSettings.visible, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: useDreiMaterials && createdObject.type === 'mesh' && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }, obj.id));
51
57
  });
52
58
  CustomPrimitive.displayName = 'CustomPrimitive';
53
59
  export default CustomPrimitive;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import * as THREE from 'three';
3
+ import { EarthConfig } from '@ntalmagor/3drize-core';
4
+ declare const Earth: React.FC<EarthConfig & {
5
+ onMeshReady?: (mesh: THREE.Mesh) => void;
6
+ }>;
7
+ export default Earth;
8
+ //# sourceMappingURL=Earth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAA0C,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQ7F,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG;IAAE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,CAAA;CAAE,CA0E/E,CAAC;AAGF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useMemo, useCallback, useEffect } from 'react';
3
+ import * as THREE from 'three';
4
+ import { useTexture } from '@react-three/drei';
5
+ const CDN = 'https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/planets';
6
+ const EARTH_DAY_URL = `${CDN}/earth_day_4096.jpg`;
7
+ const EARTH_NIGHT_URL = `${CDN}/earth_night_4096.jpg`;
8
+ const EARTH_BUMP_ROUGHNESS_CLOUDS_URL = `${CDN}/earth_bump_roughness_clouds_4096.jpg`;
9
+ const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosphereTwilightColor = '#bc490b', radius = 1, onMeshReady, }) => {
10
+ const globeRef = useRef(null);
11
+ const globeMatRef = useRef(null);
12
+ const atmosphereMatRef = useRef(null);
13
+ const segments = 64;
14
+ const [dayMap, nightMap, bumpRoughnessClouds] = useTexture([
15
+ EARTH_DAY_URL,
16
+ EARTH_NIGHT_URL,
17
+ EARTH_BUMP_ROUGHNESS_CLOUDS_URL,
18
+ ]);
19
+ useEffect(() => {
20
+ dayMap.colorSpace = THREE.SRGBColorSpace;
21
+ nightMap.colorSpace = THREE.SRGBColorSpace;
22
+ dayMap.anisotropy = 8;
23
+ nightMap.anisotropy = 8;
24
+ bumpRoughnessClouds.anisotropy = 8;
25
+ }, [dayMap, nightMap, bumpRoughnessClouds]);
26
+ const sunDirection = useMemo(() => new THREE.Vector3(sunPosition[0], sunPosition[1], sunPosition[2]).normalize(), [sunPosition]);
27
+ const dayColor = useMemo(() => new THREE.Color(atmosphereDayColor), [atmosphereDayColor]);
28
+ const twilightColor = useMemo(() => new THREE.Color(atmosphereTwilightColor), [atmosphereTwilightColor]);
29
+ const handleGlobeRef = useCallback((mesh) => {
30
+ if (mesh) {
31
+ globeRef.current = mesh;
32
+ onMeshReady?.(mesh);
33
+ }
34
+ }, [onMeshReady]);
35
+ return (_jsxs("group", { userData: { id: '3drise-earth' }, children: [_jsxs("mesh", { ref: handleGlobeRef, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthMaterial", { ref: globeMatRef, uDayMap: dayMap, uNightMap: nightMap, uBumpRoughnessClouds: bumpRoughnessClouds, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] }), _jsxs("mesh", { scale: 1.04, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthAtmosphereMaterial", { ref: atmosphereMatRef, transparent: true, side: THREE.BackSide, depthWrite: false, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] })] }));
36
+ };
37
+ Earth.displayName = 'Earth';
38
+ export default Earth;
@@ -3,7 +3,7 @@ import { Object3D } from 'three';
3
3
  import type { GenerativeEffectSettings } from '@ntalmagor/3drize-core';
4
4
  export interface EffectsGeneratorProps {
5
5
  settings: GenerativeEffectSettings;
6
- object?: Object3D;
6
+ object?: Object3D | null;
7
7
  }
8
8
  declare const EffectsGenerator: React.FC<EffectsGeneratorProps>;
9
9
  export default EffectsGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAgB,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAsBvE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoCrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAgB,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AA0BvE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAwCrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -12,7 +12,6 @@ import DnaHelixEffect from './effects/DnaHelixEffect.js';
12
12
  import OrbEffect from './effects/OrbEffect.js';
13
13
  import LightningEffect from './effects/LightningEffect.js';
14
14
  import AuroraEffect from './effects/AuroraEffect.js';
15
- import FireEffect from './effects/FireEffect.js';
16
15
  import ForcefieldEffect from './effects/ForcefieldEffect.js';
17
16
  import NeuralNetworkEffect from './effects/NeuralNetworkEffect.js';
18
17
  import BlackHoleEffect from './effects/BlackHoleEffect.js';
@@ -20,6 +19,11 @@ import IceCrystalsEffect from './effects/IceCrystalsEffect.js';
20
19
  import SmokePlumeEffect from './effects/SmokePlumeEffect.js';
21
20
  import VolumetricFogEffect from './effects/VolumetricFogEffect.js';
22
21
  import SmokeRingEffect from './effects/SmokeRingEffect.js';
22
+ import Flares from './Flares.js';
23
+ import SparklesBurst from './SparklesBurst.js';
24
+ import Bubbles from './Bubbles.js';
25
+ import Glyphs from './Glyphs.js';
26
+ import Fire from './effects/Fire.js';
23
27
  const EffectsGenerator = ({ settings, object }) => {
24
28
  if (!settings.enabled)
25
29
  return null;
@@ -45,7 +49,6 @@ const EffectsGenerator = ({ settings, object }) => {
45
49
  case 'orb': return _jsx(OrbEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
46
50
  case 'lightning': return _jsx(LightningEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
47
51
  case 'aurora': return _jsx(AuroraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
48
- case 'fire': return _jsx(FireEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
49
52
  case 'forcefield': return _jsx(ForcefieldEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
50
53
  case 'neuralNetwork': return _jsx(NeuralNetworkEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
51
54
  case 'blackHole': return _jsx(BlackHoleEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
@@ -53,6 +56,11 @@ const EffectsGenerator = ({ settings, object }) => {
53
56
  case 'smokePlume': return _jsx(SmokePlumeEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
54
57
  case 'volumetricFog': return _jsx(VolumetricFogEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
55
58
  case 'smokeRing': return _jsx(SmokeRingEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
59
+ case 'fire': return _jsx(Fire, { hostRef: object, config: config, animations: animations });
60
+ case 'flares': return _jsx(Flares, { hostRef: object, config: config, animations: animations });
61
+ case 'sparklesBurst': return _jsx(SparklesBurst, { boundingRadius: boundingRadius, config: config });
62
+ case 'bubbles': return _jsx(Bubbles, { boundingRadius: boundingRadius, config: config });
63
+ case 'glyphs': return _jsx(Glyphs, { boundingRadius: boundingRadius, config: config });
56
64
  default: return null;
57
65
  }
58
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG3F,UAAU,iBAAiB;IACzB,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAU7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAI3F,UAAU,iBAAiB;IACzB,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAW7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { GEREATIVE_EFFECTS_KEY } from '@ntalmagor/3drize-core';
3
3
  import EffectsGenerator from './EffectsGenerator.js';
4
+ import { findById } from '../utils/sceneQuery.js';
4
5
  const EffectsGroup = ({ createdObject }) => {
5
6
  if (!createdObject.effects || createdObject.effects.length === 0)
6
7
  return null;
7
- return (_jsx("group", { name: `${createdObject.id}-effects`, userData: { [GEREATIVE_EFFECTS_KEY]: true }, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect }, index))) }));
8
+ const object = findById(createdObject.id);
9
+ return (_jsx("group", { name: `${createdObject.id}-effects`, userData: { [GEREATIVE_EFFECTS_KEY]: true }, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect, object: object }, index))) }));
8
10
  };
9
11
  export default EffectsGroup;
@@ -0,0 +1,64 @@
1
+ import { Vector3, Object3D } from "three";
2
+ import { AnimationOptions, FlaresConfig } from "@ntalmagor/3drize-core";
3
+ /**
4
+ * <Flares />
5
+ * Explosive energy bursts.
6
+ *
7
+ * TWO MODES, controlled by the `hostRef` prop:
8
+ *
9
+ * hostRef = false (default) — PLANE MODE
10
+ * Renders a camera-facing billboard plane with bursts erupting from a
11
+ * circular limb (radius 1 in plane units). Auto-fits to the enclosing
12
+ * object's bounding sphere if there is one; otherwise size it with
13
+ * `radius`. Zero extra cost. Ideal for spheres / round bodies (the Sun).
14
+ *
15
+ * <mesh>
16
+ * <sphereGeometry />
17
+ * <Flares />
18
+ * </mesh>
19
+ *
20
+ * hostRef = true — SILHOUETTE MODE
21
+ * Treats the enclosing object as the host: each frame the host is
22
+ * rendered as a mask into a render target and the shader roots the
23
+ * bursts on the host's ACTUAL screen silhouette, whatever its shape.
24
+ * Costs one extra (cheap) render pass of the host per frame.
25
+ *
26
+ * <primitive object={gltf.scene}>
27
+ * <Flares hostRef fitKey={gltf.scene} />
28
+ * </primitive>
29
+ *
30
+ * shooting = true — CENTER BURSTS
31
+ * The same bursts, rooted at the plane center instead of the limb,
32
+ * firing outward from the source. Overrides plane/silhouette rooting.
33
+ * Renders over the host (depth test off) so the rays stay visible.
34
+ *
35
+ * <Flares shooting />
36
+ *
37
+ * Shared behavior:
38
+ * - Auto-fits to the enclosing object's bounding sphere (`radius` to
39
+ * override, `fitKey` to re-fit after async loads, `padding` to tighten).
40
+ * - World-space billboarding: correct under rotated/scaled ancestors.
41
+ * - Additive blending — reads best against a dark scene background.
42
+ */
43
+ declare global {
44
+ namespace JSX {
45
+ interface IntrinsicElements {
46
+ flareMaterial: any;
47
+ }
48
+ }
49
+ }
50
+ export type FlaresProps = {
51
+ /**
52
+ * true -> silhouette mode: bursts root on the enclosing object's actual
53
+ * screen silhouette (mask render pass).
54
+ * false -> plane mode: circular limb billboard (default).
55
+ */
56
+ hostRef?: Object3D | null;
57
+ /** Root the bursts at the center (shooting from source) instead of the limb. */
58
+ config: FlaresConfig;
59
+ /** Uniform overrides for FlareMaterial (u_frequency, u_reach, ...). */
60
+ uniforms?: Record<string, number | Vector3 | number[]>;
61
+ animations?: AnimationOptions[];
62
+ };
63
+ export default function Flares({ hostRef, config, uniforms, animations }: FlaresProps): import("react/jsx-runtime").JSX.Element;
64
+ //# sourceMappingURL=Flares.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flares.d.ts","sourceRoot":"","sources":["../../src/components/Flares.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EAAqC,QAAQ,EAAwB,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,aAAa,EAAE,GAAG,CAAC;SACpB;KACF;CACF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,gFAAgF;IAChF,MAAM,EAAE,YAAY,CAAA;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;IACvD,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACjC,CAAC;AAUF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACX,EAAE,WAAW,2CAyJb"}