@needle-tools/engine 3.6.0-alpha.1 → 3.6.0-alpha.2
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 -0
- package/dist/needle-engine.js +9 -9
- package/dist/needle-engine.light.js +9 -9
- 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/engine_context.js +2 -2
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine-components/Camera.js +0 -3
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/OrbitControls.js +7 -3
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/engine_context.ts +2 -2
- package/src/engine-components/Camera.ts +0 -4
- package/src/engine-components/OrbitControls.ts +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ 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.6.0-alpha.2] - 2023-05-27
|
|
8
|
+
- Fix: error in vite plugin when `meta.json` was missing
|
|
9
|
+
- Fix: three.js OrbitControls causing look direction to not work anymore due to forcing an update in the constructor
|
|
10
|
+
|
|
7
11
|
## [3.6.0-alpha] - 2023-05-27
|
|
8
12
|
- Add: Changing `src` attribute now does scene cleanup and loads new files
|
|
9
13
|
- Add: `skybox-image` and `environment-image` attributes, allow changing both at runtime
|
package/dist/needle-engine.js
CHANGED
|
@@ -38619,7 +38619,7 @@ class we {
|
|
|
38619
38619
|
return I = C, !0;
|
|
38620
38620
|
I = C;
|
|
38621
38621
|
}
|
|
38622
|
-
}), I ? this.setCurrentCamera(I) :
|
|
38622
|
+
}), I ? this.setCurrentCamera(I) : !wi.dispatchCallback(ao.MissingCamera, this) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
|
|
38623
38623
|
}
|
|
38624
38624
|
if (we.Current = this, vD(this), !this.isManagedExternally && this.composer && this.mainCamera) {
|
|
38625
38625
|
const I = new Sf(this.scene, this.mainCamera);
|
|
@@ -61873,6 +61873,9 @@ class ca extends mA {
|
|
|
61873
61873
|
r(this, "_camera", null);
|
|
61874
61874
|
r(this, "_syncedTransform");
|
|
61875
61875
|
r(this, "targetElement", null);
|
|
61876
|
+
r(this, "onControlsChangeStarted", () => {
|
|
61877
|
+
this._syncedTransform && this._syncedTransform.requestOwnership();
|
|
61878
|
+
});
|
|
61876
61879
|
r(this, "_shouldDisable", !1);
|
|
61877
61880
|
r(this, "_haveAttachedKeyboardEvents", !1);
|
|
61878
61881
|
}
|
|
@@ -61914,17 +61917,14 @@ class ca extends mA {
|
|
|
61914
61917
|
const t = e == null ? void 0 : e.cam;
|
|
61915
61918
|
if (t && RK(t, this, !0), !this._controls) {
|
|
61916
61919
|
console.assert(t != null, "Missing camera", this), t && (this._cameraObject = t);
|
|
61917
|
-
const g = this.targetElement ?? this.context.domElement;
|
|
61918
|
-
this._controls = new hX(t, g), fS === void 0 && (fS = { ...this._controls.keys });
|
|
61920
|
+
const g = this.targetElement ?? this.context.domElement, I = t == null ? void 0 : t.quaternion.clone();
|
|
61921
|
+
this._controls = new hX(t, g), t == null || t.quaternion.copy(I), fS === void 0 && (fS = { ...this._controls.keys });
|
|
61919
61922
|
}
|
|
61920
|
-
this._controls && (ou && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, kQ() && (this.doubleClickToFocus = !0)), this._controls.enableDamping = this.enableDamping, this._controls.keys = this.enableKeys ? fS : EeA, this._controls.autoRotate = this.autoRotate, this._controls.autoRotateSpeed = this.autoRotateSpeed, this._controls.enableZoom = this.enableZoom, this._controls.addEventListener("start", this.onControlsChangeStarted
|
|
61923
|
+
this._controls && (ou && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, kQ() && (this.doubleClickToFocus = !0)), this._controls.enableDamping = this.enableDamping, this._controls.keys = this.enableKeys ? fS : EeA, this._controls.autoRotate = this.autoRotate, this._controls.autoRotateSpeed = this.autoRotateSpeed, this._controls.enableZoom = this.enableZoom, this._controls.addEventListener("start", this.onControlsChangeStarted), (t == null ? void 0 : t.type) === "PerspectiveCamera" ? ou || (this._controls.minDistance = this.minZoom, this._controls.maxDistance = this.maxZoom) : ou || (this._controls.minZoom = this.minZoom, this._controls.maxZoom = this.maxZoom), this._controls.dampingFactor = this.dampingFactor, this._controls.enablePan = this.enablePan, this._startedListeningToKeyEvents || (this._startedListeningToKeyEvents = !0, this._controls.listenToKeyEvents(window.document.body))), this._syncedTransform = eA.getComponent(this.gameObject, Dr) ?? void 0;
|
|
61921
61924
|
}
|
|
61922
61925
|
onDisable() {
|
|
61923
61926
|
var e;
|
|
61924
|
-
(e = this._camera) != null && e.cam && RK(this._camera.cam, this, !1), this._controls && (this._controls.enabled = !1, this._controls.autoRotate = !1);
|
|
61925
|
-
}
|
|
61926
|
-
onControlsChangeStarted() {
|
|
61927
|
-
this._syncedTransform && this._syncedTransform.requestOwnership();
|
|
61927
|
+
(e = this._camera) != null && e.cam && RK(this._camera.cam, this, !1), this._controls && (this._controls.enabled = !1, this._controls.autoRotate = !1, this._controls.removeEventListener("start", this.onControlsChangeStarted));
|
|
61928
61928
|
}
|
|
61929
61929
|
afterHandleInput(e) {
|
|
61930
61930
|
e.detail.args.pointerId === 0 && (e.detail.args.isDown ? this._controls && this._eventSystem && (this._shouldDisable = this._eventSystem.hasActiveUI) : (!e.detail.args.isPressed || e.detail.args.isUp) && (this._shouldDisable = !1));
|
|
@@ -62141,7 +62141,7 @@ const Ec = (Su = class extends mA {
|
|
|
62141
62141
|
return o.sub(C), o.normalize(), t ? (t.set(C, o), t) : new Ps(C.clone(), o.clone());
|
|
62142
62142
|
}
|
|
62143
62143
|
awake() {
|
|
62144
|
-
|
|
62144
|
+
FK && window.addEventListener("pointerdown", (A) => {
|
|
62145
62145
|
const e = A.clientX, t = A.clientY;
|
|
62146
62146
|
console.log("touch", e.toFixed(2), t.toFixed(2));
|
|
62147
62147
|
const g = this.screenPointToRay(e, t), I = "#" + Math.floor(Math.random() * 16777215).toString(16);
|
|
@@ -38619,7 +38619,7 @@ class xt {
|
|
|
38619
38619
|
return r = a, !0;
|
|
38620
38620
|
r = a;
|
|
38621
38621
|
}
|
|
38622
|
-
}), r ? this.setCurrentCamera(r) :
|
|
38622
|
+
}), r ? this.setCurrentCamera(r) : !En.dispatchCallback(Mo.MissingCamera, this) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
|
|
38623
38623
|
}
|
|
38624
38624
|
if (xt.Current = this, Ky(this), !this.isManagedExternally && this.composer && this.mainCamera) {
|
|
38625
38625
|
const r = new E_(this.scene, this.mainCamera);
|
|
@@ -61873,6 +61873,9 @@ class Wl extends Se {
|
|
|
61873
61873
|
u(this, "_camera", null);
|
|
61874
61874
|
u(this, "_syncedTransform");
|
|
61875
61875
|
u(this, "targetElement", null);
|
|
61876
|
+
u(this, "onControlsChangeStarted", () => {
|
|
61877
|
+
this._syncedTransform && this._syncedTransform.requestOwnership();
|
|
61878
|
+
});
|
|
61876
61879
|
u(this, "_shouldDisable", !1);
|
|
61877
61880
|
u(this, "_haveAttachedKeyboardEvents", !1);
|
|
61878
61881
|
}
|
|
@@ -61914,17 +61917,14 @@ class Wl extends Se {
|
|
|
61914
61917
|
const i = t == null ? void 0 : t.cam;
|
|
61915
61918
|
if (i && VR(i, this, !0), !this._controls) {
|
|
61916
61919
|
console.assert(i != null, "Missing camera", this), i && (this._cameraObject = i);
|
|
61917
|
-
const s = this.targetElement ?? this.context.domElement;
|
|
61918
|
-
this._controls = new jX(i, s), nw === void 0 && (nw = { ...this._controls.keys });
|
|
61920
|
+
const s = this.targetElement ?? this.context.domElement, r = i == null ? void 0 : i.quaternion.clone();
|
|
61921
|
+
this._controls = new jX(i, s), i == null || i.quaternion.copy(r), nw === void 0 && (nw = { ...this._controls.keys });
|
|
61919
61922
|
}
|
|
61920
|
-
this._controls && (wv && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, $d() && (this.doubleClickToFocus = !0)), this._controls.enableDamping = this.enableDamping, this._controls.keys = this.enableKeys ? nw : H$, this._controls.autoRotate = this.autoRotate, this._controls.autoRotateSpeed = this.autoRotateSpeed, this._controls.enableZoom = this.enableZoom, this._controls.addEventListener("start", this.onControlsChangeStarted
|
|
61923
|
+
this._controls && (wv && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, $d() && (this.doubleClickToFocus = !0)), this._controls.enableDamping = this.enableDamping, this._controls.keys = this.enableKeys ? nw : H$, this._controls.autoRotate = this.autoRotate, this._controls.autoRotateSpeed = this.autoRotateSpeed, this._controls.enableZoom = this.enableZoom, this._controls.addEventListener("start", this.onControlsChangeStarted), (i == null ? void 0 : i.type) === "PerspectiveCamera" ? wv || (this._controls.minDistance = this.minZoom, this._controls.maxDistance = this.maxZoom) : wv || (this._controls.minZoom = this.minZoom, this._controls.maxZoom = this.maxZoom), this._controls.dampingFactor = this.dampingFactor, this._controls.enablePan = this.enablePan, this._startedListeningToKeyEvents || (this._startedListeningToKeyEvents = !0, this._controls.listenToKeyEvents(window.document.body))), this._syncedTransform = $.getComponent(this.gameObject, Jh) ?? void 0;
|
|
61921
61924
|
}
|
|
61922
61925
|
onDisable() {
|
|
61923
61926
|
var t;
|
|
61924
|
-
(t = this._camera) != null && t.cam && VR(this._camera.cam, this, !1), this._controls && (this._controls.enabled = !1, this._controls.autoRotate = !1);
|
|
61925
|
-
}
|
|
61926
|
-
onControlsChangeStarted() {
|
|
61927
|
-
this._syncedTransform && this._syncedTransform.requestOwnership();
|
|
61927
|
+
(t = this._camera) != null && t.cam && VR(this._camera.cam, this, !1), this._controls && (this._controls.enabled = !1, this._controls.autoRotate = !1, this._controls.removeEventListener("start", this.onControlsChangeStarted));
|
|
61928
61928
|
}
|
|
61929
61929
|
afterHandleInput(t) {
|
|
61930
61930
|
t.detail.args.pointerId === 0 && (t.detail.args.isDown ? this._controls && this._eventSystem && (this._shouldDisable = this._eventSystem.hasActiveUI) : (!t.detail.args.isPressed || t.detail.args.isUp) && (this._shouldDisable = !1));
|
|
@@ -62141,7 +62141,7 @@ const Up = (Qv = class extends Se {
|
|
|
62141
62141
|
return o.sub(a), o.normalize(), i ? (i.set(a, o), i) : new Mc(a.clone(), o.clone());
|
|
62142
62142
|
}
|
|
62143
62143
|
awake() {
|
|
62144
|
-
|
|
62144
|
+
WR && window.addEventListener("pointerdown", (e) => {
|
|
62145
62145
|
const t = e.clientX, i = e.clientY;
|
|
62146
62146
|
console.log("touch", t.toFixed(2), i.toFixed(2));
|
|
62147
62147
|
const s = this.screenPointToRay(t, i), r = "#" + Math.floor(Math.random() * 16777215).toString(16);
|