@needle-tools/engine 5.1.0-next.1780579670.dramatic-pierogi.b8fa941 → 5.1.0

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 (122) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/components.needle.json +1 -1
  3. package/dist/gltf-progressive-BGQ-cjly.umd.cjs +10 -0
  4. package/dist/gltf-progressive-BvQHrERj.min.js +10 -0
  5. package/dist/{gltf-progressive-CH7aqHHr.js → gltf-progressive-CtYnVfLc.js} +420 -351
  6. package/dist/{materialx-B85WjP7E.min.js → materialx-B5gKeM65.min.js} +1 -1
  7. package/dist/{materialx-B47Bz-xs.umd.cjs → materialx-CFRcCYWy.umd.cjs} +1 -1
  8. package/dist/{materialx-jkHmVPez.js → materialx-DqGmteNO.js} +1 -1
  9. package/dist/{needle-engine.bundle-WQeWxmZD.js → needle-engine.bundle-5oIL49YP.js} +6826 -6685
  10. package/dist/{needle-engine.bundle-BSPk6RkD.min.js → needle-engine.bundle-DAAfj8Cs.min.js} +161 -149
  11. package/dist/{needle-engine.bundle-DCPHDPAd.umd.cjs → needle-engine.bundle-DvOrfXws.umd.cjs} +159 -147
  12. package/dist/needle-engine.d.ts +106 -44
  13. package/dist/needle-engine.js +610 -608
  14. package/dist/needle-engine.min.js +1 -1
  15. package/dist/needle-engine.umd.cjs +1 -1
  16. package/dist/three.js +3 -0
  17. package/dist/three.min.js +22 -22
  18. package/dist/three.umd.cjs +24 -24
  19. package/dist/{vendor-BQ2Vuntm.min.js → vendor-2--bD1c9.min.js} +19 -19
  20. package/dist/{vendor-BslSKZPo.js → vendor-BNtcIZkv.js} +1141 -1138
  21. package/dist/{vendor-1UvpPPSB.umd.cjs → vendor-vbe9sv1t.umd.cjs} +20 -20
  22. package/lib/engine/api.d.ts +1 -1
  23. package/lib/engine/api.js +1 -1
  24. package/lib/engine/api.js.map +1 -1
  25. package/lib/engine/engine_context.js +16 -3
  26. package/lib/engine/engine_context.js.map +1 -1
  27. package/lib/engine/engine_init.js +2 -2
  28. package/lib/engine/engine_init.js.map +1 -1
  29. package/lib/engine/engine_license.d.ts +7 -7
  30. package/lib/engine/engine_license.js +72 -72
  31. package/lib/engine/engine_license.js.map +1 -1
  32. package/lib/engine/engine_networking_blob.js +3 -3
  33. package/lib/engine/engine_networking_blob.js.map +1 -1
  34. package/lib/engine/engine_utils_qrcode.js +2 -2
  35. package/lib/engine/engine_utils_qrcode.js.map +1 -1
  36. package/lib/engine/postprocessing/postprocessing.d.ts +2 -1
  37. package/lib/engine/postprocessing/postprocessing.js +3 -2
  38. package/lib/engine/postprocessing/postprocessing.js.map +1 -1
  39. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
  40. package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +2 -2
  41. package/lib/engine/webcomponents/needle menu/needle-menu.js +9 -9
  42. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  43. package/lib/engine/webcomponents/needle-engine.js +2 -2
  44. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  45. package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
  46. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  47. package/lib/engine/xr/NeedleXRSession.d.ts +24 -0
  48. package/lib/engine/xr/NeedleXRSession.js +52 -7
  49. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  50. package/lib/engine/xr/TempXRContext.js +2 -2
  51. package/lib/engine/xr/TempXRContext.js.map +1 -1
  52. package/lib/engine/xr/init.js +2 -3
  53. package/lib/engine/xr/init.js.map +1 -1
  54. package/lib/engine-components/Component.js +14 -1
  55. package/lib/engine-components/Component.js.map +1 -1
  56. package/lib/engine-components/ContactShadows.d.ts +7 -2
  57. package/lib/engine-components/ContactShadows.js +65 -45
  58. package/lib/engine-components/ContactShadows.js.map +1 -1
  59. package/lib/engine-components/GroundProjection.d.ts +6 -0
  60. package/lib/engine-components/GroundProjection.js +69 -7
  61. package/lib/engine-components/GroundProjection.js.map +1 -1
  62. package/lib/engine-components/NeedleMenu.d.ts +1 -1
  63. package/lib/engine-components/NeedleMenu.js +5 -2
  64. package/lib/engine-components/NeedleMenu.js.map +1 -1
  65. package/lib/engine-components/SceneSwitcher.d.ts +2 -0
  66. package/lib/engine-components/SceneSwitcher.js +26 -14
  67. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  68. package/lib/engine-components/SeeThrough.d.ts +39 -0
  69. package/lib/engine-components/SeeThrough.js +69 -1
  70. package/lib/engine-components/SeeThrough.js.map +1 -1
  71. package/lib/engine-components/Skybox.js +9 -0
  72. package/lib/engine-components/Skybox.js.map +1 -1
  73. package/lib/engine-components/api.d.ts +1 -0
  74. package/lib/engine-components/api.js +1 -0
  75. package/lib/engine-components/api.js.map +1 -1
  76. package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
  77. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  78. package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +9 -5
  79. package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
  80. package/lib/engine-components/particlesystem/ParticleSystem.js +4 -0
  81. package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
  82. package/lib/engine-components/postprocessing/Volume.d.ts +1 -9
  83. package/lib/engine-components/postprocessing/Volume.js +2 -14
  84. package/lib/engine-components/postprocessing/Volume.js.map +1 -1
  85. package/lib/engine-components/webxr/WebXRImageTracking.js +3 -0
  86. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  87. package/package.json +4 -4
  88. package/plugins/common/license.js +4 -4
  89. package/plugins/types/userconfig.d.ts +10 -0
  90. package/plugins/vite/build-pipeline.d.ts +19 -0
  91. package/plugins/vite/build-pipeline.js +67 -5
  92. package/plugins/vite/license.js +4 -4
  93. package/src/engine/api.ts +1 -1
  94. package/src/engine/engine_context.ts +15 -2
  95. package/src/engine/engine_gameobject.ts +1 -1
  96. package/src/engine/engine_init.ts +2 -2
  97. package/src/engine/engine_license.ts +69 -69
  98. package/src/engine/engine_networking_blob.ts +3 -3
  99. package/src/engine/engine_utils_qrcode.ts +2 -2
  100. package/src/engine/postprocessing/postprocessing.ts +3 -2
  101. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
  102. package/src/engine/webcomponents/needle menu/needle-menu.ts +10 -10
  103. package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
  104. package/src/engine/webcomponents/needle-engine.ts +2 -2
  105. package/src/engine/xr/NeedleXRSession.ts +53 -7
  106. package/src/engine/xr/TempXRContext.ts +2 -2
  107. package/src/engine/xr/init.ts +2 -3
  108. package/src/engine-components/Component.ts +13 -1
  109. package/src/engine-components/ContactShadows.ts +75 -49
  110. package/src/engine-components/GroundProjection.ts +71 -7
  111. package/src/engine-components/NeedleMenu.ts +6 -3
  112. package/src/engine-components/SceneSwitcher.ts +23 -13
  113. package/src/engine-components/SeeThrough.ts +75 -1
  114. package/src/engine-components/Skybox.ts +8 -0
  115. package/src/engine-components/api.ts +1 -0
  116. package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
  117. package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +12 -5
  118. package/src/engine-components/particlesystem/ParticleSystem.ts +4 -0
  119. package/src/engine-components/postprocessing/Volume.ts +2 -13
  120. package/src/engine-components/webxr/WebXRImageTracking.ts +1 -0
  121. package/dist/gltf-progressive-9tlS5iCx.umd.cjs +0 -10
  122. package/dist/gltf-progressive-CVg80COO.min.js +0 -10
@@ -118,13 +118,11 @@ import { XRHandSpace } from 'three';
118
118
 
119
119
  export declare const $componentName: unique symbol;
120
120
 
121
- /* Excluded from this release type: _$DeHzisx */
121
+ /* Excluded from this release type: $iujBhf */
122
122
 
123
123
  export declare const $physicsKey: unique symbol;
124
124
 
125
- /* Excluded from this release type: _$zFmYj */
126
-
127
- /* Excluded from this release type: __EOmPHdLs */
125
+ /* Excluded from this release type: $RHhhju */
128
126
 
129
127
  export declare class __Ignore {
130
128
  }
@@ -4576,8 +4574,8 @@ export declare class ContactShadows extends Component {
4576
4574
  * in which case ContactShadows scale would affect the projection
4577
4575
  **/
4578
4576
  private readonly shadowsRoot;
4579
- private shadowCamera?;
4580
4577
  private readonly shadowGroup;
4578
+ private shadowCamera?;
4581
4579
  private renderTarget?;
4582
4580
  private renderTargetBlur?;
4583
4581
  private plane?;
@@ -4592,11 +4590,16 @@ export declare class ContactShadows extends Component {
4592
4590
  * Call to fit the shadows to the scene.
4593
4591
  */
4594
4592
  fitShadows(params?: FitParameters): void;
4593
+ /**
4594
+ * Call to update the shadows immediately. Only needed if `manualUpdate` is enabled, usually the shadows will update automatically when the scene changes or when the component is enabled.
4595
+ */
4596
+ renderShadowsNow(): void;
4595
4597
  /* Excluded from this release type: awake */
4596
- /* Excluded from this release type: start */
4597
- onEnable(): void;
4598
+ /* Excluded from this release type: onEnable */
4598
4599
  /* Excluded from this release type: onDestroy */
4599
4600
  /* Excluded from this release type: onBeforeRender */
4601
+ private _ensureSetup;
4602
+ private _renderShadows;
4600
4603
  private blurShadow;
4601
4604
  private applyMinSize;
4602
4605
  }
@@ -8263,6 +8266,12 @@ export declare class GroundProjectedEnv extends Component {
8263
8266
  private _lastHeight?;
8264
8267
  private _projection?;
8265
8268
  private _watcher?;
8269
+ /** The scene's real backgroundBlurriness, stored while we temporarily override it for the render. */
8270
+ private _savedBackgroundBlur;
8271
+ /** pre_render_callback: force the skybox blur just before the render (after all component onBeforeRender). */
8272
+ private readonly _forceBackgroundBlur;
8273
+ /** post_render_callback: restore the scene's real blur right after the render. */
8274
+ private readonly _restoreBackgroundBlur;
8266
8275
  /* Excluded from this release type: awake */
8267
8276
  /* Excluded from this release type: onEnable */
8268
8277
  /* Excluded from this release type: onDisable */
@@ -12365,7 +12374,7 @@ export declare class NeedleMenu extends Component {
12365
12374
  */
12366
12375
  position: "top" | "bottom";
12367
12376
  /**
12368
- * Controls the visibility of the Needle logo in the menu (requires PRO license)
12377
+ * Controls the visibility of the Needle logo in the menu (requires a commercial license)
12369
12378
  */
12370
12379
  showNeedleLogo: boolean;
12371
12380
  /**
@@ -12464,10 +12473,10 @@ declare class NeedleMenu_2 {
12464
12473
  setPosition(position: "top" | "bottom"): void;
12465
12474
  /**
12466
12475
  * Call to show or hide the menu.
12467
- * NOTE: Hiding the menu is a PRO feature and requires a needle engine license. Hiding the menu will not work in production without a license.
12476
+ * NOTE: Hiding the menu requires a commercial license. Hiding the menu will not work in production without a license.
12468
12477
  */
12469
12478
  setVisible(visible: boolean): void;
12470
- /** When set to false, the Needle Engine logo will be hidden. Hiding the logo requires a needle engine license */
12479
+ /** When set to false, the Needle Engine logo will be hidden. Hiding the logo requires a commercial license */
12471
12480
  showNeedleLogo(visible: boolean): void;
12472
12481
  /** @returns true if the logo is visible */
12473
12482
  get logoIsVisible(): boolean;
@@ -12862,6 +12871,24 @@ export declare class NeedleXRSession implements INeedleXRSession {
12862
12871
  static getXRSync(context: Context): NeedleXRSync;
12863
12872
  static get currentSessionRequest(): XRSessionMode | null;
12864
12873
  private static _currentSessionRequestMode;
12874
+ /** Base URL for branded Needle AppClip experiences */
12875
+ private static readonly appClipBaseUrl;
12876
+ private static _appClipUrl;
12877
+ /**
12878
+ * Optionally provide a custom Needle AppClip experience to open on iOS instead of the default Needle AppClip.
12879
+ * This enables custom App Clip card branding (your own title and image) when launching AR on iPhone and iPad.
12880
+ *
12881
+ * You can provide either:
12882
+ * - the full URL, e.g. `https://appclip.needle.tools/x/your-experience`
12883
+ * - or just the experience id, e.g. `your-experience` (expanded to `https://appclip.needle.tools/x/your-experience`)
12884
+ *
12885
+ * **IMPORTANT**: the resulting URL must exactly match an App Clip experience URL you have registered (with custom card metadata).
12886
+ * For this reason the URL is opened as-is, without appending any query parameters.
12887
+ * @link https://appclip.needle.tools
12888
+ */
12889
+ static get appClipUrl(): string | null;
12890
+ static set appClipUrl(value: string | null);
12891
+ /* Excluded from this release type: getAppClipLaunchUrl */
12865
12892
  /**
12866
12893
  * @returns the active @type {NeedleXRSession} (if any active) or null
12867
12894
  */
@@ -16270,7 +16297,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
16270
16297
  multisampling: "auto" | number;
16271
16298
  /** When enabled, the device pixel ratio will be gradually reduced when FPS is low
16272
16299
  * and restored when performance recovers.
16273
- * @default true
16300
+ * @experimental
16301
+ * @default false
16274
16302
  */
16275
16303
  adaptiveResolution: boolean;
16276
16304
  constructor(context: Context);
@@ -17235,7 +17263,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
17235
17263
  unapply(obj: Object3D): void;
17236
17264
  }
17237
17265
 
17238
- declare enum ReflectionProbeUsage {
17266
+ export declare enum ReflectionProbeUsage {
17239
17267
  Off = 0,
17240
17268
  BlendProbes = 1,
17241
17269
  BlendProbesAndSkybox = 2,
@@ -18043,6 +18071,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
18043
18071
  evaluate(t01: number, t: number): number;
18044
18072
  }
18045
18073
 
18074
+ /* Excluded from this release type: rXELCf */
18075
+
18046
18076
  export declare function sanitizeString(str: any): string;
18047
18077
 
18048
18078
  /** Download a image (must be a data url).
@@ -18322,6 +18352,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
18322
18352
  switchScene(scene: AssetReference): Promise<boolean>;
18323
18353
  private __unloadCurrentScene;
18324
18354
  private _currentlyLoadingScene?;
18355
+ private _loadingRequestId;
18356
+ private _activeLoadingRequestId;
18325
18357
  /* Excluded from this release type: __internalSwitchScene */
18326
18358
  preload(index: number): Promise<boolean> | Promise<ArrayBufferLike | null>;
18327
18359
  private tryLoadFromQueryParam;
@@ -19174,13 +19206,42 @@ export declare class OrbitControls extends Component implements ICameraControlle
19174
19206
  *
19175
19207
  */
19176
19208
  autoUpdate: boolean;
19209
+ /**
19210
+ * The alpha (opacity) the object is currently faded to, in the `[0, 1]` range.
19211
+ * `1` means fully visible, `0` means fully hidden. This is the live, animated value
19212
+ * (it lerps toward the target over {@link fadeDuration}), updated every frame the fade runs.
19213
+ *
19214
+ * External components can read this to react to the see-through state — e.g. toggling a
19215
+ * collider, muting audio, or driving a UI prompt as the object fades in or out.
19216
+ *
19217
+ * @example React to the object becoming (almost) hidden
19218
+ * ```ts
19219
+ * if (seeThrough.currentAlpha < 0.1) {
19220
+ * // object is essentially see-through now
19221
+ * }
19222
+ * ```
19223
+ * @default 1
19224
+ */
19225
+ get currentAlpha(): number;
19226
+ /**
19227
+ * Below this alpha the object stops casting a shadow. The shadow map only stores depth, so a
19228
+ * faded object would otherwise keep casting a fully solid shadow (three.js does not fade shadows
19229
+ * by opacity). Toggling shadow casting off near-invisible is the cleanest fix; we drive it via
19230
+ * the {@link Renderer.shadowCastingMode} so it cooperates with the per-frame shadow settings the
19231
+ * Renderer re-applies. Note this is a hard on/off, not a fade.
19232
+ */
19233
+ static readonly shadowHideThreshold = 0.05;
19177
19234
  private readonly _referencePointVector;
19178
19235
  private readonly _referencePointDir;
19179
19236
  private _distance;
19180
19237
  private _renderer;
19181
19238
  private _needsUpdate;
19182
19239
  private _id;
19240
+ private _currentAlpha;
19241
+ /** Renderers whose shadow casting we turned off while hidden, mapped to their original mode for restore. */
19242
+ private readonly _suppressedShadowCasting;
19183
19243
  /* Excluded from this release type: onEnable */
19244
+ /* Excluded from this release type: onDestroy */
19184
19245
  /* Excluded from this release type: update */
19185
19246
  private updateDirection;
19186
19247
  /**
@@ -19189,6 +19250,15 @@ export declare class OrbitControls extends Component implements ICameraControlle
19189
19250
  * @param duration Duration in seconds to reach the target alpha. 0 means immediate. Default is the component's fadeDuration.
19190
19251
  */
19191
19252
  updateAlpha(targetAlpha: number, duration?: number): void;
19253
+ /**
19254
+ * Suppress or restore a renderer's shadow casting based on its current alpha.
19255
+ * Driving {@link Renderer.shadowCastingMode} (rather than the raw `mesh.castShadow`) is required
19256
+ * because the Renderer re-applies that setting every frame; we remember the original mode so it
19257
+ * is restored exactly when the object fades back in.
19258
+ */
19259
+ private updateShadowCasting;
19260
+ /** Restore every renderer we suppressed shadow casting on, then clear the bookkeeping. */
19261
+ private restoreSuppressedShadowCasting;
19192
19262
  }
19193
19263
 
19194
19264
  export declare function sendDestroyed(guid: string, con: INetworkConnection, opts?: SyncDestroyOptions): void;
@@ -19407,7 +19477,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
19407
19477
 
19408
19478
  export declare function setWorldScale(obj: Object3D, vec: Vector3): void;
19409
19479
 
19410
- declare enum ShadowCastingMode {
19480
+ export declare enum ShadowCastingMode {
19411
19481
  Off = 0,
19412
19482
  On = 1,
19413
19483
  TwoSided = 2,
@@ -23747,14 +23817,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
23747
23817
  * @max renderer.capabilities.maxSamples
23748
23818
  */
23749
23819
  multisampling: "auto" | number;
23750
- /** When enabled, the device pixel ratio will be gradually reduced when FPS is low
23751
- * and restored when performance recovers. This helps maintain smooth frame rates
23752
- * on devices where full retina resolution is too expensive for postprocessing.
23753
- * Pushed to `context.postprocessing.adaptiveResolution` when this Volume is active.
23754
- * Disable this if you need a fixed resolution and prefer consistent quality over frame rate.
23755
- * @default true
23756
- */
23757
- adaptiveResolution: boolean;
23758
23820
  /**
23759
23821
  * Add a post processing effect to this Volume and push it to the core postprocessing stack.
23760
23822
  */
@@ -23781,7 +23843,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
23781
23843
  private pushEffectsToCore;
23782
23844
  /** Remove all effects this Volume contributed from the core stack */
23783
23845
  private removeEffectsFromCore;
23784
- /** Push multisampling and adaptiveResolution config to the core stack */
23846
+ /** Push multisampling config to the core stack */
23785
23847
  private syncConfigToCore;
23786
23848
  private _applyPostQueue;
23787
23849
  /** called from needle editor sync package if its active */
@@ -25117,28 +25179,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
25117
25179
  export { }
25118
25180
 
25119
25181
 
25120
- declare module 'three' {
25121
- interface SkinnedMesh {
25122
- staticGenerator?: StaticGeometryGenerator;
25123
- staticGeometry?: BufferGeometry;
25124
- staticGeometryLastUpdate?: number;
25125
- }
25126
- interface Mesh {
25127
- acceleratedRaycast?: any;
25128
- }
25129
- interface SkinnedMesh {
25130
- /** @deprecated use autoUpdateMeshBvhInterval */
25131
- autoUpdateMeshBVH?: boolean;
25132
- /**
25133
- * Interval in milliseconds to automatically update the mesh BVH. When set to >= 0 the BVH will be updated every x milliseconds.
25134
- * @default undefined (disabled)
25135
- */
25136
- autoUpdateMeshBvhInterval?: number;
25137
- bvhNeedsUpdate?: boolean;
25138
- }
25139
- }
25140
-
25141
-
25142
25182
  declare module 'three' {
25143
25183
  interface Object3D {
25144
25184
  get guid(): string | undefined;
@@ -25284,3 +25324,25 @@ declare module 'three' {
25284
25324
  slerp(end: Vector3, t: number): Vector3;
25285
25325
  }
25286
25326
  }
25327
+
25328
+
25329
+ declare module 'three' {
25330
+ interface SkinnedMesh {
25331
+ staticGenerator?: StaticGeometryGenerator;
25332
+ staticGeometry?: BufferGeometry;
25333
+ staticGeometryLastUpdate?: number;
25334
+ }
25335
+ interface Mesh {
25336
+ acceleratedRaycast?: any;
25337
+ }
25338
+ interface SkinnedMesh {
25339
+ /** @deprecated use autoUpdateMeshBvhInterval */
25340
+ autoUpdateMeshBVH?: boolean;
25341
+ /**
25342
+ * Interval in milliseconds to automatically update the mesh BVH. When set to >= 0 the BVH will be updated every x milliseconds.
25343
+ * @default undefined (disabled)
25344
+ */
25345
+ autoUpdateMeshBvhInterval?: number;
25346
+ bvhNeedsUpdate?: boolean;
25347
+ }
25348
+ }