@needle-tools/engine 3.21.2 → 3.21.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,11 @@ 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.21.3] - 2023-10-23
8
+ - Fix: Issue where Chrome touch emulation caused "onPointerClick" being called twice per click
9
+ - Fix: EventList instances are now not shared anymore between components created via `instantiate`
10
+ - Fix: Regression where SphereCollider radius was not being applied
11
+
7
12
  ## [3.21.2] - 2023-10-23
8
13
  - Change: Expose EventList subscriber count
9
14
  - Change: `PointerEventArgs.use()` should not stop propagation
@@ -22100,8 +22100,10 @@ class LV extends EventTarget {
22100
22100
  }
22101
22101
  // moveEvent?: Event;
22102
22102
  onMove(e) {
22103
- const t = this.getPointerPressed(e.button);
22104
- t === !1 && !this.isInRect(e) || e.pointerType === "touch" && !t || (co && console.log(e.pointerType, "MOVE", e.button), this.updatePointerPosition(e), this.setPointerStateT(e.button, this._pointerEvent, e.source), this.onDispatchEvent(e));
22103
+ const t = e.button;
22104
+ this._pointerClick[t] = !1, this._pointerDoubleClick[t] = !1;
22105
+ const g = this.getPointerPressed(t);
22106
+ g === !1 && !this.isInRect(e) || e.pointerType === "touch" && !g || (co && console.log(e.pointerType, "MOVE", t), this.updatePointerPosition(e), this.setPointerStateT(t, this._pointerEvent, e.source), this.onDispatchEvent(e));
22105
22107
  }
22106
22108
  onUp(e) {
22107
22109
  var o;
@@ -30186,7 +30188,7 @@ function Zz(i) {
30186
30188
  }
30187
30189
  function KK(i, A, e, t) {
30188
30190
  var g, I;
30189
- if (e != null) {
30191
+ if (e != null)
30190
30192
  if (e.isComponent === !0) {
30191
30193
  const o = e.gameObject;
30192
30194
  if (o) {
@@ -30209,9 +30211,12 @@ function KK(i, A, e, t) {
30209
30211
  if (C)
30210
30212
  return Ip && console.log(A, "old", e, "new", C), C;
30211
30213
  }
30212
- } else if (e.isVector4 || e.isVector3 || e.isVector2 || e.isQuaternion || e.isEuler)
30213
- return e.clone();
30214
- }
30214
+ } else {
30215
+ if (e.isVector4 || e.isVector3 || e.isVector2 || e.isQuaternion || e.isEuler)
30216
+ return e.clone();
30217
+ if (e.isEventList === !0)
30218
+ return new e.constructor();
30219
+ }
30215
30220
  }
30216
30221
  const oG = sA("debugnewscripts"), Xz = sA("debughierarchy"), _t = [];
30217
30222
  function $z() {
@@ -45939,6 +45944,8 @@ class HM extends Event {
45939
45944
  }
45940
45945
  class qg {
45941
45946
  constructor(A) {
45947
+ /** checked during instantiate to create a new instance */
45948
+ r(this, "isEventList", !0);
45942
45949
  r(this, "target");
45943
45950
  r(this, "key");
45944
45951
  r(this, "_isInvoking", !1);
@@ -45958,10 +45965,15 @@ class qg {
45958
45965
  this.key = t;
45959
45966
  }
45960
45967
  }
45968
+ /** How many callback methods are subscribed to this event */
45961
45969
  get listenerCount() {
45962
45970
  var A;
45963
45971
  return ((A = this.methods) == null ? void 0 : A.length) ?? 0;
45964
45972
  }
45973
+ /** If the event is currently being invoked */
45974
+ get isInvoking() {
45975
+ return this._isInvoking;
45976
+ }
45965
45977
  invoke(...A) {
45966
45978
  var e;
45967
45979
  if (this._isInvoking)
@@ -61291,10 +61303,15 @@ const Us = class extends NA {
61291
61303
  * Propagate up in hiearchy and call the callback for each component that is possibly a handler
61292
61304
  */
61293
61305
  propagate(e, t, g) {
61294
- for (; IA.foreachComponent(e, (I) => {
61295
- g(I);
61296
- }, !1), !!e.parent; )
61306
+ for (; ; ) {
61307
+ if (t.used)
61308
+ return;
61309
+ if (IA.foreachComponent(e, (I) => {
61310
+ g(I);
61311
+ }, !1), !e.parent)
61312
+ break;
61297
61313
  e = e.parent;
61314
+ }
61298
61315
  }
61299
61316
  /**
61300
61317
  * Propagate up in hiearchy and call handlers based on the pointer event data
@@ -89625,8 +89642,8 @@ const lh = class {
89625
89642
  const t = e.shape;
89626
89643
  switch (t.type) {
89627
89644
  case Ve.Ball: {
89628
- const o = t, s = A, C = o.radius !== s.radius, n = A.gameObject, a = Ng(n, this._tempPosition).multiplyScalar(s.radius);
89629
- o.radius = Math.abs(a.x), C && e.setShape(o);
89645
+ const o = t, s = A, C = A.gameObject, n = Ng(C, this._tempPosition), a = Math.abs(s.radius * n.x), B = o.radius !== a;
89646
+ o.radius = a, B && e.setShape(o);
89630
89647
  break;
89631
89648
  }
89632
89649
  case Ve.Cuboid: