@3driseai/3drise-viewer 0.1.17 → 0.1.19

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 (52) hide show
  1. package/dist/components/AnimatedObject.d.ts.map +1 -1
  2. package/dist/components/AnimatedObject.js +3 -2
  3. package/dist/components/Galaxy.d.ts.map +1 -1
  4. package/dist/components/Galaxy.js +2 -0
  5. package/dist/components/ObjectNode.d.ts.map +1 -1
  6. package/dist/components/ObjectNode.js +17 -6
  7. package/dist/components/ParticlesGenerator.d.ts +10 -0
  8. package/dist/components/ParticlesGenerator.d.ts.map +1 -0
  9. package/dist/components/ParticlesGenerator.js +23 -0
  10. package/dist/components/effects/ShockwaveEffect.js +2 -2
  11. package/dist/components/index.d.ts +3 -0
  12. package/dist/components/index.d.ts.map +1 -1
  13. package/dist/components/index.js +2 -0
  14. package/dist/components/particles/BioluminescentWakeParticles.d.ts +15 -0
  15. package/dist/components/particles/BioluminescentWakeParticles.d.ts.map +1 -0
  16. package/dist/components/particles/BioluminescentWakeParticles.js +1145 -0
  17. package/dist/components/particles/BrownianDustParticles.d.ts +15 -0
  18. package/dist/components/particles/BrownianDustParticles.d.ts.map +1 -0
  19. package/dist/components/particles/BrownianDustParticles.js +779 -0
  20. package/dist/components/particles/ElectronOrbitalsParticles.d.ts +15 -0
  21. package/dist/components/particles/ElectronOrbitalsParticles.d.ts.map +1 -0
  22. package/dist/components/particles/ElectronOrbitalsParticles.js +966 -0
  23. package/dist/components/particles/GrinderSparksParticles.d.ts +15 -0
  24. package/dist/components/particles/GrinderSparksParticles.d.ts.map +1 -0
  25. package/dist/components/particles/GrinderSparksParticles.js +768 -0
  26. package/dist/components/particles/TidalStreamParticles.d.ts +15 -0
  27. package/dist/components/particles/TidalStreamParticles.d.ts.map +1 -0
  28. package/dist/components/particles/TidalStreamParticles.js +810 -0
  29. package/dist/components/particles/index.d.ts +11 -0
  30. package/dist/components/particles/index.d.ts.map +1 -0
  31. package/dist/components/particles/index.js +6 -0
  32. package/dist/constants.d.ts.map +1 -1
  33. package/dist/constants.js +2 -1
  34. package/dist/hooks/index.d.ts +2 -0
  35. package/dist/hooks/index.d.ts.map +1 -1
  36. package/dist/hooks/index.js +1 -0
  37. package/dist/hooks/useConfigLive.d.ts +54 -0
  38. package/dist/hooks/useConfigLive.d.ts.map +1 -0
  39. package/dist/hooks/useConfigLive.js +100 -0
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +1 -0
  43. package/dist/utils/configAnimations.d.ts +43 -0
  44. package/dist/utils/configAnimations.d.ts.map +1 -0
  45. package/dist/utils/configAnimations.js +73 -0
  46. package/dist/utils/particleTrails.d.ts +70 -0
  47. package/dist/utils/particleTrails.d.ts.map +1 -0
  48. package/dist/utils/particleTrails.js +378 -0
  49. package/dist/utils/pointerField.d.ts +28 -0
  50. package/dist/utils/pointerField.d.ts.map +1 -0
  51. package/dist/utils/pointerField.js +103 -0
  52. package/package.json +2 -2
@@ -0,0 +1,11 @@
1
+ export { default as TidalStreamParticles } from './TidalStreamParticles';
2
+ export type { TidalStreamParticlesProps } from './TidalStreamParticles';
3
+ export { default as BrownianDustParticles } from './BrownianDustParticles';
4
+ export type { BrownianDustParticlesProps } from './BrownianDustParticles';
5
+ export { default as BioluminescentWakeParticles } from './BioluminescentWakeParticles';
6
+ export type { BioluminescentWakeParticlesProps } from './BioluminescentWakeParticles';
7
+ export { default as ElectronOrbitalsParticles } from './ElectronOrbitalsParticles';
8
+ export type { ElectronOrbitalsParticlesProps } from './ElectronOrbitalsParticles';
9
+ export { default as GrinderSparksParticles } from './GrinderSparksParticles';
10
+ export type { GrinderSparksParticlesProps } from './GrinderSparksParticles';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/particles/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,YAAY,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,6 @@
1
+ // Generative particle objects (type 'particles'), dispatched by ParticlesGenerator.
2
+ export { default as TidalStreamParticles } from './TidalStreamParticles.js';
3
+ export { default as BrownianDustParticles } from './BrownianDustParticles.js';
4
+ export { default as BioluminescentWakeParticles } from './BioluminescentWakeParticles.js';
5
+ export { default as ElectronOrbitalsParticles } from './ElectronOrbitalsParticles.js';
6
+ export { default as GrinderSparksParticles } from './GrinderSparksParticles.js';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,oCAA2B,CAAC;AACzD,eAAO,MAAM,qBAAqB,aAchC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,oCAA2B,CAAC;AACzD,eAAO,MAAM,qBAAqB,aAehC,CAAC"}
package/dist/constants.js CHANGED
@@ -12,10 +12,11 @@ export const SELF_MANAGED_MATERIAL = new Set([
12
12
  'effect',
13
13
  'space',
14
14
  'grid',
15
+ 'particles',
15
16
  // The water surface owns its shader — one material for both hosts, built
16
17
  // around the wave field. Left out of this set, useMaterialApplication
17
18
  // overwrites it with whatever the registry has under materialType, which for
18
19
  // a legacy ocean is the old flat-plane water material.
19
- 'ocean',
20
+ // 'ocean',
20
21
  // 'moon'
21
22
  ]);
@@ -17,6 +17,8 @@ export { useClipmap } from './useClipmap';
17
17
  export type { OceanLiveHandle } from './useOceanLive';
18
18
  export { OCEAN_LIVE_KEY, useOceanLive } from './useOceanLive';
19
19
  export { useOceanMaterial } from './useOceanMaterial';
20
+ export type { ConfigLiveHandle, ConfigLiveValue, ConfigLiveFamily } from './useConfigLive';
21
+ export { CONFIG_LIVE_KEY, useConfigLive, useConfigLiveHandle } from './useConfigLive';
20
22
  export type { UseOceanMaterialOptions, OceanMaterialHandle } from './useOceanMaterial';
21
23
  export type { UseContinuousEffectsOptions, UseContinuousEffectsResult } from './useContinuousEffects';
22
24
  export { useContinuousEffects } from './useContinuousEffects';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE7D,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAA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BAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -13,6 +13,7 @@ export { useTerrainClipmap } from './useTerrainClipmap.js';
13
13
  export { useClipmap } from './useClipmap.js';
14
14
  export { OCEAN_LIVE_KEY, useOceanLive } from './useOceanLive.js';
15
15
  export { useOceanMaterial } from './useOceanMaterial.js';
16
+ export { CONFIG_LIVE_KEY, useConfigLive, useConfigLiveHandle } from './useConfigLive.js';
16
17
  export { useContinuousEffects } from './useContinuousEffects.js';
17
18
  export { useCubeCamera } from './useCubeCamera.js';
18
19
  export { useEnvironmentProbe } from './useEnvironmentProbe.js';
@@ -0,0 +1,54 @@
1
+ import { type MutableRefObject, type RefObject } from 'react';
2
+ import type { Object3D } from 'three';
3
+ /**
4
+ * Live config editing for the generative families (particles now, effects next),
5
+ * the counterpart to `useOceanLive` / `useTerrainLive`.
6
+ *
7
+ * A slider drag fires on every pointer-move. Routing that through Redux hands the
8
+ * component a new config sixty times a second; every continuous knob only touches
9
+ * uniforms, so the controller writes straight into them instead, and Redux only
10
+ * hears about it on slider end.
11
+ *
12
+ * const live = useConfigLive(settings.id);
13
+ * <ParticlesControllerUi onLiveChange={live.set} onSettingsChange={dispatch} ... />
14
+ *
15
+ * The renderer side registers the handle and owns the merge:
16
+ *
17
+ * const liveRef = useConfigLiveHandle(rootRef, id, 'particles', STRUCTURAL, push);
18
+ * // push(overrides) -> applyConfig(uniforms, { ...config, ...overrides, ...animated }, size)
19
+ *
20
+ * Structural knobs rebuild the object, so the handle ignores them: they change on
21
+ * release, through the committed config, exactly once.
22
+ *
23
+ * The handle is found by the object's id, resolved at call time (see the note on
24
+ * useOceanLive: an object resolved once while the panel opens before the object
25
+ * exists stays null forever). It lives on its own userData key and carries its own
26
+ * id, so it never competes with the scene's `userData.id` used by selection.
27
+ */
28
+ /** Where a generative component stashes its handle on its root group's userData. */
29
+ export declare const CONFIG_LIVE_KEY = "__configLive";
30
+ export type ConfigLiveValue = number | string | boolean;
31
+ /** Generative families that support live config editing. */
32
+ export type ConfigLiveFamily = 'particles' | 'effects';
33
+ export interface ConfigLiveHandle {
34
+ id: string;
35
+ family: ConfigLiveFamily;
36
+ /** False once the component has unmounted or re-registered. */
37
+ alive: boolean;
38
+ set(key: string, value: ConfigLiveValue): void;
39
+ }
40
+ /** Client side: a stable `set(key, value)` for the generative object with this id. */
41
+ export declare function useConfigLive(id?: string | null): {
42
+ set(key: string, value: ConfigLiveValue): void;
43
+ };
44
+ /**
45
+ * Renderer side: registers the live handle and returns the ref holding everything
46
+ * dragged since the last commit. `apply` is called with that ref's contents on every
47
+ * live change; the component owns the merge, so keyframe animations compose with it.
48
+ *
49
+ * Pass `config` so a committed config drops the drag state — the commit *is* the
50
+ * same value, and keeping the override would pin the knob against later edits.
51
+ */
52
+ export declare function useConfigLiveHandle(rootRef: RefObject<Object3D | null>, id: string | undefined, family: ConfigLiveFamily, config: object, structural: readonly string[], apply: (overrides: Record<string, ConfigLiveValue>) => void): MutableRefObject<Record<string, ConfigLiveValue>>;
53
+ export default useConfigLive;
54
+ //# sourceMappingURL=useConfigLive.d.ts.map
@@ -0,0 +1 @@
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Aa,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { useLayoutEffect, useMemo, useRef } from 'react';
2
+ import { SceneStore } from '@3driseai/3drise-core';
3
+ /**
4
+ * Live config editing for the generative families (particles now, effects next),
5
+ * the counterpart to `useOceanLive` / `useTerrainLive`.
6
+ *
7
+ * A slider drag fires on every pointer-move. Routing that through Redux hands the
8
+ * component a new config sixty times a second; every continuous knob only touches
9
+ * uniforms, so the controller writes straight into them instead, and Redux only
10
+ * hears about it on slider end.
11
+ *
12
+ * const live = useConfigLive(settings.id);
13
+ * <ParticlesControllerUi onLiveChange={live.set} onSettingsChange={dispatch} ... />
14
+ *
15
+ * The renderer side registers the handle and owns the merge:
16
+ *
17
+ * const liveRef = useConfigLiveHandle(rootRef, id, 'particles', STRUCTURAL, push);
18
+ * // push(overrides) -> applyConfig(uniforms, { ...config, ...overrides, ...animated }, size)
19
+ *
20
+ * Structural knobs rebuild the object, so the handle ignores them: they change on
21
+ * release, through the committed config, exactly once.
22
+ *
23
+ * The handle is found by the object's id, resolved at call time (see the note on
24
+ * useOceanLive: an object resolved once while the panel opens before the object
25
+ * exists stays null forever). It lives on its own userData key and carries its own
26
+ * id, so it never competes with the scene's `userData.id` used by selection.
27
+ */
28
+ /** Where a generative component stashes its handle on its root group's userData. */
29
+ export const CONFIG_LIVE_KEY = '__configLive';
30
+ /** Keys that never go through the live path, whatever the family. */
31
+ const ALWAYS_COMMIT = ['trailMode', 'trailShare', 'enabled', 'type'];
32
+ function findHandle(id) {
33
+ if (!id || !SceneStore.scene)
34
+ return undefined;
35
+ let found;
36
+ SceneStore.scene.traverse((o) => {
37
+ if (found)
38
+ return;
39
+ const h = o.userData?.[CONFIG_LIVE_KEY];
40
+ if (h && h.id === id)
41
+ found = h;
42
+ });
43
+ return found;
44
+ }
45
+ /** Client side: a stable `set(key, value)` for the generative object with this id. */
46
+ export function useConfigLive(id) {
47
+ return useMemo(() => {
48
+ let cached;
49
+ return {
50
+ set: (key, value) => {
51
+ if (!id)
52
+ return;
53
+ // one scene traversal per drag, not per pointer-move
54
+ if (!cached || !cached.alive || cached.id !== id)
55
+ cached = findHandle(id);
56
+ cached?.set(key, value);
57
+ },
58
+ };
59
+ }, [id]);
60
+ }
61
+ /**
62
+ * Renderer side: registers the live handle and returns the ref holding everything
63
+ * dragged since the last commit. `apply` is called with that ref's contents on every
64
+ * live change; the component owns the merge, so keyframe animations compose with it.
65
+ *
66
+ * Pass `config` so a committed config drops the drag state — the commit *is* the
67
+ * same value, and keeping the override would pin the knob against later edits.
68
+ */
69
+ export function useConfigLiveHandle(rootRef, id, family, config, structural, apply) {
70
+ const live = useRef({});
71
+ const applyRef = useRef(apply);
72
+ applyRef.current = apply;
73
+ // the committed config supersedes whatever the drag wrote
74
+ useLayoutEffect(() => { live.current = {}; }, [config]);
75
+ useLayoutEffect(() => {
76
+ const root = rootRef.current;
77
+ if (!root || !id)
78
+ return;
79
+ const skip = new Set([...structural, ...ALWAYS_COMMIT]);
80
+ const handle = {
81
+ id,
82
+ family,
83
+ alive: true,
84
+ set(key, value) {
85
+ if (!handle.alive || skip.has(key))
86
+ return;
87
+ live.current = { ...live.current, [key]: value };
88
+ applyRef.current(live.current);
89
+ },
90
+ };
91
+ root.userData[CONFIG_LIVE_KEY] = handle;
92
+ return () => {
93
+ handle.alive = false;
94
+ if (root.userData[CONFIG_LIVE_KEY] === handle)
95
+ delete root.userData[CONFIG_LIVE_KEY];
96
+ };
97
+ }, [rootRef, id, family, structural]);
98
+ return live;
99
+ }
100
+ export default useConfigLive;
package/dist/index.d.ts CHANGED
@@ -30,6 +30,8 @@ export { applyOceanUniforms, buildWaveTable, seaState } from './utils/oceanUnifo
30
30
  export type { WaveTable } from './utils/oceanUniforms';
31
31
  export { applyCameraUniforms, applyCirrusUniforms, applyDeckUniforms, applySunUniforms, applyThunderUniforms, } from './utils/cloudUniforms';
32
32
  export { applyCloudsKeyframeAnimations, applyCloudsMouseMove, resolveDeckConfig, } from './utils/handleCloudsAnimations';
33
+ export { applyConfigKeyframeAnimations, applyConfigMouseMove, hasConfigOverrides, resolveConfig, } from './utils/configAnimations';
34
+ export type { ConfigOverride, ConfigStartValues } from './utils/configAnimations';
33
35
  export { volumetricCloudPresets, cirrusPresets, getCloudPresetsForType, getCloudPresetByName, getCirrusPresetByName, searchCloudPresetsByTags, } from './presets/volumetricCloudPresets';
34
36
  export type { VolumetricCloudPreset, CirrusPreset } from './presets/volumetricCloudPresets';
35
37
  export { terrainPresets, getTerrainPresetsForType, getTerrainPresetByName, searchTerrainPresetsByTags, } from './presets/terrainPresets';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG1F,OAAO,EAAE,iBAAiB,IAAI,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG5F,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAExB,YAAY,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGjG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,GAAG,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,mBAAmB,IAAI,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACvF,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7F,YAAY,EAAE,aAAa,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AAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,eAAe,EACf,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC"}
package/dist/index.js CHANGED
@@ -26,6 +26,7 @@ export { buildTextureArray, decodeHeightmap, loadImage } from './utils/landscape
26
26
  export { applyOceanUniforms, buildWaveTable, seaState } from './utils/oceanUniforms.js';
27
27
  export { applyCameraUniforms, applyCirrusUniforms, applyDeckUniforms, applySunUniforms, applyThunderUniforms, } from './utils/cloudUniforms.js';
28
28
  export { applyCloudsKeyframeAnimations, applyCloudsMouseMove, resolveDeckConfig, } from './utils/handleCloudsAnimations.js';
29
+ export { applyConfigKeyframeAnimations, applyConfigMouseMove, hasConfigOverrides, resolveConfig, } from './utils/configAnimations.js';
29
30
  // Presets
30
31
  export { volumetricCloudPresets, cirrusPresets, getCloudPresetsForType, getCloudPresetByName, getCirrusPresetByName, searchCloudPresetsByTags, } from './presets/volumetricCloudPresets.js';
31
32
  export { terrainPresets, getTerrainPresetsForType, getTerrainPresetByName, searchTerrainPresetsByTags, } from './presets/terrainPresets.js';
@@ -0,0 +1,43 @@
1
+ import type { AnimationOptions, MouseMoveProperty } from '@3driseai/3drise-core';
2
+ /**
3
+ * Keyframe animations and mouse-move, applied to a *config object* rather than to
4
+ * materials — the shape every generative family shares (particles, effects, and the
5
+ * clouds / rain helpers this generalises).
6
+ *
7
+ * The renderer keeps one override record per frame and lays it over the committed
8
+ * config before pushing uniforms:
9
+ *
10
+ * applyConfigKeyframeAnimations(anims, startValues, config, override, elapsedMs, ANIMATABLE);
11
+ * applyConfig(uniforms, { ...config, ...live, ...override }, size);
12
+ *
13
+ * Only knobs in `allowed` are eligible: that set is generated from the component's
14
+ * own applyConfig (see core's GENERATIVE_ANIMATABLE), so a keyframe can never target
15
+ * something that would need a rebuild to take effect.
16
+ *
17
+ * Both numbers and colours work — `interpolateValue` is type-aware and reads hex
18
+ * strings as colours.
19
+ */
20
+ export type ConfigOverride = Record<string, number | string>;
21
+ /** Cache of the value a property started at, so `from`-less keyframes have an origin. */
22
+ export type ConfigStartValues = Record<string, number | string>;
23
+ /**
24
+ * @param elapsedMs Milliseconds since this animation set started — NOT `Date.now()`,
25
+ * and not seconds. `calculateTimeProgress` divides by `duration`, so a wall
26
+ * clock makes a one-shot finish on its first frame, and seconds make it crawl.
27
+ * Reset the origin (and `startValues`) whenever the animation list changes, so
28
+ * editing a keyframe restarts it instead of dropping the user mid-cycle.
29
+ *
30
+ * Clears `override` first: a keyframe that was removed must stop driving its knob.
31
+ * Call this before `applyConfigMouseMove`, which layers on top.
32
+ */
33
+ export declare function applyConfigKeyframeAnimations(animations: AnimationOptions[] | undefined, startValues: ConfigStartValues, config: Record<string, unknown>, override: ConfigOverride, elapsedMs: number, allowed?: ReadonlySet<string>): void;
34
+ /** Pointer-driven overrides, layered on top of whatever the keyframes produced. */
35
+ export declare function applyConfigMouseMove(properties: MouseMoveProperty[] | undefined, config: Record<string, unknown>, override: ConfigOverride, pointer: {
36
+ x: number;
37
+ y: number;
38
+ }, allowed?: ReadonlySet<string>): void;
39
+ /** True when anything is currently being driven. */
40
+ export declare function hasConfigOverrides(override: ConfigOverride): boolean;
41
+ /** Merge overrides into a config, returning the original when nothing is driving it. */
42
+ export declare function resolveConfig<T extends object>(config: T, ...overrides: (ConfigOverride | undefined)[]): T;
43
+ //# sourceMappingURL=configAnimations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configAnimations.d.ts","sourceRoot":"","sources":["../../src/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ue, interpolateMouseMoveProperty } from '@3driseai/3drise-core';
2
+ /**
3
+ * @param elapsedMs Milliseconds since this animation set started — NOT `Date.now()`,
4
+ * and not seconds. `calculateTimeProgress` divides by `duration`, so a wall
5
+ * clock makes a one-shot finish on its first frame, and seconds make it crawl.
6
+ * Reset the origin (and `startValues`) whenever the animation list changes, so
7
+ * editing a keyframe restarts it instead of dropping the user mid-cycle.
8
+ *
9
+ * Clears `override` first: a keyframe that was removed must stop driving its knob.
10
+ * Call this before `applyConfigMouseMove`, which layers on top.
11
+ */
12
+ export function applyConfigKeyframeAnimations(animations, startValues, config, override, elapsedMs, allowed) {
13
+ for (const k of Object.keys(override))
14
+ delete override[k];
15
+ if (!animations?.length)
16
+ return;
17
+ for (const anim of animations) {
18
+ const { property, to, duration, ease, loop = false, yoyo = false, active } = anim;
19
+ if (active === false || to === undefined)
20
+ continue;
21
+ if (allowed && !allowed.has(property))
22
+ continue;
23
+ let from = anim.from;
24
+ if (from === undefined) {
25
+ from = startValues[property] ??= config[property];
26
+ }
27
+ if (from === undefined || from === null)
28
+ continue;
29
+ let p = calculateTimeProgress(elapsedMs, duration, yoyo, loop);
30
+ if (ease) {
31
+ const fn = gsapEasingMap[ease] || ease;
32
+ p = applyEasing(fn, p);
33
+ }
34
+ override[property] = interpolateValue(property, from, to, p);
35
+ }
36
+ }
37
+ /** Pointer-driven overrides, layered on top of whatever the keyframes produced. */
38
+ export function applyConfigMouseMove(properties, config, override, pointer, allowed) {
39
+ if (!properties?.length)
40
+ return;
41
+ for (const { property, enabled, propertySettings } of properties) {
42
+ if (!enabled)
43
+ continue;
44
+ if (allowed && !allowed.has(property))
45
+ continue;
46
+ const { axis = 'both', sensitivity = 1, inverted = false, min, max } = propertySettings || {};
47
+ // Compose with the keyframed value when there is one, so the two stack instead
48
+ // of the pointer snapping back to the config every frame.
49
+ const base = override[property] ?? config[property];
50
+ if (base === undefined)
51
+ continue;
52
+ override[property] = interpolateMouseMoveProperty(base, min, max, pointer, axis, sensitivity, inverted);
53
+ }
54
+ }
55
+ /** True when anything is currently being driven. */
56
+ export function hasConfigOverrides(override) {
57
+ for (const k in override)
58
+ if (override[k] !== undefined)
59
+ return true;
60
+ return false;
61
+ }
62
+ /** Merge overrides into a config, returning the original when nothing is driving it. */
63
+ export function resolveConfig(config, ...overrides) {
64
+ let dirty = false;
65
+ for (const o of overrides)
66
+ if (o && hasConfigOverrides(o)) {
67
+ dirty = true;
68
+ break;
69
+ }
70
+ if (!dirty)
71
+ return config;
72
+ return Object.assign({}, config, ...overrides.filter(Boolean));
73
+ }
@@ -0,0 +1,70 @@
1
+ import * as THREE from 'three';
2
+ export declare const TRAIL_MODES: string[];
3
+ export declare function createTrailUniforms(): {
4
+ uTrailLength: {
5
+ value: number;
6
+ };
7
+ uTrailOpacity: {
8
+ value: number;
9
+ };
10
+ uTrailColor: {
11
+ value: THREE.Color;
12
+ };
13
+ uTrailShare: {
14
+ value: number;
15
+ };
16
+ uTrailHead: {
17
+ value: number;
18
+ };
19
+ uTrailAcc: {
20
+ value: number;
21
+ };
22
+ uTrailTime: {
23
+ value: number;
24
+ };
25
+ uVelScale: {
26
+ value: number;
27
+ };
28
+ };
29
+ export declare function applyTrailConfig(u: any, c: any): void;
30
+ /** GUI spec for the trail knobs; `labels` names the three types for this object. */
31
+ export declare function trailSpec(labels: any): {
32
+ trailMode: {
33
+ options: {
34
+ [labels.streak]: string;
35
+ [labels.comet]: string;
36
+ [labels.echo]: string;
37
+ Off: string;
38
+ };
39
+ };
40
+ trailLength: {
41
+ min: number;
42
+ max: number;
43
+ step: number;
44
+ };
45
+ trailOpacity: {
46
+ min: number;
47
+ max: number;
48
+ step: number;
49
+ };
50
+ trailColor: string;
51
+ trailShare: {
52
+ min: number;
53
+ max: number;
54
+ step: number;
55
+ };
56
+ };
57
+ /**
58
+ * Build a trail for a CPU particle set.
59
+ * opts: { u, n, pos (Float32Array n*3, sim units), vel (Float32Array n*3), glsl, sizePx, spacing }
60
+ * `vel` is in sim units per sim-time unit; the component keeps u.uVelScale = sim-time per real second.
61
+ */
62
+ export declare function createCpuTrail(mode: any, opts: any): {
63
+ object: THREE.Group<THREE.Object3DEventMap>;
64
+ materials: any[];
65
+ nSub: number;
66
+ reset(i: any): void;
67
+ update(dt: any): void;
68
+ dispose(): void;
69
+ };
70
+ //# sourceMappingURL=particleTrails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particleTrails.d.ts","sourceRoot":"","sources":["../../src/utils/particleTrails.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,eAAO,MAAM,WAAW,UAAsC,CAAC;AAK/D,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;EAWlC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAKpC;AAED,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,MAAM,KAAA;;;YAES,CAAC,MAAM,CAAC,MAAM,CAAC,SAAU;YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS;YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAQ;;;;;;;;;;;;;;;;;;;;EAMjH;AAuID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA;;;;;;;EAyJxC"}