@needle-tools/engine 3.45.2-beta.1 → 3.45.2-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.45.2-beta.4] - 2024-07-19
8
+ - Fix: DragControls `Snap To Surface` when starting to drag
9
+ - Change: Minimal increase of close distance for SpatialGrab in WebXR
10
+
11
+ ## [3.45.2-beta.3] - 2024-07-18
12
+ - Add: Support for immersive-ar `unbounded` session for unlimited passthrough experiences (enabled by default).
13
+ This is currently an experimental feature in the Quest browser. To enable it go to `chrome://flags` and check `WebXR experiments`, then restart the Browser. The next time you start an immersive-ar session on quest the WebXR experience will run without guardian boundaries.
14
+ - Add: NEPointerEvent `isSpatial` getter to easily determine if an input event was generated by a spatial device
15
+ - Fix: Raycast handle null or empty objects in targets array
16
+
7
17
  ## [3.45.2-beta.1] - 2024-07-17
8
18
  - Add: Object `static:true` does now disable `matrixAutoUpdate`
9
19
  - Fix: Animation component `play()` issue where previous animations were not always stopped/faded out
@@ -29626,13 +29626,13 @@ function tiA() {
29626
29626
  return g || null;
29627
29627
  }
29628
29628
  const t4 = gA("debugdefines");
29629
- Sh('if(!globalThis[""3.45.2-beta.1""]) globalThis[""3.45.2-beta.1""] = "0.0.0";');
29629
+ Sh('if(!globalThis[""3.45.2-beta.4""]) globalThis[""3.45.2-beta.4""] = "0.0.0";');
29630
29630
  Sh('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
29631
- Sh('if(!globalThis[""Wed Jul 17 2024 19:33:24 GMT+0200 (Central European Summer Time)""]) globalThis[""Wed Jul 17 2024 19:33:24 GMT+0200 (Central European Summer Time)""] = "unknown";');
29632
- Sh('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.45.2-beta.1";');
29631
+ Sh('if(!globalThis[""Fri Jul 19 2024 19:15:04 GMT+0200 (Central European Summer Time)""]) globalThis[""Fri Jul 19 2024 19:15:04 GMT+0200 (Central European Summer Time)""] = "unknown";');
29632
+ Sh('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.45.2-beta.4";');
29633
29633
  Sh('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
29634
- Sh('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Jul 17 2024 19:33:24 GMT+0200 (Central European Summer Time)";');
29635
- const un = "3.45.2-beta.1", AJ = "undefined", i4 = "Wed Jul 17 2024 19:33:24 GMT+0200 (Central European Summer Time)";
29634
+ Sh('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Jul 19 2024 19:15:04 GMT+0200 (Central European Summer Time)";');
29635
+ const un = "3.45.2-beta.4", AJ = "undefined", i4 = "Fri Jul 19 2024 19:15:04 GMT+0200 (Central European Summer Time)";
29636
29636
  t4 && console.log(`Engine version: ${un} (generator: ${AJ})
29637
29637
  Project built at ${i4}`);
29638
29638
  const oB = "needle_isActiveInHierarchy", $E = "builtin_components", sS = "needle_editor_guid";
@@ -56268,6 +56268,10 @@ class xC extends PointerEvent {
56268
56268
  B(this, "_propagationStopped", !1);
56269
56269
  this._pointerid = i.pointerId, this._pointerType = i.pointerType, this._type = e, this.deviceIndex = i.deviceIndex, this.origin = i.origin, this.source = t, this.mode = i.mode, this._ray = i.ray, this.space = i.device;
56270
56270
  }
56271
+ /** Returns true if the input was emitted in 3D space (and not by e.g. clicking on a 2D screen). You can use {@link mode} if you need more information about the input source */
56272
+ get isSpatial() {
56273
+ return this.mode != "screen";
56274
+ }
56271
56275
  /** A ray in worldspace for the event.
56272
56276
  * If the ray is undefined you can also use `space.worldForward` and `space.worldPosition` */
56273
56277
  get ray() {
@@ -64348,7 +64352,7 @@ const Ba = class {
64348
64352
  switch (A) {
64349
64353
  case "immersive-ar":
64350
64354
  return {
64351
- optionalFeatures: ["anchors", "local-floor", "hand-tracking", "layers", "dom-overlay", "hit-test"]
64355
+ optionalFeatures: ["anchors", "local-floor", "hand-tracking", "layers", "dom-overlay", "hit-test", "unbounded"]
64352
64356
  };
64353
64357
  case "immersive-vr":
64354
64358
  return {
@@ -66187,7 +66191,7 @@ class JBA {
66187
66191
  intersect(A, e, t, i) {
66188
66192
  var I;
66189
66193
  for (const o of e) {
66190
- if (o.visible === !1 || fe.isGizmo(o) || i.lineThreshold !== void 0 && i.lineThreshold < 0 && o instanceof Hi)
66194
+ if (!o || o.visible === !1 || fe.isGizmo(o) || i.lineThreshold !== void 0 && i.lineThreshold < 0 && o instanceof Hi)
66191
66195
  continue;
66192
66196
  const s = (I = i.testObject) == null ? void 0 : I.call(i, o);
66193
66197
  if (s === !1)
@@ -72183,7 +72187,7 @@ class f0 extends Tf {
72183
72187
  performRaycast(A) {
72184
72188
  if (!ke.active || !(A != null && A.ray))
72185
72189
  return null;
72186
- const e = A.ray.origin, t = 0.01;
72190
+ const e = A.ray.origin, t = 0.015;
72187
72191
  return this.context.physics.sphereOverlap(e, t);
72188
72192
  }
72189
72193
  }
@@ -87891,6 +87895,7 @@ class XhA {
87891
87895
  case 1:
87892
87896
  this._dragPlane.setFromNormalAndCoplanarPoint(t, o);
87893
87897
  break;
87898
+ case 4:
87894
87899
  case 3:
87895
87900
  const d = new y(0, 1, 0), p = t, u = d.angleTo(p), f = 0.5;
87896
87901
  u > Math.PI / 2 + f || u < Math.PI / 2 - f ? this._dragPlane.setFromNormalAndCoplanarPoint(new y(0, 1, 0), o) : this._dragPlane.setFromNormalAndCoplanarPoint(t, o);
@@ -29626,13 +29626,13 @@ function Cte() {
29626
29626
  return s || null;
29627
29627
  }
29628
29628
  const _V = ie("debugdefines");
29629
- Kg('if(!globalThis[""3.45.2-beta.1""]) globalThis[""3.45.2-beta.1""] = "0.0.0";');
29629
+ Kg('if(!globalThis[""3.45.2-beta.4""]) globalThis[""3.45.2-beta.4""] = "0.0.0";');
29630
29630
  Kg('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
29631
- Kg('if(!globalThis[""Wed Jul 17 2024 19:33:36 GMT+0200 (Central European Summer Time)""]) globalThis[""Wed Jul 17 2024 19:33:36 GMT+0200 (Central European Summer Time)""] = "unknown";');
29632
- Kg('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.45.2-beta.1";');
29631
+ Kg('if(!globalThis[""Fri Jul 19 2024 19:15:17 GMT+0200 (Central European Summer Time)""]) globalThis[""Fri Jul 19 2024 19:15:17 GMT+0200 (Central European Summer Time)""] = "unknown";');
29632
+ Kg('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.45.2-beta.4";');
29633
29633
  Kg('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
29634
- Kg('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Jul 17 2024 19:33:36 GMT+0200 (Central European Summer Time)";');
29635
- const sl = "3.45.2-beta.1", V2 = "undefined", bV = "Wed Jul 17 2024 19:33:36 GMT+0200 (Central European Summer Time)";
29634
+ Kg('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Jul 19 2024 19:15:17 GMT+0200 (Central European Summer Time)";');
29635
+ const sl = "3.45.2-beta.4", V2 = "undefined", bV = "Fri Jul 19 2024 19:15:17 GMT+0200 (Central European Summer Time)";
29636
29636
  _V && console.log(`Engine version: ${sl} (generator: ${V2})
29637
29637
  Project built at ${bV}`);
29638
29638
  const zu = "needle_isActiveInHierarchy", Im = "builtin_components", bw = "needle_editor_guid";
@@ -56268,6 +56268,10 @@ class vu extends PointerEvent {
56268
56268
  d(this, "_propagationStopped", !1);
56269
56269
  this._pointerid = n.pointerId, this._pointerType = n.pointerType, this._type = t, this.deviceIndex = n.deviceIndex, this.origin = n.origin, this.source = i, this.mode = n.mode, this._ray = n.ray, this.space = n.device;
56270
56270
  }
56271
+ /** Returns true if the input was emitted in 3D space (and not by e.g. clicking on a 2D screen). You can use {@link mode} if you need more information about the input source */
56272
+ get isSpatial() {
56273
+ return this.mode != "screen";
56274
+ }
56271
56275
  /** A ray in worldspace for the event.
56272
56276
  * If the ray is undefined you can also use `space.worldForward` and `space.worldPosition` */
56273
56277
  get ray() {
@@ -64348,7 +64352,7 @@ const Jc = class {
64348
64352
  switch (e) {
64349
64353
  case "immersive-ar":
64350
64354
  return {
64351
- optionalFeatures: ["anchors", "local-floor", "hand-tracking", "layers", "dom-overlay", "hit-test"]
64355
+ optionalFeatures: ["anchors", "local-floor", "hand-tracking", "layers", "dom-overlay", "hit-test", "unbounded"]
64352
64356
  };
64353
64357
  case "immersive-vr":
64354
64358
  return {
@@ -66187,7 +66191,7 @@ class rue {
66187
66191
  intersect(e, t, i, n) {
66188
66192
  var r;
66189
66193
  for (const o of t) {
66190
- if (o.visible === !1 || _t.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Pn)
66194
+ if (!o || o.visible === !1 || _t.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Pn)
66191
66195
  continue;
66192
66196
  const a = (r = n.testObject) == null ? void 0 : r.call(n, o);
66193
66197
  if (a === !1)
@@ -72183,7 +72187,7 @@ class LS extends e_ {
72183
72187
  performRaycast(e) {
72184
72188
  if (!Et.active || !(e != null && e.ray))
72185
72189
  return null;
72186
- const t = e.ray.origin, i = 0.01;
72190
+ const t = e.ray.origin, i = 0.015;
72187
72191
  return this.context.physics.sphereOverlap(t, i);
72188
72192
  }
72189
72193
  }
@@ -87891,6 +87895,7 @@ class bge {
87891
87895
  case 1:
87892
87896
  this._dragPlane.setFromNormalAndCoplanarPoint(i, o);
87893
87897
  break;
87898
+ case 4:
87894
87899
  case 3:
87895
87900
  const v = new w(0, 1, 0), _ = i, A = v.angleTo(_), b = 0.5;
87896
87901
  A > Math.PI / 2 + b || A < Math.PI / 2 - b ? this._dragPlane.setFromNormalAndCoplanarPoint(new w(0, 1, 0), o) : this._dragPlane.setFromNormalAndCoplanarPoint(i, o);