@needle-tools/engine 3.28.3-beta → 3.28.5-beta
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 +3 -0
- package/dist/needle-engine.js +20 -26
- package/dist/needle-engine.light.js +20 -26
- package/dist/needle-engine.light.min.js +1 -1
- package/dist/needle-engine.light.umd.cjs +1 -1
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine-components/ui/EventSystem.js +31 -37
- package/lib/engine-components/ui/EventSystem.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/codegen/register_types.ts +2 -2
- package/src/engine-components/ui/EventSystem.ts +35 -37
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ 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.28.5-beta] - 2023-12-22
|
|
8
|
+
- Fix: WebXRController falsely triggering click in EventSystem
|
|
9
|
+
|
|
7
10
|
## [3.28.3-beta] - 2023-12-21
|
|
8
11
|
- Fix: Issue in pointer events not triggering onPointerEnter and Exit in VR
|
|
9
12
|
- Remove: warning log in USDZ export about double sided materials not being supported
|
package/dist/needle-engine.js
CHANGED
|
@@ -61912,18 +61912,15 @@ const vs = class extends NA {
|
|
|
61912
61912
|
if (e.set(g, null), s)
|
|
61913
61913
|
for (const C of this.pressedByID.keys()) {
|
|
61914
61914
|
const a = this.pressedByID[C];
|
|
61915
|
-
a.obj === s && a.handler && ((n = a.handler.onPointerUp) == null || n.call(a.handler, o), this.pressedByID.delete(C));
|
|
61915
|
+
a && a.obj === s && a.handler && ((n = a.handler.onPointerUp) == null || n.call(a.handler, o), this.pressedByID.delete(C));
|
|
61916
61916
|
}
|
|
61917
61917
|
});
|
|
61918
61918
|
const t = new Yo();
|
|
61919
61919
|
this._selectUpdateFn ?? (this._selectUpdateFn = (g) => {
|
|
61920
61920
|
var s;
|
|
61921
61921
|
t.ray = g.getRay();
|
|
61922
|
-
const I = this.performRaycast(t);
|
|
61923
|
-
|
|
61924
|
-
return;
|
|
61925
|
-
const o = new ia(this.context.input);
|
|
61926
|
-
o.inputSource = g, o.pointerId = ((s = g.input) == null ? void 0 : s.handedness) === "right" ? 0 : 1, o.isDown = g.selectionDown, o.isUp = g.selectionUp, o.isPressed = g.selectionPressed, o.isClicked = g.selectionClick, this.handleIntersections(I, o);
|
|
61922
|
+
const I = this.performRaycast(t) ?? [], o = new ia(this.context.input);
|
|
61923
|
+
o.inputSource = g, o.pointerId = ((s = g.input) == null ? void 0 : s.handedness) === "right" ? 0 : 1, o.isDown = g.selectionDown, o.isUp = g.selectionUp, o.isPressed = g.selectionPressed, o.isClicked = !1, this.handleIntersections(o.pointerId, I, o);
|
|
61927
61924
|
}), ui.addEventListener(XC.SelectStart, this._selectStartFn), ui.addEventListener(XC.SelectEnd, this._selectEndFn), ui.addEventListener(XC.Update, this._selectUpdateFn), this._handleInputFn = this.onPointerEvent.bind(this), this.context.input.addEventListener(Ni.PointerDown, this._handleInputFn), this.context.input.addEventListener(Ni.PointerUp, this._handleInputFn), this.context.input.addEventListener(Ni.PointerMove, this._handleInputFn);
|
|
61928
61925
|
}
|
|
61929
61926
|
onDisable() {
|
|
@@ -61951,17 +61948,7 @@ const vs = class extends NA {
|
|
|
61951
61948
|
args: g,
|
|
61952
61949
|
hasActiveUI: this.currentActiveMeshUIComponents.length > 0
|
|
61953
61950
|
};
|
|
61954
|
-
|
|
61955
|
-
const n = this.hoveredByID.get(t);
|
|
61956
|
-
if (n && this.triggerOnExit(n.obj, n.data), this.hoveredByID.delete(t), g.isUp) {
|
|
61957
|
-
const C = this.pressedByID.get(t);
|
|
61958
|
-
C == null || C.handlers.forEach((a) => {
|
|
61959
|
-
var B;
|
|
61960
|
-
return (B = a.onPointerUp) == null ? void 0 : B.call(a, g);
|
|
61961
|
-
}), this.pressedByID.delete(t);
|
|
61962
|
-
}
|
|
61963
|
-
}
|
|
61964
|
-
this.dispatchEvent(new CustomEvent("AfterHandleInput", { detail: s }));
|
|
61951
|
+
this.dispatchEvent(new CustomEvent("BeforeHandleInput", { detail: s })), this.handleIntersections(t, o, g), this.dispatchEvent(new CustomEvent("AfterHandleInput", { detail: s }));
|
|
61965
61952
|
}
|
|
61966
61953
|
/** the raycast filter is always overriden */
|
|
61967
61954
|
performRaycast(e) {
|
|
@@ -61976,15 +61963,22 @@ const vs = class extends NA {
|
|
|
61976
61963
|
}
|
|
61977
61964
|
return this._sortedHits.sort((t, g) => t.distance - g.distance), this._sortedHits;
|
|
61978
61965
|
}
|
|
61979
|
-
|
|
61980
|
-
|
|
61981
|
-
|
|
61982
|
-
|
|
61983
|
-
|
|
61984
|
-
|
|
61985
|
-
|
|
61986
|
-
|
|
61987
|
-
|
|
61966
|
+
handleIntersections(e, t, g) {
|
|
61967
|
+
if (t != null && t.length) {
|
|
61968
|
+
t = this.sortCandidates(t);
|
|
61969
|
+
for (const o of t) {
|
|
61970
|
+
const { object: s } = o;
|
|
61971
|
+
if (g.point = o.point, g.normal = o.normal, g.face = o.face, g.distance = o.distance, g.instanceId = o.instanceId, this.handleEventOnObject(s, g))
|
|
61972
|
+
return !0;
|
|
61973
|
+
}
|
|
61974
|
+
}
|
|
61975
|
+
const I = this.hoveredByID.get(e);
|
|
61976
|
+
if (I && this.triggerOnExit(I.obj, I.data), this.hoveredByID.delete(e), g.isUp) {
|
|
61977
|
+
const o = this.pressedByID.get(e);
|
|
61978
|
+
o == null || o.handlers.forEach((s) => {
|
|
61979
|
+
var n;
|
|
61980
|
+
return (n = s.onPointerUp) == null ? void 0 : n.call(s, g);
|
|
61981
|
+
}), this.pressedByID.delete(e);
|
|
61988
61982
|
}
|
|
61989
61983
|
return !1;
|
|
61990
61984
|
}
|
|
@@ -61912,18 +61912,15 @@ const Sa = class extends Ie {
|
|
|
61912
61912
|
if (t.set(s, null), a)
|
|
61913
61913
|
for (const l of this.pressedByID.keys()) {
|
|
61914
61914
|
const u = this.pressedByID[l];
|
|
61915
|
-
u.obj === a && u.handler && ((c = u.handler.onPointerUp) == null || c.call(u.handler, o), this.pressedByID.delete(l));
|
|
61915
|
+
u && u.obj === a && u.handler && ((c = u.handler.onPointerUp) == null || c.call(u.handler, o), this.pressedByID.delete(l));
|
|
61916
61916
|
}
|
|
61917
61917
|
});
|
|
61918
61918
|
const i = new Ro();
|
|
61919
61919
|
this._selectUpdateFn ?? (this._selectUpdateFn = (s) => {
|
|
61920
61920
|
var a;
|
|
61921
61921
|
i.ray = s.getRay();
|
|
61922
|
-
const r = this.performRaycast(i);
|
|
61923
|
-
|
|
61924
|
-
return;
|
|
61925
|
-
const o = new Ul(this.context.input);
|
|
61926
|
-
o.inputSource = s, o.pointerId = ((a = s.input) == null ? void 0 : a.handedness) === "right" ? 0 : 1, o.isDown = s.selectionDown, o.isUp = s.selectionUp, o.isPressed = s.selectionPressed, o.isClicked = s.selectionClick, this.handleIntersections(r, o);
|
|
61922
|
+
const r = this.performRaycast(i) ?? [], o = new Ul(this.context.input);
|
|
61923
|
+
o.inputSource = s, o.pointerId = ((a = s.input) == null ? void 0 : a.handedness) === "right" ? 0 : 1, o.isDown = s.selectionDown, o.isUp = s.selectionUp, o.isPressed = s.selectionPressed, o.isClicked = !1, this.handleIntersections(o.pointerId, r, o);
|
|
61927
61924
|
}), un.addEventListener(Dl.SelectStart, this._selectStartFn), un.addEventListener(Dl.SelectEnd, this._selectEndFn), un.addEventListener(Dl.Update, this._selectUpdateFn), this._handleInputFn = this.onPointerEvent.bind(this), this.context.input.addEventListener(wn.PointerDown, this._handleInputFn), this.context.input.addEventListener(wn.PointerUp, this._handleInputFn), this.context.input.addEventListener(wn.PointerMove, this._handleInputFn);
|
|
61928
61925
|
}
|
|
61929
61926
|
onDisable() {
|
|
@@ -61951,17 +61948,7 @@ const Sa = class extends Ie {
|
|
|
61951
61948
|
args: s,
|
|
61952
61949
|
hasActiveUI: this.currentActiveMeshUIComponents.length > 0
|
|
61953
61950
|
};
|
|
61954
|
-
|
|
61955
|
-
const c = this.hoveredByID.get(i);
|
|
61956
|
-
if (c && this.triggerOnExit(c.obj, c.data), this.hoveredByID.delete(i), s.isUp) {
|
|
61957
|
-
const l = this.pressedByID.get(i);
|
|
61958
|
-
l == null || l.handlers.forEach((u) => {
|
|
61959
|
-
var d;
|
|
61960
|
-
return (d = u.onPointerUp) == null ? void 0 : d.call(u, s);
|
|
61961
|
-
}), this.pressedByID.delete(i);
|
|
61962
|
-
}
|
|
61963
|
-
}
|
|
61964
|
-
this.dispatchEvent(new CustomEvent("AfterHandleInput", { detail: a }));
|
|
61951
|
+
this.dispatchEvent(new CustomEvent("BeforeHandleInput", { detail: a })), this.handleIntersections(i, o, s), this.dispatchEvent(new CustomEvent("AfterHandleInput", { detail: a }));
|
|
61965
61952
|
}
|
|
61966
61953
|
/** the raycast filter is always overriden */
|
|
61967
61954
|
performRaycast(t) {
|
|
@@ -61976,15 +61963,22 @@ const Sa = class extends Ie {
|
|
|
61976
61963
|
}
|
|
61977
61964
|
return this._sortedHits.sort((i, s) => i.distance - s.distance), this._sortedHits;
|
|
61978
61965
|
}
|
|
61979
|
-
|
|
61980
|
-
|
|
61981
|
-
|
|
61982
|
-
|
|
61983
|
-
|
|
61984
|
-
|
|
61985
|
-
|
|
61986
|
-
|
|
61987
|
-
|
|
61966
|
+
handleIntersections(t, i, s) {
|
|
61967
|
+
if (i != null && i.length) {
|
|
61968
|
+
i = this.sortCandidates(i);
|
|
61969
|
+
for (const o of i) {
|
|
61970
|
+
const { object: a } = o;
|
|
61971
|
+
if (s.point = o.point, s.normal = o.normal, s.face = o.face, s.distance = o.distance, s.instanceId = o.instanceId, this.handleEventOnObject(a, s))
|
|
61972
|
+
return !0;
|
|
61973
|
+
}
|
|
61974
|
+
}
|
|
61975
|
+
const r = this.hoveredByID.get(t);
|
|
61976
|
+
if (r && this.triggerOnExit(r.obj, r.data), this.hoveredByID.delete(t), s.isUp) {
|
|
61977
|
+
const o = this.pressedByID.get(t);
|
|
61978
|
+
o == null || o.handlers.forEach((a) => {
|
|
61979
|
+
var c;
|
|
61980
|
+
return (c = a.onPointerUp) == null ? void 0 : c.call(a, s);
|
|
61981
|
+
}), this.pressedByID.delete(t);
|
|
61988
61982
|
}
|
|
61989
61983
|
return !1;
|
|
61990
61984
|
}
|