@3driseai/3drise-core 1.0.21 → 1.0.23

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 (179) hide show
  1. package/dist/autoAnimate/composer.d.ts +6 -0
  2. package/dist/autoAnimate/composer.d.ts.map +1 -1
  3. package/dist/autoAnimate/composer.js +4 -3
  4. package/dist/autoAnimate/describeScene.js +1 -1
  5. package/dist/catalog/catalogInfo.d.ts +22 -0
  6. package/dist/catalog/catalogInfo.d.ts.map +1 -0
  7. package/dist/catalog/catalogInfo.js +204 -0
  8. package/dist/catalog/index.d.ts +3 -0
  9. package/dist/catalog/index.d.ts.map +1 -0
  10. package/dist/catalog/index.js +2 -0
  11. package/dist/catalog/objectCatalog.d.ts +33 -0
  12. package/dist/catalog/objectCatalog.d.ts.map +1 -0
  13. package/dist/catalog/objectCatalog.js +94 -0
  14. package/dist/data/allMaterials.js +2 -2
  15. package/dist/data/defaults.d.ts +0 -12
  16. package/dist/data/defaults.d.ts.map +1 -1
  17. package/dist/data/defaults.js +0 -12
  18. package/dist/data/environmentDefaults.d.ts +10 -0
  19. package/dist/data/environmentDefaults.d.ts.map +1 -0
  20. package/dist/data/environmentDefaults.js +126 -0
  21. package/dist/data/gridsDefaults.d.ts +2 -0
  22. package/dist/data/gridsDefaults.d.ts.map +1 -1
  23. package/dist/data/gridsDefaults.js +57 -0
  24. package/dist/data/index.d.ts +4 -0
  25. package/dist/data/index.d.ts.map +1 -1
  26. package/dist/data/index.js +4 -0
  27. package/dist/data/landDefaults.d.ts +26 -0
  28. package/dist/data/landDefaults.d.ts.map +1 -0
  29. package/dist/data/landDefaults.js +76 -0
  30. package/dist/data/spaceDefaults.d.ts +10 -0
  31. package/dist/data/spaceDefaults.d.ts.map +1 -0
  32. package/dist/data/spaceDefaults.js +46 -0
  33. package/dist/data/textDefaults.d.ts +16 -0
  34. package/dist/data/textDefaults.d.ts.map +1 -0
  35. package/dist/data/textDefaults.js +219 -0
  36. package/dist/environment/oceanConfigs.d.ts +5 -4
  37. package/dist/environment/oceanConfigs.d.ts.map +1 -1
  38. package/dist/environment/oceanConfigs.js +2 -2
  39. package/dist/environment/terrainConfigs.d.ts +78 -0
  40. package/dist/environment/terrainConfigs.d.ts.map +1 -1
  41. package/dist/environment/terrainConfigs.js +72 -2
  42. package/dist/index.d.ts +3 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +3 -1
  45. package/dist/properties/registry.d.ts +15 -1
  46. package/dist/properties/registry.d.ts.map +1 -1
  47. package/dist/properties/registry.js +99 -13
  48. package/dist/properties/tables/environmentProperties.d.ts +9 -0
  49. package/dist/properties/tables/environmentProperties.d.ts.map +1 -0
  50. package/dist/properties/tables/environmentProperties.js +127 -0
  51. package/dist/properties/tables/geometryProperties.d.ts +7 -0
  52. package/dist/properties/tables/geometryProperties.d.ts.map +1 -1
  53. package/dist/properties/tables/geometryProperties.js +9 -1
  54. package/dist/properties/tables/gridProperties.d.ts.map +1 -1
  55. package/dist/properties/tables/gridProperties.js +117 -93
  56. package/dist/properties/tables/index.d.ts +4 -0
  57. package/dist/properties/tables/index.d.ts.map +1 -1
  58. package/dist/properties/tables/index.js +4 -0
  59. package/dist/properties/tables/landProperties.d.ts +5 -0
  60. package/dist/properties/tables/landProperties.d.ts.map +1 -0
  61. package/dist/properties/tables/landProperties.js +24 -0
  62. package/dist/properties/tables/optionalProperties.d.ts +1 -2
  63. package/dist/properties/tables/optionalProperties.d.ts.map +1 -1
  64. package/dist/properties/tables/optionalProperties.js +22 -0
  65. package/dist/properties/tables/spaceProperties.d.ts +8 -0
  66. package/dist/properties/tables/spaceProperties.d.ts.map +1 -0
  67. package/dist/properties/tables/spaceProperties.js +42 -0
  68. package/dist/properties/tables/textProperties.d.ts +4 -0
  69. package/dist/properties/tables/textProperties.d.ts.map +1 -0
  70. package/dist/properties/tables/textProperties.js +387 -0
  71. package/dist/properties/types.d.ts +1 -1
  72. package/dist/properties/types.d.ts.map +1 -1
  73. package/dist/services/MaterialRegistry.d.ts.map +1 -1
  74. package/dist/services/MaterialRegistry.js +2 -0
  75. package/dist/services/SceneActions.d.ts +9 -0
  76. package/dist/services/SceneActions.d.ts.map +1 -1
  77. package/dist/services/SceneActions.js +30 -0
  78. package/dist/services/SkySystemManager.d.ts +22 -0
  79. package/dist/services/SkySystemManager.d.ts.map +1 -1
  80. package/dist/services/SkySystemManager.js +50 -18
  81. package/dist/services/TextureResolver.d.ts.map +1 -1
  82. package/dist/services/TextureResolver.js +22 -0
  83. package/dist/services/index.d.ts +1 -1
  84. package/dist/services/index.d.ts.map +1 -1
  85. package/dist/services/index.js +1 -1
  86. package/dist/shaders/SkyboxMaterial.js +3 -3
  87. package/dist/shaders/StarsMaterial.d.ts +5 -0
  88. package/dist/shaders/StarsMaterial.d.ts.map +1 -1
  89. package/dist/shaders/StarsMaterial.js +59 -57
  90. package/dist/three/LetterV.d.ts +7 -1
  91. package/dist/three/LetterV.d.ts.map +1 -1
  92. package/dist/three/Text2DV.d.ts +7 -1
  93. package/dist/three/Text2DV.d.ts.map +1 -1
  94. package/dist/three/Text3DV.d.ts +7 -1
  95. package/dist/three/Text3DV.d.ts.map +1 -1
  96. package/dist/types/actions.d.ts +6 -6
  97. package/dist/types/actions.d.ts.map +1 -1
  98. package/dist/types/commands.d.ts +61 -0
  99. package/dist/types/commands.d.ts.map +1 -0
  100. package/dist/types/commands.js +1 -0
  101. package/dist/types/environment.d.ts +34 -1
  102. package/dist/types/environment.d.ts.map +1 -1
  103. package/dist/types/environment.js +15 -0
  104. package/dist/types/environmentObjects.d.ts +152 -0
  105. package/dist/types/environmentObjects.d.ts.map +1 -0
  106. package/dist/types/environmentObjects.js +10 -0
  107. package/dist/types/index.d.ts +5 -2
  108. package/dist/types/index.d.ts.map +1 -1
  109. package/dist/types/landObjects.d.ts +15 -0
  110. package/dist/types/landObjects.d.ts.map +1 -0
  111. package/dist/types/landObjects.js +1 -0
  112. package/dist/types/objectSettings.d.ts +189 -16
  113. package/dist/types/objectSettings.d.ts.map +1 -1
  114. package/dist/types/objectsConfigs.d.ts +0 -3
  115. package/dist/types/objectsConfigs.d.ts.map +1 -1
  116. package/dist/types/scene3d.d.ts +12 -5
  117. package/dist/types/scene3d.d.ts.map +1 -1
  118. package/dist/types/spaceObjects.d.ts +65 -0
  119. package/dist/types/spaceObjects.d.ts.map +1 -0
  120. package/dist/types/spaceObjects.js +11 -0
  121. package/dist/types/textObjects.d.ts +371 -0
  122. package/dist/types/textObjects.d.ts.map +1 -0
  123. package/dist/types/textObjects.js +14 -0
  124. package/dist/types/types.d.ts +3 -6
  125. package/dist/types/types.d.ts.map +1 -1
  126. package/dist/types/users.d.ts +3 -1
  127. package/dist/types/users.d.ts.map +1 -1
  128. package/dist/types/users.js +2 -0
  129. package/dist/ui/index.d.ts +5 -0
  130. package/dist/ui/index.d.ts.map +1 -0
  131. package/dist/ui/index.js +4 -0
  132. package/dist/ui/uiBindings.d.ts +45 -0
  133. package/dist/ui/uiBindings.d.ts.map +1 -0
  134. package/dist/ui/uiBindings.js +172 -0
  135. package/dist/ui/uiKeys.d.ts +14 -0
  136. package/dist/ui/uiKeys.d.ts.map +1 -0
  137. package/dist/ui/uiKeys.js +22 -0
  138. package/dist/ui/uiSanitize.d.ts +18 -0
  139. package/dist/ui/uiSanitize.d.ts.map +1 -0
  140. package/dist/ui/uiSanitize.js +251 -0
  141. package/dist/ui/uiSpec.d.ts +116 -0
  142. package/dist/ui/uiSpec.d.ts.map +1 -0
  143. package/dist/ui/uiSpec.js +173 -0
  144. package/dist/utils/dataUtils.d.ts.map +1 -1
  145. package/dist/utils/dataUtils.js +0 -6
  146. package/dist/utils/environmentMigration.d.ts +3 -0
  147. package/dist/utils/environmentMigration.d.ts.map +1 -0
  148. package/dist/utils/environmentMigration.js +50 -0
  149. package/dist/utils/generativeAnimatable.d.ts +1 -1
  150. package/dist/utils/generativeAnimatable.d.ts.map +1 -1
  151. package/dist/utils/generativeAnimatable.js +12 -0
  152. package/dist/utils/getAnimatableProperties.d.ts +1 -1
  153. package/dist/utils/getAnimatableProperties.d.ts.map +1 -1
  154. package/dist/utils/getAnimatableProperties.js +1 -1
  155. package/dist/utils/gridMigration.d.ts +3 -0
  156. package/dist/utils/gridMigration.d.ts.map +1 -0
  157. package/dist/utils/gridMigration.js +34 -0
  158. package/dist/utils/index.d.ts +6 -0
  159. package/dist/utils/index.d.ts.map +1 -1
  160. package/dist/utils/index.js +6 -0
  161. package/dist/utils/objectEffects.d.ts +24 -2
  162. package/dist/utils/objectEffects.d.ts.map +1 -1
  163. package/dist/utils/objectEffects.js +28 -2
  164. package/dist/utils/objectMigration.d.ts +9 -0
  165. package/dist/utils/objectMigration.d.ts.map +1 -0
  166. package/dist/utils/objectMigration.js +13 -0
  167. package/dist/utils/skyPhase.d.ts +61 -0
  168. package/dist/utils/skyPhase.d.ts.map +1 -0
  169. package/dist/utils/skyPhase.js +93 -0
  170. package/dist/utils/spaceMigration.d.ts +3 -0
  171. package/dist/utils/spaceMigration.d.ts.map +1 -0
  172. package/dist/utils/spaceMigration.js +46 -0
  173. package/dist/utils/sunUtils.d.ts +26 -1
  174. package/dist/utils/sunUtils.d.ts.map +1 -1
  175. package/dist/utils/sunUtils.js +37 -6
  176. package/dist/utils/textMigration.d.ts +3 -0
  177. package/dist/utils/textMigration.d.ts.map +1 -0
  178. package/dist/utils/textMigration.js +56 -0
  179. package/package.json +1 -1
@@ -0,0 +1,173 @@
1
+ // =============================================================================
2
+ // UI layers — the spec (types, vocabulary, attribute grammar)
3
+ // =============================================================================
4
+ //
5
+ // A UI layer is HTML + CSS written by the AI agent (or by hand) that controls the
6
+ // scene through data attributes. The viewer's binder turns the attributes into calls
7
+ // on the project's SceneHandle (actions, clips, sequences). This file is the single
8
+ // source of the vocabulary: the binder, the validator, the agent docs and the base
9
+ // stylesheet all read it, so they cannot drift apart.
10
+ //
11
+ // <button class="rise-button" data-click="action.toggle:open-door">Open</button>
12
+ //
13
+ // Refs are an item's key, then its id, then its exact name (same as SceneHandle).
14
+ // Commands are separated by spaces, so a ref used in an attribute cannot contain one:
15
+ // address things by key.
16
+ //
17
+ /** Attributes that run commands. */
18
+ export const UI_TRIGGER_ATTRS = {
19
+ click: 'data-click',
20
+ hoverIn: 'data-hover-in',
21
+ hoverOut: 'data-hover-out',
22
+ };
23
+ export const UI_ATTR = {
24
+ ...UI_TRIGGER_ATTRS,
25
+ bind: 'data-bind',
26
+ state: 'data-state',
27
+ showWhen: 'data-show-when',
28
+ anchor: 'data-anchor',
29
+ anchorOcclude: 'data-anchor-occlude',
30
+ anchorOffset: 'data-anchor-offset',
31
+ set: 'data-set',
32
+ setValue: 'data-set-value',
33
+ };
34
+ /** Verbs per command kind. `toggle` for sequences and clips alternates forward / backward. */
35
+ export const UI_VERBS = {
36
+ action: ['apply', 'revert', 'toggle'],
37
+ sequence: ['play', 'reverse', 'pause', 'resume', 'stop', 'toggle'],
38
+ clip: ['play', 'reverse', 'pause', 'resume', 'stop', 'toggle'],
39
+ ui: ['show', 'hide', 'toggle'],
40
+ };
41
+ /** What `data-set` writes to: an object (or a node of a model), or one of the environment elements. */
42
+ export const UI_SET_ENVIRONMENT = ['camera', 'sky', 'clouds', 'ocean', 'terrain'];
43
+ /** `engine:materialSettings.opacity`, `engine/Door_L:meshSettings.rotation.y`, `sky:elevation`. */
44
+ export function parseSetTarget(value) {
45
+ // One target per attribute, so (unlike the command lists) names may contain spaces.
46
+ const m = /^([^:/]+?)(?:\/([^:]+?))?:([A-Za-z_][\w.]*)$/.exec((value ?? '').trim());
47
+ return m
48
+ ? { set: { target: m[1].trim(), node: m[2]?.trim(), path: m[3] } }
49
+ : { error: `"${value ?? ''}" is not target:path (e.g. engine:materialSettings.opacity or sky:elevation).` };
50
+ }
51
+ /** The value of `data-set-value`: a number, true/false, a JSON array (`[1,0,0]`), or a string (`#ff0000`). */
52
+ export function parseSetValue(value) {
53
+ if (value == null)
54
+ return undefined;
55
+ const t = value.trim();
56
+ if (t === 'true')
57
+ return true;
58
+ if (t === 'false')
59
+ return false;
60
+ if (/^-?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i.test(t))
61
+ return Number(t);
62
+ if (t.startsWith('[')) {
63
+ try {
64
+ const a = JSON.parse(t);
65
+ if (Array.isArray(a) && a.every(n => typeof n === 'number'))
66
+ return a;
67
+ }
68
+ catch { /* fall through */ }
69
+ }
70
+ return t;
71
+ }
72
+ const KINDS = ['action', 'sequence', 'clip', 'ui'];
73
+ const isKind = (k) => KINDS.includes(k);
74
+ const tokens = (value) => (value ?? '').split(/\s+/).filter(Boolean);
75
+ /** `action.toggle:open-door sequence.play:intro` */
76
+ export function parseCommands(value) {
77
+ const commands = [];
78
+ const errors = [];
79
+ for (const token of tokens(value)) {
80
+ const m = /^([a-z]+)\.([a-z]+):(.+)$/.exec(token);
81
+ if (!m) {
82
+ errors.push(`"${token}" is not kind.verb:ref (e.g. action.toggle:open-door).`);
83
+ continue;
84
+ }
85
+ const [, kind, verb, ref] = m;
86
+ if (!isKind(kind)) {
87
+ errors.push(`"${token}": unknown kind "${kind}". Use ${KINDS.join(', ')}.`);
88
+ continue;
89
+ }
90
+ if (!UI_VERBS[kind].includes(verb)) {
91
+ errors.push(`"${token}": ${kind} has no verb "${verb}". Use ${UI_VERBS[kind].join(', ')}.`);
92
+ continue;
93
+ }
94
+ if (kind === 'ui' && !/^#[A-Za-z][\w-]*$/.test(ref)) {
95
+ errors.push(`"${token}": ui commands address an element id in this layer, like ui.toggle:#menu.`);
96
+ continue;
97
+ }
98
+ commands.push({ kind, verb, ref });
99
+ }
100
+ return { commands, errors };
101
+ }
102
+ /** `action:open-door !sequence:intro ui:#menu` — all must hold. */
103
+ export function parseConditions(value) {
104
+ const conditions = [];
105
+ const errors = [];
106
+ for (const raw of tokens(value)) {
107
+ const negate = raw.startsWith('!');
108
+ const token = negate ? raw.slice(1) : raw;
109
+ const m = /^([a-z]+):(.+)$/.exec(token);
110
+ if (!m || !isKind(m[1])) {
111
+ errors.push(`"${raw}" is not [!]kind:ref (e.g. action:open-door).`);
112
+ continue;
113
+ }
114
+ if (m[1] === 'ui' && !/^#[A-Za-z][\w-]*$/.test(m[2])) {
115
+ errors.push(`"${raw}": ui conditions address an element id in this layer, like ui:#menu.`);
116
+ continue;
117
+ }
118
+ conditions.push({ negate, kind: m[1], ref: m[2] });
119
+ }
120
+ return { conditions, errors };
121
+ }
122
+ /** `sequence:intro` or `clip:spin` (for <input type="range">). */
123
+ export function parseBind(value) {
124
+ const m = /^(sequence|clip):(.+)$/.exec((value ?? '').trim());
125
+ return m ? { bind: { kind: m[1], ref: m[2] } } : { error: `"${value ?? ''}" is not sequence:ref or clip:ref.` };
126
+ }
127
+ /** `object:engine` or `object:engine/Door_L` (the node name is everything after the first slash). */
128
+ export function parseAnchor(value) {
129
+ const m = /^object:([^/]+)(?:\/(.+))?$/.exec((value ?? '').trim());
130
+ return m ? { anchor: { object: m[1], node: m[2] } } : { error: `"${value ?? ''}" is not object:ref or object:ref/NodeName.` };
131
+ }
132
+ /** `12 -8` (px, from the projected point). */
133
+ export function parseOffset(value) {
134
+ const p = tokens(value).map(Number);
135
+ return p.length === 2 && p.every(Number.isFinite) ? [p[0], p[1]] : null;
136
+ }
137
+ // ---------------------------------------------------------------------------
138
+ // Generic classes + variables (the base stylesheet in the viewer implements them)
139
+ // ---------------------------------------------------------------------------
140
+ //
141
+ // The prefix is `rise-`, not `3drise-`: a CSS class cannot start with a digit
142
+ // without escaping (`.3drise-button` is invalid; it has to be `.\33 drise-button`).
143
+ export const UI_CLASS_PREFIX = 'rise-';
144
+ export const UI_CLASSES = [
145
+ { name: 'rise-panel', use: 'A container grouping controls (a bar, a drawer, a side panel).' },
146
+ { name: 'rise-button', use: 'A button. Pressed / active state: [data-on="true"] when it has data-state.', for: 'button' },
147
+ { name: 'rise-toggle', use: 'A button showing an on/off state (use with data-state).', for: 'button' },
148
+ { name: 'rise-slider', use: 'A range input (<input type="range">), often with data-bind.', for: 'input[type=range]' },
149
+ { name: 'rise-input', use: 'A text or number input.', for: 'input' },
150
+ { name: 'rise-menu', use: 'A list of choices (a column of rise-menu-item).' },
151
+ { name: 'rise-menu-item', use: 'One choice in a rise-menu. Selected: [data-on="true"].' },
152
+ { name: 'rise-card', use: 'An info card.' },
153
+ { name: 'rise-card-title', use: 'The card heading.' },
154
+ { name: 'rise-card-body', use: 'The card text.' },
155
+ { name: 'rise-card-image', use: 'An <img> in a card.' },
156
+ { name: 'rise-hotspot', use: 'A marker anchored to an object or model part (data-anchor).' },
157
+ { name: 'rise-label', use: 'A small text label.' },
158
+ ];
159
+ /** Set on the page (or the host element) to restyle every layer at once. */
160
+ export const UI_VARIABLES = [
161
+ { name: '--rise-accent', default: '#6ea8ff', use: 'Accent colour: active states, slider thumb, hotspot.' },
162
+ { name: '--rise-accent-text', default: '#0b1220', use: 'Text on the accent colour.' },
163
+ { name: '--rise-bg', default: 'rgba(18, 22, 32, 0.72)', use: 'Control and card background.' },
164
+ { name: '--rise-text', default: '#f2f5fa', use: 'Text colour.' },
165
+ { name: '--rise-muted', default: 'rgba(242, 245, 250, 0.65)', use: 'Secondary text.' },
166
+ { name: '--rise-border', default: 'rgba(255, 255, 255, 0.16)', use: 'Border colour.' },
167
+ { name: '--rise-radius', default: '10px', use: 'Corner radius.' },
168
+ { name: '--rise-gap', default: '8px', use: 'Spacing between grouped controls.' },
169
+ { name: '--rise-font', default: 'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif', use: 'Font family (system fonts only).' },
170
+ { name: '--rise-blur', default: '12px', use: 'Backdrop blur of panels and cards.' },
171
+ ];
172
+ /** Class of the host element each layer is rendered in (target it from the page to override variables). */
173
+ export const UI_HOST_CLASS = 'rise-ui-layer';
@@ -1 +1 @@
1
- {"version":3,"file":"dataUtils.d.ts","sourceRoot":"","sources":["../../src/utils/dataUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MA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AAoB,GAAI,MAAM,MAAM,KAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAWxB,CAAC;AACF,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,GAAG,EA2CrD,CAAC;AACF,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG,KAAG,aA0BzC,CAAC;AACF,eAAO,MAAM,YAAY,GAAI,OAAO,QAAQ,KAAG,aAyB9C,CAAC;AACF,eAAO,MAAM,OAAO,GAAI,UAAU,MAAM,EAAE,OAAO,GAAG,KAAG,GAwGtD,CAAC"}
@@ -379,9 +379,6 @@ export const getType = (property, value) => {
379
379
  return property === 'font';
380
380
  // && property.toLowerCase().includes('type');
381
381
  };
382
- const isRenderMode = () => {
383
- return property === 'renderMode';
384
- };
385
382
  const isGeometry = () => {
386
383
  return property.toLowerCase().includes('geometry');
387
384
  // && property.toLowerCase().includes('type');
@@ -416,9 +413,6 @@ export const getType = (property, value) => {
416
413
  if (isAnchor(value)) {
417
414
  return "anchor";
418
415
  }
419
- if (isRenderMode()) {
420
- return "renderMode";
421
- }
422
416
  if (isLayout()) {
423
417
  return "layout";
424
418
  }
@@ -0,0 +1,3 @@
1
+ import type { CreatedObjectSettings } from '../types/scene3d';
2
+ export declare function migrateEnvironmentObject<T extends CreatedObjectSettings>(obj: T): T;
3
+ //# sourceMappingURL=environmentMigration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentMigration.d.ts","sourceRoot":"","sources":["../../src/utils/environmentMigration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAgB9D,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,qBAAqB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAkCnF"}
@@ -0,0 +1,50 @@
1
+ // =============================================================================
2
+ // Environment objects — load-time migration of the legacy rain
3
+ // =============================================================================
4
+ //
5
+ // Rain used to sit outside the environment family, with its own animation domain:
6
+ // its keyframes in `animations.rain`, its pointer bindings in `mouseMove.rain`.
7
+ // It is a family member now, driven through `animations.environment` /
8
+ // `mouseMove.environment` like every other environment object, so a saved rain's
9
+ // tracks move over (appended to anything already there). The never-rendered
10
+ // `splash` knob is dropped.
11
+ //
12
+ // Pure and idempotent: returns the same object when there is nothing to migrate.
13
+ //
14
+ export function migrateEnvironmentObject(obj) {
15
+ if (!obj || obj.type !== 'environment')
16
+ return obj;
17
+ const config = obj.config;
18
+ if (!config || config.type !== 'rain')
19
+ return obj;
20
+ const animations = obj.animations;
21
+ const mouseMove = obj.mouseMove;
22
+ const hasAnim = !!animations && 'rain' in animations;
23
+ const hasMouse = !!mouseMove && typeof mouseMove === 'object' && 'rain' in mouseMove;
24
+ if (!('splash' in config) && !hasAnim && !hasMouse)
25
+ return obj;
26
+ const next = { ...obj };
27
+ if ('splash' in config) {
28
+ const { splash: _splash, ...rest } = config;
29
+ next.config = rest;
30
+ }
31
+ if (hasAnim) {
32
+ const { rain, ...others } = animations;
33
+ const env = others.environment ?? {};
34
+ next.animations = {
35
+ ...others,
36
+ environment: { ...rain, ...env, animations: [...(env.animations ?? []), ...(rain?.animations ?? [])] },
37
+ };
38
+ }
39
+ if (hasMouse) {
40
+ const { rain, ...others } = mouseMove;
41
+ const env = others.environment;
42
+ next.mouseMove = {
43
+ ...others,
44
+ environment: env
45
+ ? { ...env, enabled: env.enabled || !!rain?.enabled, properties: [...(env.properties ?? []), ...(rain?.properties ?? [])] }
46
+ : rain,
47
+ };
48
+ }
49
+ return next;
50
+ }
@@ -2,7 +2,7 @@ export interface AnimatableConfigProperty {
2
2
  value: string;
3
3
  label: string;
4
4
  }
5
- export type GenerativeFamily = 'particles' | 'lights' | 'effects' | 'grids';
5
+ export type GenerativeFamily = 'particles' | 'lights' | 'effects' | 'grids' | 'environment' | 'space' | 'land' | 'text';
6
6
  /** The animatable knobs of one generative object, by family and config.type. */
7
7
  export declare function getGenerativeAnimatable(family: GenerativeFamily, config: {
8
8
  type?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"generativeAnimatable.d.ts","sourceRoot":"","sources":["../../src/utils/generativeAnimatable.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAY5E,gFAAgF;AAChF,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAC7C,wBAAwB,EAAE,CAM5B;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAC7C,OAAO,CAGT"}
1
+ {"version":3,"file":"generativeAnimatable.d.ts","sourceRoot":"","sources":["../../src/utils/generativeAnimatable.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAoBxH,gFAAgF;AAChF,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAC7C,wBAAwB,EAAE,CAM5B;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAC7C,OAAO,CAGT"}
@@ -2,6 +2,10 @@ import { GENERATIVE_PARTICLES_ANIMATABLE } from "../data/particlesDefaults.js";
2
2
  import { LIGHTS_ANIMATABLE } from "../data/lightsDefaults.js";
3
3
  import { EFFECTS_ANIMATABLE } from "../data/effectsDefaults.js";
4
4
  import { GRIDS_ANIMATABLE } from "../data/gridsDefaults.js";
5
+ import { ENVIRONMENT_OBJECTS_ANIMATABLE } from "../data/environmentDefaults.js";
6
+ import { SPACE_OBJECTS_ANIMATABLE } from "../data/spaceDefaults.js";
7
+ import { LAND_OBJECTS_ANIMATABLE } from "../data/landDefaults.js";
8
+ import { TEXT_OBJECTS_ANIMATABLE } from "../data/textDefaults.js";
5
9
  // Partial: grids list only the types converted to the config pattern so far (effects list all).
6
10
  const FAMILIES = {
7
11
  particles: GENERATIVE_PARTICLES_ANIMATABLE,
@@ -10,6 +14,14 @@ const FAMILIES = {
10
14
  lights: LIGHTS_ANIMATABLE,
11
15
  effects: EFFECTS_ANIMATABLE,
12
16
  grids: GRIDS_ANIMATABLE,
17
+ // Weather objects (type 'environment'): snow… The legacy rain is not in this table.
18
+ environment: ENVIRONMENT_OBJECTS_ANIMATABLE,
19
+ // Celestial bodies and backdrops (type 'space'): stars, earth, solarSystem, shootingStars.
20
+ space: SPACE_OBJECTS_ANIMATABLE,
21
+ // Placeable patches of terrain (type 'land'): mountains, hills, dunes, canyon.
22
+ land: LAND_OBJECTS_ANIMATABLE,
23
+ // Animated text looks (type 'text', config.type set): handwriting, neonTube, fourierSketch. The legacy bitmap / 3D text is not in this table.
24
+ text: TEXT_OBJECTS_ANIMATABLE,
13
25
  };
14
26
  /** The animatable knobs of one generative object, by family and config.type. */
15
27
  export function getGenerativeAnimatable(family, config) {
@@ -1,6 +1,6 @@
1
1
  import type { MouseMoveInteraction, MouseMoveInteractions, ObjectAnimations } from "../types/objectSettings";
2
2
  import type { PropertyKind } from "../properties/types";
3
- export type AnimatableDomain = 'transform' | 'material' | 'edges' | 'light' | 'clouds' | 'rain' | 'particles' | 'effect' | 'grid';
3
+ export type AnimatableDomain = 'transform' | 'material' | 'edges' | 'light' | 'clouds' | 'rain' | 'particles' | 'effect' | 'grid' | 'environment' | 'space' | 'land' | 'text' | 'sky' | 'ocean' | 'terrain';
4
4
  export interface AnimatableProperty {
5
5
  value: string;
6
6
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"getAnimatableProperties.d.ts","sourceRoot":"","sources":["../../src/utils/getAnimatableProperties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE7G,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,qBAAqB,CAAC;AAEtE,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AAElI,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,iGAAiG;IACjG,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE;QACZ,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,GAA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CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE;QACZ,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,CAAC,EAAE,CAAC;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACzB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,SAAS,CAAC,EAAE,qBAAqB,GAAG,oBAAoB,CAAC;CAC5D;AAmBD,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKrD;AAUD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,GAAG,kBAAkB,EAAE,CAMlH;AAKD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAUhH"}
@@ -41,7 +41,7 @@ export function getAnimatableProperties(settings, domain) {
41
41
  .map(toAnimatable);
42
42
  }
43
43
  /** Domain priority when a name exists in more than one (edges before material: an edges key shadows the mesh's). */
44
- const DETECT_ORDER = ['edges', 'light', 'effect', 'grid', 'particles', 'clouds', 'rain', 'material'];
44
+ const DETECT_ORDER = ['edges', 'light', 'effect', 'grid', 'environment', 'space', 'land', 'text', 'particles', 'clouds', 'rain', 'sky', 'ocean', 'terrain', 'material'];
45
45
  /**
46
46
  * Detect which domain a property name belongs to, for a given target. Used by
47
47
  * the runtime + UI to migrate flat MouseMove arrays into the new per-domain
@@ -0,0 +1,3 @@
1
+ import type { CreatedObjectSettings } from '../types/scene3d';
2
+ export declare function migrateGridObject<T extends CreatedObjectSettings>(obj: T): T;
3
+ //# sourceMappingURL=gridMigration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridMigration.d.ts","sourceRoot":"","sources":["../../src/utils/gridMigration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAoB9D,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,qBAAqB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAgB5E"}
@@ -0,0 +1,34 @@
1
+ import { Euler, Quaternion } from 'three';
2
+ // =============================================================================
3
+ // Grids — load-time migration of the legacy surface knobs
4
+ // =============================================================================
5
+ //
6
+ // Every grid now lies flat in its own frame (the plane on local XZ, facing +Y);
7
+ // standing it up is the parent object's rotation, and pointer behaviour is a
8
+ // Pointer-tab binding. Older grids carried two knobs for that:
9
+ // flat: false the plane stood upright on local XY. Kept as it looked by
10
+ // turning the object +90° about its own X axis, so the now-flat
11
+ // plane ends up exactly where the upright one was.
12
+ // followMouse the ripple focus tracked the cursor. Dropped: the focus stays
13
+ // at the grid's centre.
14
+ // Both keys are removed. Pure and idempotent: returns the same object when there
15
+ // is nothing to migrate, so it can run on every load without marking anything dirty.
16
+ //
17
+ const UPRIGHT = new Quaternion().setFromEuler(new Euler(Math.PI / 2, 0, 0));
18
+ export function migrateGridObject(obj) {
19
+ if (!obj || obj.type !== 'grid')
20
+ return obj;
21
+ const config = obj.config;
22
+ if (!config || (!('flat' in config) && !('followMouse' in config)))
23
+ return obj;
24
+ const { flat, followMouse: _followMouse, ...rest } = config;
25
+ const next = { ...obj, config: rest };
26
+ if (flat === false) {
27
+ const mesh = obj.meshSettings ?? {};
28
+ const r = Array.isArray(mesh.rotation) ? mesh.rotation : [0, 0, 0];
29
+ const q = new Quaternion().setFromEuler(new Euler(r[0] ?? 0, r[1] ?? 0, r[2] ?? 0)).multiply(UPRIGHT);
30
+ const e = new Euler().setFromQuaternion(q);
31
+ next.meshSettings = { ...mesh, rotation: [e.x, e.y, e.z] };
32
+ }
33
+ return next;
34
+ }
@@ -16,6 +16,7 @@ export * from './meshUtils';
16
16
  export * from './pathUtils';
17
17
  export * from './positionsCreatorUtils';
18
18
  export * from './sunUtils';
19
+ export * from './skyPhase';
19
20
  export * from './utils';
20
21
  export * from './edgeUtils';
21
22
  export * from './surfaceUtils';
@@ -33,6 +34,11 @@ export * from './handleEdgesMouseMove';
33
34
  export * from './handleLightMouseMove';
34
35
  export * from './sceneQuery';
35
36
  export * from './shootingStarHelpers';
37
+ export * from './spaceMigration';
38
+ export * from './gridMigration';
39
+ export * from './environmentMigration';
40
+ export * from './objectMigration';
41
+ export * from './textMigration';
36
42
  export * from './environmentUtils';
37
43
  export * from './MaterialCompiler';
38
44
  export * from './nodeOverrides';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,i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CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
@@ -16,6 +16,7 @@ export * from './meshUtils.js';
16
16
  export * from './pathUtils.js';
17
17
  export * from './positionsCreatorUtils.js';
18
18
  export * from './sunUtils.js';
19
+ export * from './skyPhase.js';
19
20
  export * from './utils.js';
20
21
  export * from './edgeUtils.js';
21
22
  export * from './surfaceUtils.js';
@@ -33,6 +34,11 @@ export * from './handleEdgesMouseMove.js';
33
34
  export * from './handleLightMouseMove.js';
34
35
  export * from './sceneQuery.js';
35
36
  export * from './shootingStarHelpers.js';
37
+ export * from './spaceMigration.js';
38
+ export * from './gridMigration.js';
39
+ export * from './environmentMigration.js';
40
+ export * from './objectMigration.js';
41
+ export * from './textMigration.js';
36
42
  export * from './environmentUtils.js';
37
43
  export * from './MaterialCompiler.js';
38
44
  export * from './nodeOverrides.js';
@@ -1,6 +1,28 @@
1
- import type { ObjectEffect } from '../types/objectSettings';
2
- /** The object effects of a stored object — entries of any older shape (generative effects) are dropped. */
1
+ import type { EffectSpread, EffectSteps, ObjectEffect, ObjectEffectClip } from '../types/objectSettings';
2
+ /**
3
+ * Visual effects layer GLSL onto three's standard materials, so they take only objects drawn with
4
+ * them: meshes (3d text included) and models. Every other scene object (particles, grids, text, lights,
5
+ * weather, space, generative effects…) takes physical (transform) effects only, for now —
6
+ * they move the object's group, whatever draws inside it.
7
+ */
8
+ export declare function objectTakesVisualEffects(o: {
9
+ type?: string;
10
+ config?: unknown;
11
+ } | null | undefined): boolean;
12
+ /** A group's stagger when its clip sets none (see EffectSpread). */
13
+ export declare const DEFAULT_EFFECT_SPREAD: Required<EffectSpread>;
14
+ /** An object's effect clip (`effects`), or an empty one. The stored value itself — identity stays stable. */
15
+ export declare function objectEffectClipOf(settings: {
16
+ effects?: unknown;
17
+ } | null | undefined): ObjectEffectClip;
18
+ /** The object's Base effects (well-formed entries only). */
3
19
  export declare function objectEffectsOf(settings: {
4
20
  effects?: unknown;
5
21
  } | null | undefined): ObjectEffect[];
22
+ /** The steps of an effect clip as the effects controller takes them, or null when it has none. */
23
+ export declare function objectEffectStepsOf(clip: ObjectEffectClip | null | undefined): EffectSteps | null;
24
+ /** The object with its effect clip changed (Base effects normalised, the rest kept). */
25
+ export declare function withObjectEffectClip<T extends {
26
+ effects?: unknown;
27
+ }>(settings: T, patch: Partial<ObjectEffectClip>): T;
6
28
  //# sourceMappingURL=objectEffects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"objectEffects.d.ts","sourceRoot":"","sources":["../../src/utils/objectEffects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,2GAA2G;AAC3G,wBAAgB,eAAe,CAAC,QAAQ,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,EAAE,CAGlG"}
1
+ {"version":3,"file":"objectEffects.d.ts","sourceRoot":"","sources":["../../src/utils/objectEffects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEzG;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAG3G;AAED,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,YAAY,CAAiD,CAAC;AAI3G,6GAA6G;AAC7G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,CAGvG;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,QAAQ,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,EAAE,CAGlG;AAED,kGAAkG;AAClG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAEjG;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAEtH"}
@@ -1,5 +1,31 @@
1
- /** The object effects of a stored object — entries of any older shape (generative effects) are dropped. */
1
+ /**
2
+ * Visual effects layer GLSL onto three's standard materials, so they take only objects drawn with
3
+ * them: meshes (3d text included) and models. Every other scene object (particles, grids, text, lights,
4
+ * weather, space, generative effects…) takes physical (transform) effects only, for now —
5
+ * they move the object's group, whatever draws inside it.
6
+ */
7
+ export function objectTakesVisualEffects(o) {
8
+ // a group never draws an effect itself: its visual effects go to each child that takes them
9
+ return o?.type === 'mesh' || o?.type === 'model' || o?.type === 'group';
10
+ }
11
+ /** A group's stagger when its clip sets none (see EffectSpread). */
12
+ export const DEFAULT_EFFECT_SPREAD = { order: 'tree', total: 0.6, out: 'reverse' };
13
+ const EMPTY = Object.freeze({ effects: [] });
14
+ /** An object's effect clip (`effects`), or an empty one. The stored value itself — identity stays stable. */
15
+ export function objectEffectClipOf(settings) {
16
+ const c = settings?.effects;
17
+ return c && typeof c === 'object' && !Array.isArray(c) ? c : EMPTY;
18
+ }
19
+ /** The object's Base effects (well-formed entries only). */
2
20
  export function objectEffectsOf(settings) {
3
- const list = settings?.effects;
21
+ const list = objectEffectClipOf(settings).effects;
4
22
  return Array.isArray(list) ? list.filter((e) => e && typeof e.operation === 'string' && typeof e.id === 'string') : [];
5
23
  }
24
+ /** The steps of an effect clip as the effects controller takes them, or null when it has none. */
25
+ export function objectEffectStepsOf(clip) {
26
+ return clip?.steps?.length ? { steps: clip.steps, loop: clip.loop, yoyo: clip.yoyo } : null;
27
+ }
28
+ /** The object with its effect clip changed (Base effects normalised, the rest kept). */
29
+ export function withObjectEffectClip(settings, patch) {
30
+ return { ...settings, effects: { ...objectEffectClipOf(settings), effects: objectEffectsOf(settings), ...patch } };
31
+ }
@@ -0,0 +1,9 @@
1
+ import type { CreatedObjectSettings } from '../types/scene3d';
2
+ /**
3
+ * Every load-time migration of saved scene objects, in one pass. Each step is
4
+ * pure, idempotent and returns the same object when there is nothing to change,
5
+ * so this runs on every load (objectsSlice, the viewer ProjectLoader). A family
6
+ * whose saved shape changes adds its step here.
7
+ */
8
+ export declare function migrateObject<T extends CreatedObjectSettings>(obj: T): T;
9
+ //# sourceMappingURL=objectMigration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectMigration.d.ts","sourceRoot":"","sources":["../../src/utils/objectMigration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAM9D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,qBAAqB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAExE"}
@@ -0,0 +1,13 @@
1
+ import { migrateSpaceObject } from './spaceMigration.js';
2
+ import { migrateGridObject } from './gridMigration.js';
3
+ import { migrateEnvironmentObject } from './environmentMigration.js';
4
+ import { migrateTextObject } from './textMigration.js';
5
+ /**
6
+ * Every load-time migration of saved scene objects, in one pass. Each step is
7
+ * pure, idempotent and returns the same object when there is nothing to change,
8
+ * so this runs on every load (objectsSlice, the viewer ProjectLoader). A family
9
+ * whose saved shape changes adds its step here.
10
+ */
11
+ export function migrateObject(obj) {
12
+ return migrateTextObject(migrateEnvironmentObject(migrateGridObject(migrateSpaceObject(obj))));
13
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Time-of-day phases, keyed by SUN ELEVATION — never by the clock.
3
+ *
4
+ * Everything that changes with the time of day (the Preetham atmosphere, star
5
+ * visibility, labels) reads these, so they all turn at the moment the sun
6
+ * actually crosses the horizon, whatever sunrise/sunset hours or sun model is in
7
+ * use. There used to be six hour tables that disagreed by up to 1.5 h.
8
+ *
9
+ * Keys, in degrees of sun elevation:
10
+ * night ≤ −12 (astronomical-ish: sky fully dark)
11
+ * twilight −4 (blue hour, sun just below the horizon)
12
+ * golden 3 (sun on the horizon: reddest, haziest)
13
+ * day ≥ 15
14
+ * Between two keys the weights cross-fade with a smoothstep; they always sum to 1.
15
+ */
16
+ export interface SkyPhaseWeights {
17
+ night: number;
18
+ twilight: number;
19
+ golden: number;
20
+ day: number;
21
+ }
22
+ export interface SkyAtmosphere {
23
+ turbidity: number;
24
+ rayleigh: number;
25
+ mieCoefficient: number;
26
+ mieDirectionalG: number;
27
+ }
28
+ export declare const SKY_PHASE_ELEVATIONS: {
29
+ readonly night: -12;
30
+ readonly twilight: -4;
31
+ readonly golden: 3;
32
+ readonly day: 15;
33
+ };
34
+ /** Built-in atmospheres for the non-day phases. The day look is the user's own
35
+ * sky settings (see atmosphereForSunElevation). */
36
+ export declare const SKY_PHASE_ATMOSPHERES: Record<'night' | 'twilight' | 'golden', SkyAtmosphere>;
37
+ /** Phase weights for a sun elevation in degrees. Sum to 1. */
38
+ export declare function skyPhaseWeights(sunElevation: number, out?: SkyPhaseWeights): SkyPhaseWeights;
39
+ /**
40
+ * The Preetham atmosphere for a sun elevation: the user's `day` look by day,
41
+ * blended through golden hour and twilight into night as the sun goes down.
42
+ * The user's sliders, keyframes and pointer bindings keep working with the clock
43
+ * on — they shape the day, and time of day adds the evening around it.
44
+ */
45
+ export declare function atmosphereForSunElevation(sunElevation: number, day: SkyAtmosphere, out?: SkyAtmosphere): SkyAtmosphere;
46
+ /** How visible the night sky is (stars, moon halo): 0 by day, 1 once the sun is
47
+ * 12° down. */
48
+ export declare function nightAmount(sunElevation: number): number;
49
+ /**
50
+ * How bright the sky dome is drawn, 1 by day. Preetham alone never gets darker
51
+ * than a flat grey after sunset (its constant 0.1 base term), so the night reads
52
+ * as overcast dusk instead of night. SkyMesh multiplies its output by this.
53
+ */
54
+ export declare const SKY_PHASE_BRIGHTNESS: {
55
+ readonly night: 0.08;
56
+ readonly twilight: 0.5;
57
+ readonly golden: 1;
58
+ readonly day: 1;
59
+ };
60
+ export declare function skyBrightnessForSunElevation(sunElevation: number): number;
61
+ //# sourceMappingURL=skyPhase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skyPhase.d.ts","sourceRoot":"","sources":["../../src/utils/skyPhase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB;;;;;CAA4D,CAAC;AAE9F;oDACoD;AACpD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,OAAO,GAAG,UAAU,GAAG,QAAQ,EAAE,aAAa,CAIxF,CAAC;AAOF,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,eAAe,GAAG,eAAe,CAmB5F;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,aAAa,CAStH;AAED;gBACgB;AAChB,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;CAA6D,CAAC;AAE/F,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAIzE"}