@needle-tools/engine 3.7.1-alpha → 3.7.2-alpha
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 +4 -1
- package/dist/needle-engine.js +3 -3
- package/dist/needle-engine.light.js +3 -3
- package/dist/needle-engine.light.min.js +2 -2
- package/dist/needle-engine.light.umd.cjs +2 -2
- package/dist/needle-engine.min.js +2 -2
- package/dist/needle-engine.umd.cjs +2 -2
- package/lib/engine-components/SpectatorCamera.js +1 -1
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/package.json +1 -1
- package/src/engine-components/SpectatorCamera.ts +1 -1
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.7.2-alpha] - 2023-06-23
|
|
8
|
+
- Fix: Nullref in SpectatorCamera.onDestroy when camera wasnt active
|
|
9
|
+
|
|
7
10
|
## [3.7.1-alpha] - 2023-06-22
|
|
8
11
|
- Add: ChangeMaterialOnClick `fadeDuration` option (Quicklook only)
|
|
9
12
|
- Change: USDZ export now enforces progressive textures to be loaded before export
|
|
@@ -13,7 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
13
16
|
- Fix: USDZ ChangeMaterialOnClick clear cache before exporting, this caused USDZ export to fail on third export in USDZ sample scene
|
|
14
17
|
- Fix: Engine loading bar not being updated
|
|
15
18
|
- Fix: USDZ text linebreaks
|
|
16
|
-
- Fix: UI font name style check. Unknown font styles are now not touched anymore (e.g. `-Medium`
|
|
19
|
+
- Fix: UI font name style check. Unknown font styles are now not touched anymore (e.g. font name ending with `-Medium`)
|
|
17
20
|
|
|
18
21
|
## [3.7.0-alpha] - 2023-06-21
|
|
19
22
|
- Change: Move HTML elements into <needle-engine> shadow dom
|
package/dist/needle-engine.js
CHANGED
|
@@ -49058,7 +49058,7 @@ let bX = class extends Wi {
|
|
|
49058
49058
|
const ve = t.object.getWorldPosition(A.position);
|
|
49059
49059
|
q.copy(ve).sub(t.target), q.applyQuaternion(fA), C.setFromVector3(q), t.autoRotate && I === g.NONE && U(f()), t.enableDamping ? (C.theta += s.theta * t.dampingFactor, C.phi += s.phi * t.dampingFactor) : (C.theta += s.theta, C.phi += s.phi);
|
|
49060
49060
|
let Ue = t.minAzimuthAngle, V = t.maxAzimuthAngle;
|
|
49061
|
-
return isFinite(Ue) && isFinite(V) && (Ue < -Math.PI ? Ue += YA : Ue > Math.PI && (Ue -= YA), V < -Math.PI ? V += YA : V > Math.PI && (V -= YA), Ue <= V ? C.theta = Math.max(Ue, Math.min(V, C.theta)) : C.theta = C.theta > (Ue + V) / 2 ? Math.max(Ue, C.theta) : Math.min(V, C.theta)), C.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, C.phi)), C.makeSafe(), a = jg.lerp(a, n, t.
|
|
49061
|
+
return isFinite(Ue) && isFinite(V) && (Ue < -Math.PI ? Ue += YA : Ue > Math.PI && (Ue -= YA), V < -Math.PI ? V += YA : V > Math.PI && (V -= YA), Ue <= V ? C.theta = Math.max(Ue, Math.min(V, C.theta)) : C.theta = C.theta > (Ue + V) / 2 ? Math.max(Ue, C.theta) : Math.min(V, C.theta)), C.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, C.phi)), C.makeSafe(), t.enableDamping ? a = jg.lerp(a, n, t.dampingFactor) : a = n, C.radius *= a, C.radius = Math.max(t.minDistance, Math.min(t.maxDistance, C.radius)), t.enableDamping === !0 ? t.target.addScaledVector(B, t.dampingFactor) : t.target.add(B), q.setFromSpherical(C), q.applyQuaternion(XA), ve.copy(t.target).add(q), t.object.parent ? t.object.parent.worldToLocal(ve) : t.object.position.copy(ve), t.object.lookAt(t.target), t.enableDamping === !0 ? (s.theta *= 1 - t.dampingFactor, s.phi *= 1 - t.dampingFactor, B.multiplyScalar(1 - t.dampingFactor)) : (s.set(0, 0, 0), B.set(0, 0, 0)), n = 1, Q || HA.distanceToSquared(t.object.position) > o || 8 * (1 - WA.dot(t.object.quaternion)) > o ? (t.dispatchEvent(SK), HA.copy(t.object.position), WA.copy(t.object.quaternion), Q = !1, !0) : !1;
|
|
49062
49062
|
};
|
|
49063
49063
|
}(), this.dispose = function() {
|
|
49064
49064
|
t.domElement.removeEventListener("contextmenu", RA), t.domElement.removeEventListener("pointerdown", Ae), t.domElement.removeEventListener("pointercancel", Be), t.domElement.removeEventListener("wheel", Le), t.domElement.removeEventListener("pointermove", VA), t.domElement.removeEventListener("pointerup", Ee), t._domElementKeyEvents !== null && t._domElementKeyEvents.removeEventListener("keydown", v);
|
|
@@ -78027,8 +78027,8 @@ class cR extends mA {
|
|
|
78027
78027
|
!this._handler && this.cam && (this._handler = new hoA(this.context, this.cam, this)), this.eventSub_WebXRRequestStartEvent = this.onXRSessionRequestStart.bind(this), this.eventSub_WebXRStartEvent = this.onXRSessionStart.bind(this), this.eventSub_WebXREndEvent = this.onXRSessionEnded.bind(this), Ge.addEventListener(Jt.RequestVRSession, this.eventSub_WebXRRequestStartEvent), Ge.addEventListener(Jt.XRStarted, this.eventSub_WebXRStartEvent), Ge.addEventListener(Jt.XRStopped, this.eventSub_WebXREndEvent), this.orbit = AA.getComponent(this.context.mainCamera, Da);
|
|
78028
78028
|
}
|
|
78029
78029
|
onDestroy() {
|
|
78030
|
-
var e;
|
|
78031
|
-
this.stopSpectating(), Ge.removeEventListener(Jt.RequestVRSession, this.eventSub_WebXRStartEvent), Ge.removeEventListener(Jt.XRStarted, this.eventSub_WebXRStartEvent), Ge.removeEventListener(Jt.XRStopped, this.eventSub_WebXREndEvent), (e = this._handler) == null || e.destroy(), this._networking.destroy();
|
|
78030
|
+
var e, t;
|
|
78031
|
+
this.stopSpectating(), Ge.removeEventListener(Jt.RequestVRSession, this.eventSub_WebXRStartEvent), Ge.removeEventListener(Jt.XRStarted, this.eventSub_WebXRStartEvent), Ge.removeEventListener(Jt.XRStopped, this.eventSub_WebXREndEvent), (e = this._handler) == null || e.destroy(), (t = this._networking) == null || t.destroy();
|
|
78032
78032
|
}
|
|
78033
78033
|
isSupportedPlatform() {
|
|
78034
78034
|
const e = window.navigator.userAgent, t = /Windows|MacOS/.test(e), g = /Windows NT/.test(e) && /Edg/.test(e) && !/Win64/.test(e);
|
|
@@ -49058,7 +49058,7 @@ let dY = class extends Fn {
|
|
|
49058
49058
|
const Ft = i.object.getWorldPosition(e.position);
|
|
49059
49059
|
O.copy(Ft).sub(i.target), O.applyQuaternion(ve), a.setFromVector3(O), i.autoRotate && r === s.NONE && P(x()), i.enableDamping ? (a.theta += l.theta * i.dampingFactor, a.phi += l.phi * i.dampingFactor) : (a.theta += l.theta, a.phi += l.phi);
|
|
49060
49060
|
let Tt = i.minAzimuthAngle, j = i.maxAzimuthAngle;
|
|
49061
|
-
return isFinite(Tt) && isFinite(j) && (Tt < -Math.PI ? Tt += Ue : Tt > Math.PI && (Tt -= Ue), j < -Math.PI ? j += Ue : j > Math.PI && (j -= Ue), Tt <= j ? a.theta = Math.max(Tt, Math.min(j, a.theta)) : a.theta = a.theta > (Tt + j) / 2 ? Math.max(Tt, a.theta) : Math.min(j, a.theta)), a.phi = Math.max(i.minPolarAngle, Math.min(i.maxPolarAngle, a.phi)), a.makeSafe(), u = Fs.lerp(u, c, i.
|
|
49061
|
+
return isFinite(Tt) && isFinite(j) && (Tt < -Math.PI ? Tt += Ue : Tt > Math.PI && (Tt -= Ue), j < -Math.PI ? j += Ue : j > Math.PI && (j -= Ue), Tt <= j ? a.theta = Math.max(Tt, Math.min(j, a.theta)) : a.theta = a.theta > (Tt + j) / 2 ? Math.max(Tt, a.theta) : Math.min(j, a.theta)), a.phi = Math.max(i.minPolarAngle, Math.min(i.maxPolarAngle, a.phi)), a.makeSafe(), i.enableDamping ? u = Fs.lerp(u, c, i.dampingFactor) : u = c, a.radius *= u, a.radius = Math.max(i.minDistance, Math.min(i.maxDistance, a.radius)), i.enableDamping === !0 ? i.target.addScaledVector(d, i.dampingFactor) : i.target.add(d), O.setFromSpherical(a), O.applyQuaternion(Ke), Ft.copy(i.target).add(O), i.object.parent ? i.object.parent.worldToLocal(Ft) : i.object.position.copy(Ft), i.object.lookAt(i.target), i.enableDamping === !0 ? (l.theta *= 1 - i.dampingFactor, l.phi *= 1 - i.dampingFactor, d.multiplyScalar(1 - i.dampingFactor)) : (l.set(0, 0, 0), d.set(0, 0, 0)), c = 1, f || ze.distanceToSquared(i.object.position) > o || 8 * (1 - We.dot(i.object.quaternion)) > o ? (i.dispatchEvent(NR), ze.copy(i.object.position), We.copy(i.object.quaternion), f = !1, !0) : !1;
|
|
49062
49062
|
};
|
|
49063
49063
|
}(), this.dispose = function() {
|
|
49064
49064
|
i.domElement.removeEventListener("contextmenu", Ee), i.domElement.removeEventListener("pointerdown", Ze), i.domElement.removeEventListener("pointercancel", ht), i.domElement.removeEventListener("wheel", Lt), i.domElement.removeEventListener("pointermove", je), i.domElement.removeEventListener("pointerup", ft), i._domElementKeyEvents !== null && i._domElementKeyEvents.removeEventListener("keydown", U);
|
|
@@ -78027,8 +78027,8 @@ class eM extends Se {
|
|
|
78027
78027
|
!this._handler && this.cam && (this._handler = new Wse(this.context, this.cam, this)), this.eventSub_WebXRRequestStartEvent = this.onXRSessionRequestStart.bind(this), this.eventSub_WebXRStartEvent = this.onXRSessionStart.bind(this), this.eventSub_WebXREndEvent = this.onXRSessionEnded.bind(this), St.addEventListener(Mi.RequestVRSession, this.eventSub_WebXRRequestStartEvent), St.addEventListener(Mi.XRStarted, this.eventSub_WebXRStartEvent), St.addEventListener(Mi.XRStopped, this.eventSub_WebXREndEvent), this.orbit = Z.getComponent(this.context.mainCamera, Zc);
|
|
78028
78028
|
}
|
|
78029
78029
|
onDestroy() {
|
|
78030
|
-
var t;
|
|
78031
|
-
this.stopSpectating(), St.removeEventListener(Mi.RequestVRSession, this.eventSub_WebXRStartEvent), St.removeEventListener(Mi.XRStarted, this.eventSub_WebXRStartEvent), St.removeEventListener(Mi.XRStopped, this.eventSub_WebXREndEvent), (t = this._handler) == null || t.destroy(), this._networking.destroy();
|
|
78030
|
+
var t, i;
|
|
78031
|
+
this.stopSpectating(), St.removeEventListener(Mi.RequestVRSession, this.eventSub_WebXRStartEvent), St.removeEventListener(Mi.XRStarted, this.eventSub_WebXRStartEvent), St.removeEventListener(Mi.XRStopped, this.eventSub_WebXREndEvent), (t = this._handler) == null || t.destroy(), (i = this._networking) == null || i.destroy();
|
|
78032
78032
|
}
|
|
78033
78033
|
isSupportedPlatform() {
|
|
78034
78034
|
const t = window.navigator.userAgent, i = /Windows|MacOS/.test(t), s = /Windows NT/.test(t) && /Edg/.test(t) && !/Win64/.test(t);
|