@needle-tools/engine 3.26.1-beta → 3.26.2-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 +118 -102
- package/dist/needle-engine.light.js +80 -64
- package/dist/needle-engine.light.min.js +24 -24
- package/dist/needle-engine.light.umd.cjs +24 -24
- package/dist/needle-engine.min.js +104 -104
- package/dist/needle-engine.umd.cjs +134 -134
- package/lib/engine/engine_context.d.ts +1 -0
- package/lib/engine/engine_context.js +9 -8
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_physics_rapier.js +7 -0
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine-components/OrbitControls.js +11 -0
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/codegen/register_types.ts +2 -2
- package/src/engine/engine_context.ts +11 -8
- package/src/engine/engine_physics_rapier.ts +8 -0
- package/src/engine-components/OrbitControls.ts +11 -0
|
@@ -13335,15 +13335,15 @@ class eh {
|
|
|
13335
13335
|
let De = xe.get(le);
|
|
13336
13336
|
if (De !== void 0) {
|
|
13337
13337
|
if (U.currentProgram === De && U.lightsStateVersion === pe)
|
|
13338
|
-
return
|
|
13338
|
+
return jt(S, ye), De;
|
|
13339
13339
|
} else
|
|
13340
13340
|
ye.uniforms = he.getUniforms(S), S.onBuild(F, ye, y), S.onBeforeCompile(ye, y), De = he.acquireProgram(ye, le), xe.set(le, De), U.uniforms = ye.uniforms;
|
|
13341
13341
|
const Oe = U.uniforms;
|
|
13342
|
-
(!S.isShaderMaterial && !S.isRawShaderMaterial || S.clipping === !0) && (Oe.clippingPlanes = q.uniform),
|
|
13342
|
+
(!S.isShaderMaterial && !S.isRawShaderMaterial || S.clipping === !0) && (Oe.clippingPlanes = q.uniform), jt(S, ye), U.needsLights = P(S), U.lightsStateVersion = pe, U.needsLights && (Oe.ambientLightColor.value = Q.state.ambient, Oe.lightProbe.value = Q.state.probe, Oe.directionalLights.value = Q.state.directional, Oe.directionalLightShadows.value = Q.state.directionalShadow, Oe.spotLights.value = Q.state.spot, Oe.spotLightShadows.value = Q.state.spotShadow, Oe.rectAreaLights.value = Q.state.rectArea, Oe.ltc_1.value = Q.state.rectAreaLTC1, Oe.ltc_2.value = Q.state.rectAreaLTC2, Oe.pointLights.value = Q.state.point, Oe.pointLightShadows.value = Q.state.pointShadow, Oe.hemisphereLights.value = Q.state.hemi, Oe.directionalShadowMap.value = Q.state.directionalShadowMap, Oe.directionalShadowMatrix.value = Q.state.directionalShadowMatrix, Oe.spotShadowMap.value = Q.state.spotShadowMap, Oe.spotLightMatrix.value = Q.state.spotLightMatrix, Oe.spotLightMap.value = Q.state.spotLightMap, Oe.pointShadowMap.value = Q.state.pointShadowMap, Oe.pointShadowMatrix.value = Q.state.pointShadowMatrix);
|
|
13343
13343
|
const Ze = De.getUniforms(), dt = Oy.seqWithValue(Ze.seq, Oe);
|
|
13344
13344
|
return U.currentProgram = De, U.uniformsList = dt, De;
|
|
13345
13345
|
}
|
|
13346
|
-
function
|
|
13346
|
+
function jt(S, B) {
|
|
13347
13347
|
const F = qe.get(S);
|
|
13348
13348
|
F.outputColorSpace = B.outputColorSpace, F.instancing = B.instancing, F.skinning = B.skinning, F.morphTargets = B.morphTargets, F.morphNormals = B.morphNormals, F.morphColors = B.morphColors, F.morphTargetsCount = B.morphTargetsCount, F.numClippingPlanes = B.numClippingPlanes, F.numIntersection = B.numClipIntersection, F.vertexAlphas = B.vertexAlphas, F.vertexTangents = B.vertexTangents, F.toneMapping = B.toneMapping;
|
|
13349
13349
|
}
|
|
@@ -21632,7 +21632,7 @@ function K8(n) {
|
|
|
21632
21632
|
Cn(n, ia.Error);
|
|
21633
21633
|
}
|
|
21634
21634
|
let VC;
|
|
21635
|
-
function
|
|
21635
|
+
function Wt() {
|
|
21636
21636
|
return VC !== void 0 ? VC : _r();
|
|
21637
21637
|
}
|
|
21638
21638
|
function Ple(n) {
|
|
@@ -28647,7 +28647,7 @@ class a9 {
|
|
|
28647
28647
|
this.handleIncomingStringMessage(s);
|
|
28648
28648
|
return;
|
|
28649
28649
|
} catch (s) {
|
|
28650
|
-
lr && i === "pong" ? console.log("<<", i) :
|
|
28650
|
+
lr && i === "pong" ? console.log("<<", i) : Wt() && console.error("Failed to parse message", s);
|
|
28651
28651
|
}
|
|
28652
28652
|
}
|
|
28653
28653
|
async handleIncomingBinaryMessage(e) {
|
|
@@ -30869,7 +30869,7 @@ function D0(n) {
|
|
|
30869
30869
|
try {
|
|
30870
30870
|
const t = Fi[e];
|
|
30871
30871
|
if (t.isComponent !== !0) {
|
|
30872
|
-
(
|
|
30872
|
+
(Wt() || uE) && console.error(`Registered script is not a Needle Engine component.
|
|
30873
30873
|
The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
|
|
30874
30874
|
`, t), Fi.splice(e, 1), e--;
|
|
30875
30875
|
continue;
|
|
@@ -30955,7 +30955,7 @@ function Wy(n) {
|
|
|
30955
30955
|
return;
|
|
30956
30956
|
}
|
|
30957
30957
|
const e = iA(n);
|
|
30958
|
-
jF(n, e, !0) || (uE ||
|
|
30958
|
+
jF(n, e, !0) || (uE || Wt() ? console.error(`Error updating hierarchy
|
|
30959
30959
|
Do you have circular references in your project? <a target="_blank" href="https://docs.needle.tools/circular-reference"> Click here for more information.`, n) : console.error('Failed to update active state in hierarchy of "' + n.name + '"', n), console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."));
|
|
30960
30960
|
}
|
|
30961
30961
|
function jF(n, e, t, i = 0) {
|
|
@@ -41000,33 +41000,33 @@ class L0 extends rM {
|
|
|
41000
41000
|
}
|
|
41001
41001
|
return Q.bytesPerLine = Q.width * Q.inputSize * Q.channels, Q.outputChannels == 4 ? (Q.format = _i, Q.colorSpace = mn) : (Q.format = Cc, Q.colorSpace = Ar), Q;
|
|
41002
41002
|
}
|
|
41003
|
-
const Vu = new DataView(e), Qu = new Uint8Array(e), ol = { value: 0 }, fa = VA(Vu, e, ol),
|
|
41004
|
-
for (let P = 0; P <
|
|
41003
|
+
const Vu = new DataView(e), Qu = new Uint8Array(e), ol = { value: 0 }, fa = VA(Vu, e, ol), jt = QA(fa, Vu, Qu, ol, this.type), WA = { value: 0 }, Bx = { R: 0, G: 1, B: 2, A: 3, Y: 0 };
|
|
41004
|
+
for (let P = 0; P < jt.height / jt.scanlineBlockSize; P++) {
|
|
41005
41005
|
const S = Ve(Vu, ol);
|
|
41006
|
-
|
|
41007
|
-
const F =
|
|
41008
|
-
ol.value +=
|
|
41009
|
-
for (let U = 0; U <
|
|
41010
|
-
const Q = U + P *
|
|
41011
|
-
if (Q >=
|
|
41006
|
+
jt.size = Ve(Vu, ol), jt.lines = S + jt.scanlineBlockSize > jt.height ? jt.height - S : jt.scanlineBlockSize;
|
|
41007
|
+
const F = jt.size < jt.lines * jt.bytesPerLine ? jt.uncompress(jt) : z(jt);
|
|
41008
|
+
ol.value += jt.size;
|
|
41009
|
+
for (let U = 0; U < jt.scanlineBlockSize; U++) {
|
|
41010
|
+
const Q = U + P * jt.scanlineBlockSize;
|
|
41011
|
+
if (Q >= jt.height)
|
|
41012
41012
|
break;
|
|
41013
|
-
for (let oe = 0; oe <
|
|
41013
|
+
for (let oe = 0; oe < jt.channels; oe++) {
|
|
41014
41014
|
const pe = Bx[fa.channels[oe].name];
|
|
41015
|
-
for (let ye = 0; ye <
|
|
41016
|
-
WA.value = (U * (
|
|
41017
|
-
const le = (
|
|
41018
|
-
|
|
41015
|
+
for (let ye = 0; ye < jt.width; ye++) {
|
|
41016
|
+
WA.value = (U * (jt.channels * jt.width) + oe * jt.width + ye) * jt.inputSize;
|
|
41017
|
+
const le = (jt.height - 1 - Q) * (jt.width * jt.outputChannels) + ye * jt.outputChannels + pe;
|
|
41018
|
+
jt.byteArray[le] = jt.getter(F, WA);
|
|
41019
41019
|
}
|
|
41020
41020
|
}
|
|
41021
41021
|
}
|
|
41022
41022
|
}
|
|
41023
41023
|
return {
|
|
41024
41024
|
header: fa,
|
|
41025
|
-
width:
|
|
41026
|
-
height:
|
|
41027
|
-
data:
|
|
41028
|
-
format:
|
|
41029
|
-
colorSpace:
|
|
41025
|
+
width: jt.width,
|
|
41026
|
+
height: jt.height,
|
|
41027
|
+
data: jt.byteArray,
|
|
41028
|
+
format: jt.format,
|
|
41029
|
+
colorSpace: jt.colorSpace,
|
|
41030
41030
|
type: this.type
|
|
41031
41031
|
};
|
|
41032
41032
|
}
|
|
@@ -41245,7 +41245,7 @@ class sY {
|
|
|
41245
41245
|
u && a.push(u);
|
|
41246
41246
|
}
|
|
41247
41247
|
const c = await vM(a);
|
|
41248
|
-
c != null && c.anyFailed &&
|
|
41248
|
+
c != null && c.anyFailed && Wt() && console.error("Failed to load lightmap extension", c), r();
|
|
41249
41249
|
})) : null;
|
|
41250
41250
|
}
|
|
41251
41251
|
}
|
|
@@ -41419,7 +41419,7 @@ function YM(n, e) {
|
|
|
41419
41419
|
if (!n)
|
|
41420
41420
|
return;
|
|
41421
41421
|
if (!n.isComponent) {
|
|
41422
|
-
(
|
|
41422
|
+
(Wt() || xl) && console.error(`Registered script is not a Needle Engine component.
|
|
41423
41423
|
The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
|
|
41424
41424
|
`, n);
|
|
41425
41425
|
return;
|
|
@@ -41521,6 +41521,7 @@ const Yi = class {
|
|
|
41521
41521
|
h(this, "_renderTarget");
|
|
41522
41522
|
h(this, "_isRendering", !1);
|
|
41523
41523
|
h(this, "_createId", 0);
|
|
41524
|
+
h(this, "_renderlooperrors", 0);
|
|
41524
41525
|
h(this, "_lastTimestamp", 0);
|
|
41525
41526
|
h(this, "_accumulatedTime", 0);
|
|
41526
41527
|
h(this, "_dispatchReadyAfterFrame", !1);
|
|
@@ -41651,7 +41652,7 @@ const Yi = class {
|
|
|
41651
41652
|
const r = (s = (i = this.domElement) == null ? void 0 : i.shadowRoot) == null ? void 0 : s.querySelector("canvas");
|
|
41652
41653
|
r && (e.canvas = r);
|
|
41653
41654
|
}
|
|
41654
|
-
this.renderer = new eh(e), this.renderer.debug.checkShaderErrors =
|
|
41655
|
+
this.renderer = new eh(e), this.renderer.debug.checkShaderErrors = Wt() || re("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Ks, this.renderer.setClearColor(new be("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = A1, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = nt, this.renderer.useLegacyLights = !1;
|
|
41655
41656
|
}
|
|
41656
41657
|
internalOnUpdateVisible() {
|
|
41657
41658
|
var e, t;
|
|
@@ -41904,11 +41905,11 @@ const Yi = class {
|
|
|
41904
41905
|
}
|
|
41905
41906
|
/** Performs a full update step including script callbacks, rendering (unless isManagedExternally is set to false) and post render callbacks */
|
|
41906
41907
|
update(e, t) {
|
|
41907
|
-
if (t === void 0 && (t = null),
|
|
41908
|
+
if (t === void 0 && (t = null), Wt() || xl || y6())
|
|
41908
41909
|
try {
|
|
41909
|
-
this.internalStep(e, t);
|
|
41910
|
+
this.internalStep(e, t), this._renderlooperrors = 0;
|
|
41910
41911
|
} catch (i) {
|
|
41911
|
-
(
|
|
41912
|
+
this._renderlooperrors += 1, (Wt() || xl) && (i instanceof Error || i instanceof TypeError) && Cn("Caught unhandled exception during render-loop.<br/>Stopping renderloop...<br/>See console for details.", ia.Error), console.error(i), this._renderlooperrors > 10 && (console.warn("Stopping render loop due to error"), this.renderer.setAnimationLoop(null)), this.domElement.dispatchEvent(new CustomEvent("error", { detail: i }));
|
|
41912
41913
|
}
|
|
41913
41914
|
else
|
|
41914
41915
|
this.internalStep(e, t);
|
|
@@ -42515,7 +42516,7 @@ let Mu = (nn = class {
|
|
|
42515
42516
|
}
|
|
42516
42517
|
/** @internal */
|
|
42517
42518
|
__internalEnable(e) {
|
|
42518
|
-
return this.__destroyed ? (
|
|
42519
|
+
return this.__destroyed ? (Wt() && console.warn("[Needle Engine Dev] Trying to enable destroyed component"), !1) : this.__didAwake ? this.__didEnable ? (e !== !0 && (this.__isEnabled = !0), !1) : (this.__didEnable = !0, this.__isEnabled = !0, this.onEnable(), !0) : !1;
|
|
42519
42520
|
}
|
|
42520
42521
|
/** @internal */
|
|
42521
42522
|
__internalDisable(e) {
|
|
@@ -42537,7 +42538,7 @@ let Mu = (nn = class {
|
|
|
42537
42538
|
}
|
|
42538
42539
|
set enabled(e) {
|
|
42539
42540
|
if (this.__destroyed) {
|
|
42540
|
-
|
|
42541
|
+
Wt() && console.warn(`[Needle Engine Dev] Trying to ${e ? "enable" : "disable"} destroyed component`);
|
|
42541
42542
|
return;
|
|
42542
42543
|
}
|
|
42543
42544
|
if (typeof e == "number" && (e >= 0.5 ? e = !0 : e = !1), !this.__didAwake) {
|
|
@@ -46472,7 +46473,7 @@ async function U7(n, e, t) {
|
|
|
46472
46473
|
const r = new U0(s);
|
|
46473
46474
|
return r.setAnimationPointerResolver.bind(r)(new F7()), r;
|
|
46474
46475
|
} else
|
|
46475
|
-
return (k7 ||
|
|
46476
|
+
return (k7 || Wt()) && console.error("Missing KHR_animation_pointer extension..."), {
|
|
46476
46477
|
name: "KHR_animation_pointer_NOT_AVAILABLE"
|
|
46477
46478
|
};
|
|
46478
46479
|
});
|
|
@@ -46774,7 +46775,7 @@ class G7 extends Jc {
|
|
|
46774
46775
|
if (e.endsWith(".glb") || e.endsWith(".gltf")) {
|
|
46775
46776
|
if (t.serializable instanceof Array && t.serializable.includes(In))
|
|
46776
46777
|
return;
|
|
46777
|
-
|
|
46778
|
+
Wt() && Fs("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");
|
|
46778
46779
|
const o = (s = (i = t.target) == null ? void 0 : i.constructor) == null ? void 0 : s.name;
|
|
46779
46780
|
console.warn(`Wrong usage of @serializable detected in your script "${o}"
|
|
46780
46781
|
|
|
@@ -46799,7 +46800,7 @@ ${t.path}! : AssetReference;
|
|
|
46799
46800
|
}
|
|
46800
46801
|
let o;
|
|
46801
46802
|
const a = (r = t.gltf) == null ? void 0 : r.scene;
|
|
46802
|
-
return a && (o = ne.findByGuid(e.guid, a)), o || (o = ne.findByGuid(e.guid, t.context.scene)), o ? Is && console.log("Deserialized object reference?", e, o, t == null ? void 0 : t.nodeToObject) : ((
|
|
46803
|
+
return a && (o = ne.findByGuid(e.guid, a)), o || (o = ne.findByGuid(e.guid, t.context.scene)), o ? Is && console.log("Deserialized object reference?", e, o, t == null ? void 0 : t.nodeToObject) : ((Wt() || Is) && console.warn("Could not resolve object reference", t.path, e, t.target, t.context.scene), e.could_not_resolve = !0), o;
|
|
46803
46804
|
}
|
|
46804
46805
|
}
|
|
46805
46806
|
}
|
|
@@ -46820,7 +46821,7 @@ class V7 extends Jc {
|
|
|
46820
46821
|
let s = this.findObjectForGuid(e.guid, t.root);
|
|
46821
46822
|
if (s || t.context && (s = this.findObjectForGuid(e.guid, (i = t.context) == null ? void 0 : i.scene), s))
|
|
46822
46823
|
return s;
|
|
46823
|
-
(
|
|
46824
|
+
(Wt() || Is) && console.warn("Could not resolve component reference", t.path, e, t.target), e.could_not_resolve = !0;
|
|
46824
46825
|
return;
|
|
46825
46826
|
}
|
|
46826
46827
|
}
|
|
@@ -46884,7 +46885,7 @@ Could not find method ${u.method} on object ${d.name}`, d, typeof d[u.method]);
|
|
|
46884
46885
|
}
|
|
46885
46886
|
y = Object.getPrototypeOf(y);
|
|
46886
46887
|
}
|
|
46887
|
-
!b && (
|
|
46888
|
+
!b && (Wt() || Is) && v();
|
|
46888
46889
|
}
|
|
46889
46890
|
}
|
|
46890
46891
|
let p = u.argument;
|
|
@@ -58537,7 +58538,7 @@ class sa {
|
|
|
58537
58538
|
const l = this.createAction(c);
|
|
58538
58539
|
a.motion.action = l;
|
|
58539
58540
|
} else
|
|
58540
|
-
(oo ||
|
|
58541
|
+
(oo || Wt()) && console.warn("No valid animationclip assigned", a);
|
|
58541
58542
|
}
|
|
58542
58543
|
if (a.behaviours && Array.isArray(a.behaviours))
|
|
58543
58544
|
for (const c of a.behaviours) {
|
|
@@ -59003,7 +59004,7 @@ const X0 = [];
|
|
|
59003
59004
|
function P_() {
|
|
59004
59005
|
if (q0)
|
|
59005
59006
|
return;
|
|
59006
|
-
|
|
59007
|
+
Wt() && console.log("User interaction registered: audio can now be played"), q0 = !0;
|
|
59007
59008
|
const n = [...X0];
|
|
59008
59009
|
X0.length = 0, n.forEach((e) => e());
|
|
59009
59010
|
}
|
|
@@ -59158,7 +59159,7 @@ const uc = class extends Ie {
|
|
|
59158
59159
|
/** Play a mediastream */
|
|
59159
59160
|
play(e = void 0) {
|
|
59160
59161
|
var i, s;
|
|
59161
|
-
!e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (
|
|
59162
|
+
!e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (Wt() && console.warn("Called play on AudioSource with unknown argument type:", e + `
|
|
59162
59163
|
Using the assigned clip instead:`, this.clip), e = this.clip);
|
|
59163
59164
|
let t = !this.sound || e && e !== this.clip;
|
|
59164
59165
|
if (typeof e == "string" && !this.audioLoader && (t = !0), (e instanceof MediaStream || typeof e == "string") && (this.clip = e), t) {
|
|
@@ -60585,7 +60586,7 @@ function Ite(n, e, t, i, s) {
|
|
|
60585
60586
|
n.__internalAwake = function() {
|
|
60586
60587
|
var c;
|
|
60587
60588
|
if (!this.onValidate) {
|
|
60588
|
-
|
|
60589
|
+
Wt() && console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "' + ((c = n.constructor) == null ? void 0 : c.name) + '"');
|
|
60589
60590
|
return;
|
|
60590
60591
|
}
|
|
60591
60592
|
if (this[o] === void 0) {
|
|
@@ -62108,7 +62109,7 @@ const _a = class extends Ie {
|
|
|
62108
62109
|
start() {
|
|
62109
62110
|
if (this.raycaster.length <= 0 && !ne.findObjectOfType(Iu, this.context)) {
|
|
62110
62111
|
const i = ne.addNewComponent(this.context.scene, Ga);
|
|
62111
|
-
i.ignoreSkinnedMeshes = !0, this.raycaster.push(i), (
|
|
62112
|
+
i.ignoreSkinnedMeshes = !0, this.raycaster.push(i), (Wt() || Fd) && console.warn("Added an ObjectRaycaster to the scene because no raycaster was found. Skinnedmeshes will be ignored for better performance");
|
|
62112
62113
|
}
|
|
62113
62114
|
}
|
|
62114
62115
|
register(t) {
|
|
@@ -62794,7 +62795,13 @@ class ji extends Ie {
|
|
|
62794
62795
|
if (_) {
|
|
62795
62796
|
Wp && console.log(y.name, y.type, y);
|
|
62796
62797
|
const C = y.children;
|
|
62797
|
-
y.children = u
|
|
62798
|
+
y.children = u;
|
|
62799
|
+
const M = y.position, I = y.scale;
|
|
62800
|
+
if (Number.isNaN(M.x) || Number.isNaN(M.y) || Number.isNaN(M.z)) {
|
|
62801
|
+
console.warn(`Object "${y.name}" has NaN values in position or scale.... will ignore it`, M, I);
|
|
62802
|
+
return;
|
|
62803
|
+
}
|
|
62804
|
+
l.expandByObject(y, !0), y.children = C;
|
|
62798
62805
|
}
|
|
62799
62806
|
for (const C of y.children)
|
|
62800
62807
|
d(C);
|
|
@@ -62802,7 +62809,11 @@ class ji extends Ie {
|
|
|
62802
62809
|
}
|
|
62803
62810
|
for (const y of t)
|
|
62804
62811
|
y.updateMatrixWorld(), d(y);
|
|
62805
|
-
if (r.updateMatrixWorld(), r.updateProjectionMatrix(), l.getCenter(c), l.applyMatrix4(r.matrixWorldInverse), l.getSize(a), l.setFromCenterAndSize(c, a), a.
|
|
62812
|
+
if (r.updateMatrixWorld(), r.updateProjectionMatrix(), l.getCenter(c), l.applyMatrix4(r.matrixWorldInverse), l.getSize(a), l.setFromCenterAndSize(c, a), Number.isNaN(a.x) || Number.isNaN(a.y) || Number.isNaN(a.z)) {
|
|
62813
|
+
console.warn("Camera fit size resultet in NaN", r, l, [...t]);
|
|
62814
|
+
return;
|
|
62815
|
+
}
|
|
62816
|
+
if (a.length() <= 1e-10) {
|
|
62806
62817
|
Wp && console.warn("Camera fit size is zero", l, [...t]);
|
|
62807
62818
|
return;
|
|
62808
62819
|
}
|
|
@@ -63138,7 +63149,7 @@ class jte {
|
|
|
63138
63149
|
return (e = this._camera) == null ? void 0 : e.context;
|
|
63139
63150
|
}
|
|
63140
63151
|
enable() {
|
|
63141
|
-
this._skybox = this.context.lightmaps.tryGetSkybox(this._camera.sourceId), this._skybox ? this.context.scene.background !== this._skybox && (Wh && console.log(`Camera "${this._camera.name}" set skybox`, this._camera, this._skybox), this._skybox.colorSpace = nt, this._skybox.mapping = Mo, this.context.scene.background = this._skybox) : (this._did_log_failed_to_find_skybox || (this._did_log_failed_to_find_skybox = !0, console.warn(`Camera "${this._camera.name}" failed to load/find skybox texture`, this._camera.sourceId, this.context.lightmaps, "Current background: ", this.context.scene.background)), (Wh ||
|
|
63152
|
+
this._skybox = this.context.lightmaps.tryGetSkybox(this._camera.sourceId), this._skybox ? this.context.scene.background !== this._skybox && (Wh && console.log(`Camera "${this._camera.name}" set skybox`, this._camera, this._skybox), this._skybox.colorSpace = nt, this._skybox.mapping = Mo, this.context.scene.background = this._skybox) : (this._did_log_failed_to_find_skybox || (this._did_log_failed_to_find_skybox = !0, console.warn(`Camera "${this._camera.name}" failed to load/find skybox texture`, this._camera.sourceId, this.context.lightmaps, "Current background: ", this.context.scene.background)), (Wh || Wt()) && Fs(`Camera "${this._camera.name}" has no skybox texture`));
|
|
63142
63153
|
}
|
|
63143
63154
|
}
|
|
63144
63155
|
function qte(n) {
|
|
@@ -63856,7 +63867,7 @@ class VT extends F_ {
|
|
|
63856
63867
|
}
|
|
63857
63868
|
}
|
|
63858
63869
|
}
|
|
63859
|
-
if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, s), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, s)), this.__mixerError === void 0 && (Bc ||
|
|
63870
|
+
if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, s), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, s)), this.__mixerError === void 0 && (Bc || Wt()) && ((l = (c = this._animator) == null ? void 0 : c.runtimeAnimatorController) != null && l.mixer) && this.mixer !== ((d = (u = this._animator) == null ? void 0 : u.runtimeAnimatorController) == null ? void 0 : d.mixer) && (this.__mixerError = !0, console.error("AnimationTrack mixer is not shared with the animator controller - this might result in the timeline to not animate properly. Please report a bug to the Needle Engine team!", this)), (f = this._animator) != null && f.runtimeAnimatorController) {
|
|
63860
63871
|
const A = Math.max(0, 1 - a);
|
|
63861
63872
|
(m = (p = this._animator) == null ? void 0 : p.runtimeAnimatorController) == null || m.update(A);
|
|
63862
63873
|
} else
|
|
@@ -64715,7 +64726,7 @@ class Ru extends Ie {
|
|
|
64715
64726
|
// private _analyzer?: AudioAnalyser;
|
|
64716
64727
|
/** @deprecated */
|
|
64717
64728
|
getFrequency(t) {
|
|
64718
|
-
return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0,
|
|
64729
|
+
return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0, Wt() && Fs("VOIP: getFrequency is currently not supported"), console.warn("VOIP: getFrequency is currently not supported")), null;
|
|
64719
64730
|
}
|
|
64720
64731
|
async getAudioStream(t) {
|
|
64721
64732
|
return navigator.mediaDevices.getUserMedia ? await navigator.mediaDevices.getUserMedia({ audio: t ?? !0, video: !1 }).catch((s) => (console.warn("VOIP failed getting audio stream", s), null)) : (console.error("No getDisplayMedia support"), null);
|
|
@@ -66431,7 +66442,7 @@ var $ie = Object.defineProperty, ene = Object.getOwnPropertyDescriptor, qi = (n,
|
|
|
66431
66442
|
return i && s && $ie(e, t, s), s;
|
|
66432
66443
|
};
|
|
66433
66444
|
function wA(n) {
|
|
66434
|
-
n && (n.getComponentInParent(Iu) || (
|
|
66445
|
+
n && (n.getComponentInParent(Iu) || (Wt() && console.warn("Create Raycaster on " + n.name + " because no raycaster was found in the hierarchy"), n.addNewComponent(Ga)));
|
|
66435
66446
|
}
|
|
66436
66447
|
class $f extends Ie {
|
|
66437
66448
|
constructor() {
|
|
@@ -66818,7 +66829,7 @@ const Ud = (JS = class extends Ie {
|
|
|
66818
66829
|
if (this.target && this.animator) {
|
|
66819
66830
|
const l = (r = (s = this.animator) == null ? void 0 : s.runtimeAnimatorController) == null ? void 0 : r.findState(this.stateName);
|
|
66820
66831
|
if (!((o = l == null ? void 0 : l.motion) != null && o.clip)) {
|
|
66821
|
-
|
|
66832
|
+
Wt() && console.warn("No clip found for state " + this.stateName);
|
|
66822
66833
|
return;
|
|
66823
66834
|
}
|
|
66824
66835
|
this.stateAnimationModel = t, this.stateAnimation = e.registerAnimation(this.target, l == null ? void 0 : l.motion.clip);
|
|
@@ -73966,7 +73977,7 @@ class OA extends Ie {
|
|
|
73966
73977
|
console.warn("OpenURL: URL is not set, can't open.", this);
|
|
73967
73978
|
return;
|
|
73968
73979
|
}
|
|
73969
|
-
switch (this._validateUrl(),
|
|
73980
|
+
switch (this._validateUrl(), Wt() && Cn("Open URL: " + this.url), this.mode) {
|
|
73970
73981
|
case 0:
|
|
73971
73982
|
Vh() ? globalThis.open(this.url, "_blank") : globalThis.open(this.url, "_blank");
|
|
73972
73983
|
break;
|
|
@@ -73998,7 +74009,7 @@ class OA extends Ie {
|
|
|
73998
74009
|
this.clickable && !t.used && ((i = this.url) != null && i.length) && this.open();
|
|
73999
74010
|
}
|
|
74000
74011
|
_validateUrl() {
|
|
74001
|
-
this.url && this.url.startsWith("www.") && (
|
|
74012
|
+
this.url && this.url.startsWith("www.") && (Wt() && console.warn("URL is not valid, adding https:// to the start of the URL", this.url), this.url = "https://" + this.url);
|
|
74002
74013
|
}
|
|
74003
74014
|
}
|
|
74004
74015
|
AI([
|
|
@@ -78580,7 +78591,7 @@ const s1 = (ZS = class extends Ie {
|
|
|
78580
78591
|
h(this, "lengthScale");
|
|
78581
78592
|
}
|
|
78582
78593
|
start() {
|
|
78583
|
-
if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 &&
|
|
78594
|
+
if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 && Wt()) {
|
|
78584
78595
|
const e = `ParticleSystem "${this.name}" has non-default min/max particle size. This may not render correctly. Please set min size to 0 and the max size to 0.5 and use the "StartSize" setting instead`;
|
|
78585
78596
|
console.warn(e);
|
|
78586
78597
|
}
|
|
@@ -79234,7 +79245,7 @@ const a0 = class extends Ie {
|
|
|
79234
79245
|
var e;
|
|
79235
79246
|
if (this._subEmitterSystems && this._particleSystem)
|
|
79236
79247
|
for (const t of this._subEmitterSystems) {
|
|
79237
|
-
t.particleSystem && (t.particleSystem.__internalAwake ? t.particleSystem.__internalAwake() :
|
|
79248
|
+
t.particleSystem && (t.particleSystem.__internalAwake ? t.particleSystem.__internalAwake() : Wt() && console.warn("SubParticleSystem serialization issue(?)", t.particleSystem, t));
|
|
79238
79249
|
const i = (e = t.particleSystem) == null ? void 0 : e._particleSystem;
|
|
79239
79250
|
if (i) {
|
|
79240
79251
|
t.particleSystem._isUsedAsSubsystem = !0;
|
|
@@ -79316,7 +79327,7 @@ function Cz(n, e) {
|
|
|
79316
79327
|
if (!n.unsupported_scaling_mode) {
|
|
79317
79328
|
n.unsupported_scaling_mode = !0;
|
|
79318
79329
|
const t = "ParticleSystem scale mode " + WE[n.main.scalingMode] + " is not supported";
|
|
79319
|
-
|
|
79330
|
+
Wt() && Fs(t), console.warn(t, n.name, n);
|
|
79320
79331
|
}
|
|
79321
79332
|
e = hs(n.gameObject, e);
|
|
79322
79333
|
break;
|
|
@@ -80947,7 +80958,7 @@ const Iz = function(n) {
|
|
|
80947
80958
|
typeof n == "string" ? r = e[n] : typeof n == "function" && (r = n);
|
|
80948
80959
|
const o = e, a = o.__internalAwake;
|
|
80949
80960
|
if (typeof a != "function") {
|
|
80950
|
-
(Gm ||
|
|
80961
|
+
(Gm || Wt()) && console.error('@syncField can currently only used on Needle Engine Components, custom object of type "' + ((u = e == null ? void 0 : e.constructor) == null ? void 0 : u.name) + '" is not supported', e);
|
|
80951
80962
|
return;
|
|
80952
80963
|
}
|
|
80953
80964
|
Gm && console.log(i);
|
|
@@ -80964,7 +80975,7 @@ const Iz = function(n) {
|
|
|
80964
80975
|
var A;
|
|
80965
80976
|
const m = this[c];
|
|
80966
80977
|
if (this[c] = p, f) {
|
|
80967
|
-
|
|
80978
|
+
Wt() && console.warn("Recursive call detected", i);
|
|
80968
80979
|
return;
|
|
80969
80980
|
}
|
|
80970
80981
|
f = !0;
|
|
@@ -81660,7 +81671,7 @@ class Ls extends Ie {
|
|
|
81660
81671
|
this._muted = t, this._videoElement && (this._videoElement.muted = t);
|
|
81661
81672
|
}
|
|
81662
81673
|
set audioOutputMode(t) {
|
|
81663
|
-
t !== this._audioOutputMode && (t === 1 &&
|
|
81674
|
+
t !== this._audioOutputMode && (t === 1 && Wt() && console.warn("VideoAudioOutputMode.AudioSource is not yet implemented"), this._audioOutputMode = t, this.updateVideoElementSettings());
|
|
81664
81675
|
}
|
|
81665
81676
|
get audioOutputMode() {
|
|
81666
81677
|
return this._audioOutputMode;
|
|
@@ -83557,7 +83568,7 @@ const c1 = (tC = class extends Ie {
|
|
|
83557
83568
|
for (const s in this.remoteCams) {
|
|
83558
83569
|
const r = this.remoteCams[s], o = this.context.time.realtimeSinceStartup - r.lastUpdate;
|
|
83559
83570
|
if (!r || o > this._camTimeoutInSeconds) {
|
|
83560
|
-
|
|
83571
|
+
Wt() && console.log("Remote cam timeout", s), r != null && r.obj && ne.destroy(r.obj), delete this.remoteCams[s], r && delete this.userToCamMap[r.userId], c1.instances.push(r), this.context.players.removePlayerView(r.userId, Nc.Browser);
|
|
83561
83572
|
continue;
|
|
83562
83573
|
}
|
|
83563
83574
|
}
|
|
@@ -84081,7 +84092,7 @@ class BI extends Ie {
|
|
|
84081
84092
|
}
|
|
84082
84093
|
apply() {
|
|
84083
84094
|
var i, s;
|
|
84084
|
-
NS && console.log("Apply PostProcessing", this, (i = this.context.mainCamera) == null ? void 0 : i.name),
|
|
84095
|
+
NS && console.log("Apply PostProcessing", this, (i = this.context.mainCamera) == null ? void 0 : i.name), Wt() && (this._lastApplyTime !== void 0 && Date.now() - this._lastApplyTime < 100 && (this._rapidApplyCount++, this._rapidApplyCount === 5 && console.warn("Detected rapid post processing modifications - this might be a bug", this)), this._lastApplyTime = Date.now()), this._isDirty = !1, this.unapply(), this._effects.length = 0, (s = this.sharedProfile) != null && s.components && this._effects.push(...this.sharedProfile.components);
|
|
84085
84096
|
const t = this.gameObject.getComponentsInChildren(sr);
|
|
84086
84097
|
if (NS && (t != null && t.length) && console.log("Additional", t), t)
|
|
84087
84098
|
for (const r of t)
|
|
@@ -85798,7 +85809,7 @@ class Zz extends HTMLElement {
|
|
|
85798
85809
|
const m = this.getAttribute("hide-loading-overlay");
|
|
85799
85810
|
m != null && m !== "0" && (o = !1);
|
|
85800
85811
|
}
|
|
85801
|
-
o === !1 && !r && (
|
|
85812
|
+
o === !1 && !r && (Wt() || (o = !0), console.warn("Needle Engine: You need a commercial license to override the default loading view. Visit https://needle.tools/pricing"), Wt() && Fs('You need a <a target="_blank" href="https://needle.tools/pricing">commercial license</a> to override the default loading view. This will not work in production.')), !this._loadingView && o && (this._loadingView = new Jy(this)), o && (this._didFullyLoad !== !0 ? (f = this._loadingView) == null || f.onLoadingBegin("begin load") : setTimeout(() => {
|
|
85802
85813
|
this._loadingView && this._loadingProgress01 < 0.3 && this._loadId === i && this._loadingView.onLoadingBegin("begin load");
|
|
85803
85814
|
}, 300)), ns && console.warn("--------------", i, "Needle Engine: Begin loading", s ?? "", t), this.onBeforeBeginLoading();
|
|
85804
85815
|
const a = [], c = {
|
|
@@ -87573,7 +87584,7 @@ const eg = class {
|
|
|
87573
87584
|
const l = c.parent();
|
|
87574
87585
|
l && l.numColliders() <= 0 && (l[ur] || (s = this.world) == null || s.removeRigidBody(l));
|
|
87575
87586
|
} else
|
|
87576
|
-
a instanceof xk && (a.numColliders() <= 0 ? (r = this.world) == null || r.removeRigidBody(a) :
|
|
87587
|
+
a instanceof xk && (a.numColliders() <= 0 ? (r = this.world) == null || r.removeRigidBody(a) : Wt() && (a.did_log_removing || setTimeout(() => {
|
|
87577
87588
|
a.numColliders() > 0 && (a.did_log_removing = !0, console.warn("RapierPhysics: removing rigidbody with colliders from the physics world is not possible right now, please remove the colliders first"));
|
|
87578
87589
|
}, 1)));
|
|
87579
87590
|
}
|
|
@@ -88011,7 +88022,12 @@ Error:`, a), null;
|
|
|
88011
88022
|
c ? this.syncPhysicsBody(t.gameObject, c, !0, !0) : this.syncPhysicsBody(t.gameObject, i, !0, !0);
|
|
88012
88023
|
continue;
|
|
88013
88024
|
}
|
|
88014
|
-
const r = i.translation(), o = i.rotation()
|
|
88025
|
+
const r = i.translation(), o = i.rotation();
|
|
88026
|
+
if (Number.isNaN(r.x) || Number.isNaN(o.x)) {
|
|
88027
|
+
!s.__COLLIDER_NAN && Wt() && (console.warn("Collider has NaN values", s.name, s.gameObject, i), s.__COLLIDER_NAN = !0);
|
|
88028
|
+
continue;
|
|
88029
|
+
}
|
|
88030
|
+
const a = t.center;
|
|
88015
88031
|
if (a && a.isVector3) {
|
|
88016
88032
|
this._tempQuaternion.set(o.x, o.y, o.z, o.w);
|
|
88017
88033
|
const c = this._tempPosition.copy(a).applyQuaternion(this._tempQuaternion);
|
|
@@ -89373,7 +89389,7 @@ export {
|
|
|
89373
89389
|
uj as isAnimationAction,
|
|
89374
89390
|
wle as isDebugMode,
|
|
89375
89391
|
NM as isDestroyed,
|
|
89376
|
-
|
|
89392
|
+
Wt as isDevEnvironment,
|
|
89377
89393
|
qle as isDisposed,
|
|
89378
89394
|
L8 as isHostedOnGlitch,
|
|
89379
89395
|
Ehe as isHotReloading,
|