@needle-tools/engine 4.8.3-next.1a41273 → 4.8.3-next.66cfa29
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/dist/{gltf-progressive-B--ZfCTJ.min.js → gltf-progressive-DLhfUtEV.min.js} +1 -1
- package/dist/{gltf-progressive-Do1XJNMG.js → gltf-progressive-DVx_cW0s.js} +1 -5
- package/dist/{needle-engine.bundle-CcYGQALb.umd.cjs → needle-engine.bundle-B87-lKZ6.umd.cjs} +8 -8
- package/dist/{needle-engine.bundle-DbnDoLkt.js → needle-engine.bundle-BBr2beL2.js} +135 -138
- package/dist/{needle-engine.bundle-CvDGadt9.min.js → needle-engine.bundle-CgIDtYTA.min.js} +21 -21
- package/dist/needle-engine.js +3 -3
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_networking_streams.js +7 -2
- package/lib/engine/engine_networking_streams.js.map +1 -1
- package/package.json +1 -1
- package/plugins/vite/peer.js +60 -2
- package/plugins/vite/poster-client.js +35 -51
- package/plugins/vite/poster.js +2 -3
- package/src/engine/engine_networking_streams.ts +8 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as $, PlaneGeometry as Nn, WebGLRenderer as dr, PerspectiveCamera as pe, OrthographicCamera as Md, Scene as bi, Mesh as H, Texture as Te, Uniform$1 as Ui, Color as se, ShaderMaterial as jn, Box3 as yi, ShadowMaterial as ab, Euler as Tt, MeshStandardMaterial as ct, Box3Helper as qw, GridHelper as rm, Object3D as M, Material as _e, Matrix3 as lb, Matrix4 as te, Layers as lo, Ray as co, MathUtils as gs, AxesHelper as _i, MeshBasicMaterial as we, DoubleSide as vi, BufferGeometry as In, Group as no, CylinderGeometry as cb, SphereGeometry as Rd, BoxGeometry as la, SpriteMaterial as Xw, Sprite as Qw, Shape as Yw, ExtrudeGeometry as Kw, Fog as hb, DirectionalLight as Zf, PointLight as am, EdgesGeometry as Zw, LineSegments as db, LineBasicMaterial as ub, Line as Zl, BufferAttribute as ht, Raycaster as Td, Sphere as Ed, ArrayCamera as Jw, Plane as ir, SkinnedMesh as ys, InterleavedBufferAttribute as fb, Skeleton as ex, Bone as tx, Source as ix, WebGLCubeRenderTarget as nx, CubeCamera as sx, AnimationClip as so, FileLoader as lm, TextureLoader as Qr, PropertyBinding as ca, LinearSRGBColorSpace as Ss, ShaderChunk as Vt, UniformsLib as ox, DataTexture as cm, RGBAFormat as Ad, EquirectangularReflectionMapping as _s, SRGBColorSpace as Cs, Clock as rx, NeutralToneMapping as ha, AgXToneMapping as Id, ACESFilmicToneMapping as Ld, NoToneMapping as Vh, PCFSoftShadowMap$1 as ax, BasicNodeLibrary as lx, WebGLRenderTarget as Bn, DepthTexture as pb, NearestFilter as Hh, LoopRepeat as cx, LoopOnce as Jf, AnimationMixer as hm, CompressedTexture as hx, FrontSide as ho, Camera as dx, Frustum as Gg, AudioListener as ux, PositionalAudio as fx, AudioLoader as ep, EventDispatcher as dm, BackSide as Dd, MeshDepthMaterial as px, CustomBlending as mx, MaxEquation as gx, AmbientLight as yx, HemisphereLight as _x, AlwaysStencilFunc as bx, GreaterEqualStencilFunc as vx, NotEqualStencilFunc as wx, GreaterStencilFunc as xx, LessEqualStencilFunc as Sx, EqualStencilFunc as Cx, LessStencilFunc as Px, NeverStencilFunc as qg, InvertStencilOp as Ox, DecrementWrapStencilOp as kx, IncrementWrapStencilOp as Mx, DecrementStencilOp as Rx, IncrementStencilOp as Tx, ReplaceStencilOp as Ex, ZeroStencilOp as Ax, KeepStencilOp as Ix, RawShaderMaterial as mb, GLSL3 as Lx, AlwaysDepth as Dx, GreaterEqualDepth as jx, GreaterDepth as Bx, LessEqualDepth as Fx, LessDepth as zx, NotEqualDepth as Ux, EqualDepth as Nx, BatchedMesh as Xg, MeshPhysicalMaterial as tp, LinearFilter as Gh, UnsignedByteType as $x, RingGeometry as Wx, Line3 as Vx, AdditiveBlending as gb, BoxHelper as Hx, SpotLight as Gx, DirectionalLightHelper as qx, CameraHelper as Xx, LOD as Qx, Triangle as Yx, NormalBlending as Kx, ReinhardToneMapping as um, LinearToneMapping as fm, HalfFloatType as Nu, VideoTexture as Zx, CubeTexture as Jx, CompressedCubeTexture as eS, EquirectangularRefractionMapping as tS, VectorKeyframeTrack as iS, QuaternionKeyframeTrack as nS, Audio as sS, ShaderLib as qh, UniformsUtils as yb, MirroredRepeatWrapping as Qg, MeshNormalMaterial as oS, AudioContext as rS, PMREMGenerator$1 as aS } from "./three-DrqIzZTH.js";
|
|
2
|
-
import { createLoaders as pm, getRaycastMesh as _b, LODsManager as Io, NEEDLE_progressive as We, addDracoAndKTX2Loaders as lS, configureLoader as cS, setKTX2TranscoderLocation as hS, setDracoDecoderLocation as dS } from "./gltf-progressive-
|
|
2
|
+
import { createLoaders as pm, getRaycastMesh as _b, LODsManager as Io, NEEDLE_progressive as We, addDracoAndKTX2Loaders as lS, configureLoader as cS, setKTX2TranscoderLocation as hS, setDracoDecoderLocation as dS } from "./gltf-progressive-DVx_cW0s.js";
|
|
3
3
|
import { GroundedSkybox as da, Font as uS, TextGeometry as fS, FontLoader as pS, GLTFLoader as Ps, TransformControlsGizmo as bb, EXRLoader as Xh, RGBELoader as ip, Stats as mS, nodeFrame as gS, OrbitControls as vb, PositionalAudioHelper as yS, HorizontalBlurShader as _S, VerticalBlurShader as bS, GLTFExporter as wb, strToU8 as xb, zipSync as vS, XRControllerModelFactory as wS, XRHandMeshModel as xS, Line2 as SS, LineGeometry as CS, LineMaterial as PS, KTX2Loader as OS, TransformControls as kS, InteractiveGroup as MS, HTMLMesh as RS, VertexNormalsHelper as TS, OBJLoader as mm, FBXLoader as Sb, mergeVertices as ES } from "./three-examples-BIuXQPSf.js";
|
|
4
4
|
import { fetchProfile as AS, MotionController as IS, $70d766613f57b014$export$2e2bcd8739ae039 as Yg, ByteBuffer as LS, v5 as Kg, md5 as Zg, SIZE_PREFIX_LENGTH as Cb, Builder as gm, createNoise4D as DS, Matrix4 as $u, BatchedParticleRenderer as jS, ParticleSystem as BS, RenderMode as as, ConstantColor as FS, Vector4 as zS, ConstantValue as US, TrailParticle as Jg, WorkerBase as NS, MeshBVH as $S } from "./vendor-CGONwIc0.js";
|
|
5
5
|
import { __webpack_exports__default as Ce, __webpack_exports__Text as Pb, __webpack_exports__Block as Ob, __webpack_exports__update as WS, SimpleStateBehavior as VS, __webpack_exports__Inline as Wu, __webpack_exports__FontLibrary as ey, ThreeMeshUI as ty } from "./three-mesh-ui-D6Mz5Yl7.js";
|
|
@@ -1582,14 +1582,14 @@ function Wb(s, ...e) {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
1584
|
const GC = w("nodevlogs");
|
|
1585
|
-
function
|
|
1585
|
+
function Be(s, e = Ni.Log) {
|
|
1586
1586
|
kn(e, s);
|
|
1587
1587
|
}
|
|
1588
1588
|
function me(s) {
|
|
1589
|
-
|
|
1589
|
+
Be(s, Ni.Warn);
|
|
1590
1590
|
}
|
|
1591
1591
|
function Nd(s) {
|
|
1592
|
-
|
|
1592
|
+
Be(s, Ni.Error);
|
|
1593
1593
|
}
|
|
1594
1594
|
let cp, Yu;
|
|
1595
1595
|
function L() {
|
|
@@ -1787,9 +1787,9 @@ po('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUIL
|
|
|
1787
1787
|
po('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
|
|
1788
1788
|
po('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.8.3";');
|
|
1789
1789
|
po('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
1790
|
-
po('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Aug 18 2025
|
|
1790
|
+
po('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Aug 18 2025 13:23:13 GMT+0000 (Coordinated Universal Time)";');
|
|
1791
1791
|
po('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
|
|
1792
|
-
const Ln = "4.8.3", wm = "undefined", Qb = "Mon Aug 18 2025
|
|
1792
|
+
const Ln = "4.8.3", wm = "undefined", Qb = "Mon Aug 18 2025 13:23:13 GMT+0000 (Coordinated Universal Time)";
|
|
1793
1793
|
Xb && console.log(`Engine version: ${Ln} (generator: ${wm})
|
|
1794
1794
|
Project built at ${Qb}`);
|
|
1795
1795
|
const vl = NEEDLE_PUBLIC_KEY, ro = "needle_isActiveInHierarchy", jr = "builtin_components", Oh = "needle_editor_guid";
|
|
@@ -1911,7 +1911,7 @@ function o1(s) {
|
|
|
1911
1911
|
pa[e](s);
|
|
1912
1912
|
}
|
|
1913
1913
|
const tt = w("debuginput");
|
|
1914
|
-
var Pm = /* @__PURE__ */ ((s) => (s.Mouse = "mouse", s.Touch = "touch", s.Controller = "controller", s.Hand = "hand", s))(Pm || {}),
|
|
1914
|
+
var Pm = /* @__PURE__ */ ((s) => (s.Mouse = "mouse", s.Touch = "touch", s.Controller = "controller", s.Hand = "hand", s))(Pm || {}), De = /* @__PURE__ */ ((s) => (s.PointerDown = "pointerdown", s.PointerUp = "pointerup", s.PointerMove = "pointermove", s.KeyDown = "keydown", s.KeyUp = "keyup", s.KeyPressed = "keypress", s))(De || {});
|
|
1915
1915
|
class Vs extends PointerEvent {
|
|
1916
1916
|
/**
|
|
1917
1917
|
* Spatial input data
|
|
@@ -2396,13 +2396,13 @@ class r1 {
|
|
|
2396
2396
|
createInputEvent(e) {
|
|
2397
2397
|
switch (e.type) {
|
|
2398
2398
|
case "pointerdown":
|
|
2399
|
-
tt &&
|
|
2399
|
+
tt && Be("Create Pointer down"), this.onDownButton(e.deviceIndex, e.button), this.onDown(e);
|
|
2400
2400
|
break;
|
|
2401
2401
|
case "pointermove":
|
|
2402
|
-
tt &&
|
|
2402
|
+
tt && Be("Create Pointer move"), this.onMove(e);
|
|
2403
2403
|
break;
|
|
2404
2404
|
case "pointerup":
|
|
2405
|
-
tt &&
|
|
2405
|
+
tt && Be("Create Pointer up"), this.onUp(e), this.onReleaseButton(e.deviceIndex, e.button);
|
|
2406
2406
|
break;
|
|
2407
2407
|
}
|
|
2408
2408
|
}
|
|
@@ -2496,7 +2496,7 @@ class r1 {
|
|
|
2496
2496
|
if (this.context.isInAR || this.canReceiveInput(e) === !1) return;
|
|
2497
2497
|
e.target instanceof HTMLElement && e.target.setPointerCapture(e.pointerId);
|
|
2498
2498
|
const t = this.getPointerId(e);
|
|
2499
|
-
tt &&
|
|
2499
|
+
tt && Be(`pointer down #${t}, identifier:${e.pointerId}`);
|
|
2500
2500
|
const i = this.getAndUpdateSpatialObjectForScreenPosition(t, e.clientX, e.clientY), n = new Vs("pointerdown", e, { origin: this, mode: "screen", deviceIndex: 0, pointerId: t, button: e.button, clientX: e.clientX, clientY: e.clientY, pointerType: e.pointerType, buttonName: this.getButtonName(e), device: i, pressure: e.pressure });
|
|
2501
2501
|
this.onDown(n);
|
|
2502
2502
|
};
|
|
@@ -3178,16 +3178,16 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
|
|
|
3178
3178
|
if (!this.emitPointerDownEvent || this.inputSource !== e.inputSource) return;
|
|
3179
3179
|
this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
|
|
3180
3180
|
const t = this._layout?.selectComponentId, i = this._layout?.components[t]?.gamepadIndices?.button;
|
|
3181
|
-
i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(
|
|
3181
|
+
i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(De.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
|
|
3182
3182
|
};
|
|
3183
3183
|
onSelectEnd = (e) => {
|
|
3184
|
-
this.emitPointerUpEvent && (Xc || this.inputSource === e.inputSource && this.emitPointerEvent(
|
|
3184
|
+
this.emitPointerUpEvent && (Xc || this.inputSource === e.inputSource && this.emitPointerEvent(De.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
|
|
3185
3185
|
};
|
|
3186
3186
|
onSequeezeStart = (e) => {
|
|
3187
|
-
this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(
|
|
3187
|
+
this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(De.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
|
|
3188
3188
|
};
|
|
3189
3189
|
onSequeezeEnd = (e) => {
|
|
3190
|
-
this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(
|
|
3190
|
+
this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(De.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
|
|
3191
3191
|
};
|
|
3192
3192
|
/** Index = button index */
|
|
3193
3193
|
states = {};
|
|
@@ -3252,7 +3252,7 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
|
|
|
3252
3252
|
pointerInit;
|
|
3253
3253
|
emitPointerEvent(e, t, i, n, o = null, r) {
|
|
3254
3254
|
if (!this.emitEvents) {
|
|
3255
|
-
Yn && e !==
|
|
3255
|
+
Yn && e !== De.PointerMove && console.warn("Pointer events are disabled for this controller", this.index, e, t);
|
|
3256
3256
|
return;
|
|
3257
3257
|
}
|
|
3258
3258
|
if (this.xr.mode === "immersive-vr" || this.xr.isPassThrough) {
|
|
@@ -4752,7 +4752,7 @@ class K {
|
|
|
4752
4752
|
a.onBeforeXR && a.onBeforeXR(e, t);
|
|
4753
4753
|
for (const a of this._sessionRequestStartListeners)
|
|
4754
4754
|
a({ mode: e, init: t });
|
|
4755
|
-
He &&
|
|
4755
|
+
He && Be("Requesting " + e + " session (" + Date.now() + ")"), this._currentSessionRequest = navigator.xr?.requestSession(e, t), this._currentSessionRequestMode = e;
|
|
4756
4756
|
const o = await this._currentSessionRequest?.catch((a) => {
|
|
4757
4757
|
console.error(a, "Code: " + a.code), a.code === 9 && me("Make sure your device has the required permissions (e.g. camera access)"), console.log("If the specified XR configuration is not supported (e.g. entering AR doesnt work) - make sure you access the website on a secure connection (HTTPS) and your device has the required permissions (e.g. camera access)"), location.protocol === "http:" && me("XR requires a secure connection (HTTPS)");
|
|
4758
4758
|
});
|
|
@@ -11141,7 +11141,7 @@ Possible solutions:
|
|
|
11141
11141
|
try {
|
|
11142
11142
|
this.internalStep(e, t), this._renderlooperrors = 0;
|
|
11143
11143
|
} catch (i) {
|
|
11144
|
-
this._renderlooperrors += 1, (L() || Xe) && (i instanceof Error || i instanceof TypeError) &&
|
|
11144
|
+
this._renderlooperrors += 1, (L() || Xe) && (i instanceof Error || i instanceof TypeError) && Be("Caught unhandled exception during render-loop - see console for details.", Ni.Error), console.error("Frame #" + this.time.frame + `
|
|
11145
11145
|
`, i), this._renderlooperrors >= 3 && (console.warn("Stopping render loop due to error"), this.renderer.setAnimationLoop(null)), this.domElement.dispatchEvent(new CustomEvent("error", { detail: i }));
|
|
11146
11146
|
}
|
|
11147
11147
|
else
|
|
@@ -14259,7 +14259,7 @@ const Lt = function(s, e) {
|
|
|
14259
14259
|
function UO(s, e, t, i, n) {
|
|
14260
14260
|
if (!n && !i && !s.onValidate) return;
|
|
14261
14261
|
if (t !== void 0) {
|
|
14262
|
-
console.error("Invalid usage of validate decorator. Only fields can be validated.", s, e, t),
|
|
14262
|
+
console.error("Invalid usage of validate decorator. Only fields can be validated.", s, e, t), Be("Invalid usage of validate decorator. Only fields can be validated. Property: " + e, Ni.Error);
|
|
14263
14263
|
return;
|
|
14264
14264
|
}
|
|
14265
14265
|
let o = "";
|
|
@@ -15485,10 +15485,10 @@ class ei extends T {
|
|
|
15485
15485
|
this.context.scene.getComponent(Sa) || this.context.scene.addComponent(Gi);
|
|
15486
15486
|
}
|
|
15487
15487
|
onEnable() {
|
|
15488
|
-
this.context.input.addEventListener(
|
|
15488
|
+
this.context.input.addEventListener(De.PointerDown, this.onPointerEvent), this.context.input.addEventListener(De.PointerUp, this.onPointerEvent), this.context.input.addEventListener(De.PointerMove, this.onPointerEvent);
|
|
15489
15489
|
}
|
|
15490
15490
|
onDisable() {
|
|
15491
|
-
this.context.input.removeEventListener(
|
|
15491
|
+
this.context.input.removeEventListener(De.PointerDown, this.onPointerEvent), this.context.input.removeEventListener(De.PointerUp, this.onPointerEvent), this.context.input.removeEventListener(De.PointerMove, this.onPointerEvent);
|
|
15492
15492
|
}
|
|
15493
15493
|
/**
|
|
15494
15494
|
* all pointers that have pressed something
|
|
@@ -15513,7 +15513,7 @@ class ei extends T {
|
|
|
15513
15513
|
onPointerEvent = (e) => {
|
|
15514
15514
|
if (e === void 0 || e.propagationStopped || e.defaultPrevented || e.used) return;
|
|
15515
15515
|
const t = new Zd(this.context.input, e);
|
|
15516
|
-
this._currentPointerEventName = e.type, t.inputSource = this.context.input, t.isClick = e.isClick, t.isDoubleClick = e.isDoubleClick, t.isDown = e.type ==
|
|
15516
|
+
this._currentPointerEventName = e.type, t.inputSource = this.context.input, t.isClick = e.isClick, t.isDoubleClick = e.isDoubleClick, t.isDown = e.type == De.PointerDown, t.isUp = e.type == De.PointerUp, t.isPressed = this.context.input.getPointerPressed(e.pointerId);
|
|
15517
15517
|
const i = new pr();
|
|
15518
15518
|
e.hasRay ? i.ray = e.ray : i.screenPoint = this.context.input.getPointerPositionRC(e.pointerId), i.allowSlowRaycastFallback = e.isClick || e.isDoubleClick;
|
|
15519
15519
|
const n = this.performRaycast(i);
|
|
@@ -15526,7 +15526,7 @@ class ei extends T {
|
|
|
15526
15526
|
hits: n
|
|
15527
15527
|
});
|
|
15528
15528
|
}
|
|
15529
|
-
Gs && t.isClick &&
|
|
15529
|
+
Gs && t.isClick && Be("EventSystem: " + t.pointerId + " - " + this.context.time.frame + " - Up:" + t.isUp + ", Down:" + t.isDown);
|
|
15530
15530
|
const o = {
|
|
15531
15531
|
sender: this,
|
|
15532
15532
|
args: t,
|
|
@@ -15745,7 +15745,7 @@ class ei extends T {
|
|
|
15745
15745
|
}
|
|
15746
15746
|
/** invoke the pointerMove event on all captured handlers */
|
|
15747
15747
|
invokePointerCapture(e) {
|
|
15748
|
-
if (e.event.type ===
|
|
15748
|
+
if (e.event.type === De.PointerMove) {
|
|
15749
15749
|
const t = e.pointerId, i = this._capturedPointer[t];
|
|
15750
15750
|
if (i) {
|
|
15751
15751
|
Gs && console.log("Captured", t, i);
|
|
@@ -16716,7 +16716,7 @@ const qs = w("debugcam"), u_ = w("debugscreenpointtoray"), Dt = class Cl extends
|
|
|
16716
16716
|
if (typeof t._transparent == "boolean")
|
|
16717
16717
|
return t._transparent;
|
|
16718
16718
|
const i = t.environmentBlendMode;
|
|
16719
|
-
qs &&
|
|
16719
|
+
qs && Be("Environment blend mode: " + i + " on " + navigator.userAgent);
|
|
16720
16720
|
let n = i === "additive" || i === "alpha-blend";
|
|
16721
16721
|
return e.isInAR && i === "opaque" && (navigator.userAgent?.includes("OculusBrowser") || navigator.userAgent?.includes("Mozilla") && navigator.userAgent?.includes("Mobile WebXRViewer/v2")) && (n = !0), t._transparent = n, n;
|
|
16722
16722
|
}
|
|
@@ -17166,29 +17166,29 @@ fn([
|
|
|
17166
17166
|
], Ki.prototype, "rollOffMode", 2);
|
|
17167
17167
|
let hn = Ki;
|
|
17168
17168
|
const uk = w("debugavatar");
|
|
17169
|
-
class
|
|
17169
|
+
class je extends T {
|
|
17170
17170
|
static getAvatar(e) {
|
|
17171
|
-
return e >= 0 && e <
|
|
17171
|
+
return e >= 0 && e < je.instances.length ? je.instances[e] : null;
|
|
17172
17172
|
}
|
|
17173
17173
|
static instances = [];
|
|
17174
17174
|
static onAvatarMarkerCreated(e) {
|
|
17175
|
-
return
|
|
17175
|
+
return je._onNewAvatarMarkerAdded.push(e), e;
|
|
17176
17176
|
}
|
|
17177
17177
|
static onAvatarMarkerDestroyed(e) {
|
|
17178
|
-
return
|
|
17178
|
+
return je._onAvatarMarkerDestroyed.push(e), e;
|
|
17179
17179
|
}
|
|
17180
17180
|
static _onNewAvatarMarkerAdded = [];
|
|
17181
17181
|
static _onAvatarMarkerDestroyed = [];
|
|
17182
17182
|
connectionId;
|
|
17183
17183
|
avatar;
|
|
17184
17184
|
awake() {
|
|
17185
|
-
|
|
17186
|
-
for (const e of
|
|
17185
|
+
je.instances.push(this), uk && console.log(this);
|
|
17186
|
+
for (const e of je._onNewAvatarMarkerAdded)
|
|
17187
17187
|
e({ avatarMarker: this, gameObject: this.gameObject });
|
|
17188
17188
|
}
|
|
17189
17189
|
onDestroy() {
|
|
17190
|
-
|
|
17191
|
-
for (const e of
|
|
17190
|
+
je.instances.splice(je.instances.indexOf(this), 1);
|
|
17191
|
+
for (const e of je._onAvatarMarkerDestroyed)
|
|
17192
17192
|
e({ avatarMarker: this, gameObject: this.gameObject });
|
|
17193
17193
|
}
|
|
17194
17194
|
isLocalAvatar() {
|
|
@@ -17238,8 +17238,8 @@ class ud extends T {
|
|
|
17238
17238
|
_lookDuration = 0;
|
|
17239
17239
|
_lastPoiChangedTime = 0;
|
|
17240
17240
|
awake() {
|
|
17241
|
-
if (this.avatar = x.getComponentInParent(this.gameObject,
|
|
17242
|
-
const e = x.getComponentInParent(this.gameObject,
|
|
17241
|
+
if (this.avatar = x.getComponentInParent(this.gameObject, je), this.avatar) {
|
|
17242
|
+
const e = x.getComponentInParent(this.gameObject, je);
|
|
17243
17243
|
this._model = new o0(this.context.connection, this.guid), e?.isLocalAvatar && this._model.requestOwnership();
|
|
17244
17244
|
}
|
|
17245
17245
|
this.context.connection.beginListen("avatar-look-target-changed", (e) => {
|
|
@@ -17332,7 +17332,7 @@ class _k {
|
|
|
17332
17332
|
this.object = e, this.collider = t;
|
|
17333
17333
|
}
|
|
17334
17334
|
}
|
|
17335
|
-
const
|
|
17335
|
+
const Le = w("debugnetworkingstreams");
|
|
17336
17336
|
var ps = /* @__PURE__ */ ((s) => (s.Connected = "peer-user-connected", s.StreamReceived = "receive-stream", s.StreamEnded = "call-ended", s.Disconnected = "peer-user-disconnected", s.UserJoined = "user-joined", s))(ps || {});
|
|
17337
17337
|
class X0 {
|
|
17338
17338
|
type = "call-ended";
|
|
@@ -17386,7 +17386,7 @@ class xk extends dm {
|
|
|
17386
17386
|
}
|
|
17387
17387
|
constructor(e, t, i, n = null) {
|
|
17388
17388
|
super(), this.peerId = t.peer, this.userId = e, this.call = t, this.direction = i, this._stream = n, t.on("stream", (o) => {
|
|
17389
|
-
if (
|
|
17389
|
+
if (Le && console.log("Receive stream", `
|
|
17390
17390
|
Audio:`, o.getAudioTracks(), `
|
|
17391
17391
|
Video:`, o.getVideoTracks()), this._stream = o, i === "incoming") {
|
|
17392
17392
|
const r = new bk(e, o, this);
|
|
@@ -17420,7 +17420,7 @@ class to extends dm {
|
|
|
17420
17420
|
}
|
|
17421
17421
|
makeCall(e, t) {
|
|
17422
17422
|
if (!t?.id) {
|
|
17423
|
-
|
|
17423
|
+
Le ? console.warn("Can not make a call: mediastream has no id or is undefined") : console.debug("Can not make a call: mediastream has no id or is undefined");
|
|
17424
17424
|
return;
|
|
17425
17425
|
}
|
|
17426
17426
|
const i = {
|
|
@@ -17432,10 +17432,10 @@ class to extends dm {
|
|
|
17432
17432
|
}, n = this._peer?.call(e, t, i);
|
|
17433
17433
|
if (n) {
|
|
17434
17434
|
const o = this.registerCall(n, "outgoing", t);
|
|
17435
|
-
return
|
|
17435
|
+
return Le && console.warn(`📞 CALL ${e}`, `
|
|
17436
17436
|
Outgoing:`, this._outgoingCalls, `
|
|
17437
17437
|
Incoming:`, this._incomingCalls), o;
|
|
17438
|
-
} else
|
|
17438
|
+
} else Le && console.error("Failed to make call", e, t, this._peer);
|
|
17439
17439
|
}
|
|
17440
17440
|
closeAll() {
|
|
17441
17441
|
for (const e of this._incomingCalls)
|
|
@@ -17452,7 +17452,7 @@ Incoming:`, this._incomingCalls), o;
|
|
|
17452
17452
|
for (let e = this._outgoingCalls.length - 1; e >= 0; e--) {
|
|
17453
17453
|
const t = this._outgoingCalls[e];
|
|
17454
17454
|
let i = !1;
|
|
17455
|
-
t.isClosed && !t.isOpening && (t.stream?.active ?
|
|
17455
|
+
t.isClosed && !t.isOpening && (t.stream?.active ? Le && console.warn("!!! Stream is still active, don't remove call", t.userId, "Your id: " + this.context.connection.connectionId) : (Le && console.warn("!!! Remove closed call", t.userId), i = !0)), this.context.connection.userIsInRoom(t.userId) === !1 && (Le && console.warn("!!! User is not in room anymore, remove call", t.userId), i = !0), i && (t.close(), this._outgoingCalls.splice(e, 1));
|
|
17456
17456
|
}
|
|
17457
17457
|
};
|
|
17458
17458
|
get peer() {
|
|
@@ -17468,10 +17468,11 @@ Incoming:`, this._incomingCalls), o;
|
|
|
17468
17468
|
_peer;
|
|
17469
17469
|
constructor(e, t) {
|
|
17470
17470
|
super(), this.context = e, this.id = t, this.setupPeer();
|
|
17471
|
+
const i = Object.getOwnPropertyDescriptor(navigator, "getUserMedia")?.writable;
|
|
17471
17472
|
try {
|
|
17472
|
-
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
|
17473
|
-
} catch (
|
|
17474
|
-
|
|
17473
|
+
i ? navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia : Le && console.warn("[PeerJs] getUserMedia is not writable");
|
|
17474
|
+
} catch (n) {
|
|
17475
|
+
Le && console.error("[PeerJs] Error setting getUserMedia", n);
|
|
17475
17476
|
}
|
|
17476
17477
|
}
|
|
17477
17478
|
_enabled = !1;
|
|
@@ -17512,7 +17513,7 @@ Incoming:`, this._incomingCalls), o;
|
|
|
17512
17513
|
* @param id ID of the peer
|
|
17513
17514
|
*/
|
|
17514
17515
|
onPeerConnect = (e) => {
|
|
17515
|
-
if (
|
|
17516
|
+
if (Le && console.log("PEER opened as", e), e === null) {
|
|
17516
17517
|
console.error("Peer connection failed", e);
|
|
17517
17518
|
return;
|
|
17518
17519
|
}
|
|
@@ -17520,17 +17521,17 @@ Incoming:`, this._incomingCalls), o;
|
|
|
17520
17521
|
};
|
|
17521
17522
|
/** Emitted when the peer is destroyed and can no longer accept or create any new connections. At this time, the peer's connections will all be closed. */
|
|
17522
17523
|
onPeerClose = () => {
|
|
17523
|
-
|
|
17524
|
+
Le && console.log("PEER closed"), this.updateCalls();
|
|
17524
17525
|
};
|
|
17525
17526
|
/** Emitted when the peer is disconnected from the signalling server, either manually or because the connection to the signalling server was lost. */
|
|
17526
17527
|
onPeerDisconnected = () => {
|
|
17527
|
-
|
|
17528
|
+
Le && console.log("PEER disconnected"), this.updateCalls();
|
|
17528
17529
|
};
|
|
17529
17530
|
/**
|
|
17530
17531
|
* Errors on the peer are almost always fatal and will destroy the peer. Errors from the underlying socket and PeerConnections are forwarded here.
|
|
17531
17532
|
*/
|
|
17532
17533
|
onPeerError = (e) => {
|
|
17533
|
-
|
|
17534
|
+
Le && console.error("PEER error", e);
|
|
17534
17535
|
};
|
|
17535
17536
|
onPeerReceivingCall = (e) => {
|
|
17536
17537
|
e.answer(void 0, {
|
|
@@ -17541,12 +17542,12 @@ Incoming:`, this._incomingCalls), o;
|
|
|
17541
17542
|
const n = e.metadata;
|
|
17542
17543
|
(!n || !n.userId) && console.error("Missing call metadata", e);
|
|
17543
17544
|
const o = n.userId;
|
|
17544
|
-
t === "incoming" &&
|
|
17545
|
+
t === "incoming" && Le ? console.warn("← Receive call from", e.metadata, e.connectionId) : Le && console.warn("→ Make call to", e.metadata);
|
|
17545
17546
|
const r = t === "incoming" ? this._incomingCalls : this._outgoingCalls, a = new xk(o, e, t, i);
|
|
17546
17547
|
return r.push(a), e.on("error", (l) => {
|
|
17547
17548
|
console.error("Call error", l);
|
|
17548
17549
|
}), e.on("close", () => {
|
|
17549
|
-
|
|
17550
|
+
Le && console.log("Call ended", e.metadata);
|
|
17550
17551
|
const l = r.indexOf(a);
|
|
17551
17552
|
l !== -1 && r.splice(l, 1), a.close(), this.dispatchEvent(new X0(o, t));
|
|
17552
17553
|
}), a.addEventListener("call-ended", (l) => {
|
|
@@ -17554,11 +17555,11 @@ Incoming:`, this._incomingCalls), o;
|
|
|
17554
17555
|
}), t === "incoming" && (a.addEventListener("receive-stream", (l) => {
|
|
17555
17556
|
this.dispatchEvent(l);
|
|
17556
17557
|
}), e.on("stream", () => {
|
|
17557
|
-
|
|
17558
|
+
Le && console.log("Received stream for call", e.metadata);
|
|
17558
17559
|
let l = 0;
|
|
17559
17560
|
const c = setInterval(() => {
|
|
17560
17561
|
const h = l === 0;
|
|
17561
|
-
!a.isOpen && h && (
|
|
17562
|
+
!a.isOpen && h && (Le && console.warn("Close call because stream is not active", e.metadata), l += 1, clearInterval(c), a.close());
|
|
17562
17563
|
}, 2e3);
|
|
17563
17564
|
})), a;
|
|
17564
17565
|
}
|
|
@@ -17591,7 +17592,7 @@ class Jd extends dm {
|
|
|
17591
17592
|
if (!(e instanceof N)) throw new Error("Failed to create NetworkedStreams because context is not an instance of Context");
|
|
17592
17593
|
} else throw new Error("Failed to create NetworkedStreams because context is undefined");
|
|
17593
17594
|
if (!t) throw new Error("Failed to create NetworkedStreams because peer is undefined");
|
|
17594
|
-
this.context = e, this.peer = t,
|
|
17595
|
+
this.context = e, this.peer = t, Le && (this.debug = !0);
|
|
17595
17596
|
}
|
|
17596
17597
|
startSendingStream(e) {
|
|
17597
17598
|
this._sendingStreams.has(e) ? console.warn("Received start sending stream with stream that is already being sent") : (this._sendingStreams.set(e, []), this.updateSendingCalls());
|
|
@@ -17653,7 +17654,7 @@ class Jd extends dm {
|
|
|
17653
17654
|
const t = this._sendingStreams.keys().next().value;
|
|
17654
17655
|
this.peer.makeCall(e.peerId, t);
|
|
17655
17656
|
} else
|
|
17656
|
-
|
|
17657
|
+
Le && console.log("Unknown user connected", e.guid, e.peerId);
|
|
17657
17658
|
};
|
|
17658
17659
|
onUserLeft = (e) => {
|
|
17659
17660
|
this.debug && console.log("User left room: " + e.userId), this.stopCallsToUsersThatAreNotInTheRoomAnymore();
|
|
@@ -17666,7 +17667,7 @@ class Jd extends dm {
|
|
|
17666
17667
|
if (n === e) continue;
|
|
17667
17668
|
const o = this.peer.getPeerIdFromUserId(n);
|
|
17668
17669
|
if (i.find((a) => a.peerId === o && a.direction === "outgoing" && !a.isClosed && a.stream?.active))
|
|
17669
|
-
|
|
17670
|
+
Le && console.debug("Already have a call with user " + n + " / peer " + o);
|
|
17670
17671
|
else {
|
|
17671
17672
|
const a = this.peer.makeCall(o, t);
|
|
17672
17673
|
a && i.push(a);
|
|
@@ -17697,7 +17698,7 @@ class Jd extends dm {
|
|
|
17697
17698
|
if (t)
|
|
17698
17699
|
for (let i = t.length - 1; i >= 0; i--) {
|
|
17699
17700
|
const n = t[i];
|
|
17700
|
-
this.context.connection.userIsInRoom(n.userId) ?
|
|
17701
|
+
this.context.connection.userIsInRoom(n.userId) ? Le && (this.context.connection.connectionId === n.userId ? console.warn(`You are still in the room [${i}] ${n.userId}`) : console.log(`User is still in room [${i}] ${n.userId}`)) : (Le && console.log(`Remove call ${[i]} to user that is not in room anymore ${n.userId}`), n.close(), t.splice(i, 1));
|
|
17701
17702
|
}
|
|
17702
17703
|
}
|
|
17703
17704
|
this.peer.updateCalls(), this.debug && this.debugLogCurrentState();
|
|
@@ -17895,7 +17896,7 @@ class eu extends T {
|
|
|
17895
17896
|
mouthChangeLength = 0;
|
|
17896
17897
|
awake() {
|
|
17897
17898
|
setTimeout(() => {
|
|
17898
|
-
this.voip = x.findObjectOfType(yr, this.context), this.marker || (this.marker = x.getComponentInParent(this.gameObject,
|
|
17899
|
+
this.voip = x.findObjectOfType(yr, this.context), this.marker || (this.marker = x.getComponentInParent(this.gameObject, je));
|
|
17899
17900
|
}, 3e3);
|
|
17900
17901
|
}
|
|
17901
17902
|
update() {
|
|
@@ -17953,7 +17954,7 @@ class Y0 extends T {
|
|
|
17953
17954
|
marker = null;
|
|
17954
17955
|
_startPosition = null;
|
|
17955
17956
|
awake() {
|
|
17956
|
-
this.voip = x.findObjectOfType(yr, this.context), this.marker = x.getComponentInParent(this.gameObject,
|
|
17957
|
+
this.voip = x.findObjectOfType(yr, this.context), this.marker = x.getComponentInParent(this.gameObject, je);
|
|
17957
17958
|
}
|
|
17958
17959
|
update() {
|
|
17959
17960
|
if (!this.voip || !this.marker || this.context.time.frameCount % 10 !== 0) return;
|
|
@@ -24576,7 +24577,7 @@ class La {
|
|
|
24576
24577
|
}
|
|
24577
24578
|
}
|
|
24578
24579
|
}
|
|
24579
|
-
var JM = Object.defineProperty,
|
|
24580
|
+
var JM = Object.defineProperty, Fe = (s, e, t, i) => {
|
|
24580
24581
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
24581
24582
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
24582
24583
|
return n && JM(e, t, n), n;
|
|
@@ -24632,16 +24633,16 @@ class Da extends T {
|
|
|
24632
24633
|
}
|
|
24633
24634
|
}
|
|
24634
24635
|
}
|
|
24635
|
-
|
|
24636
|
+
Fe([
|
|
24636
24637
|
u(M)
|
|
24637
24638
|
], Da.prototype, "object");
|
|
24638
|
-
|
|
24639
|
+
Fe([
|
|
24639
24640
|
u(M)
|
|
24640
24641
|
], Da.prototype, "target");
|
|
24641
|
-
|
|
24642
|
+
Fe([
|
|
24642
24643
|
u()
|
|
24643
24644
|
], Da.prototype, "duration");
|
|
24644
|
-
|
|
24645
|
+
Fe([
|
|
24645
24646
|
u()
|
|
24646
24647
|
], Da.prototype, "relativeMotion");
|
|
24647
24648
|
const lu = class Ut extends T {
|
|
@@ -24736,13 +24737,13 @@ const lu = class Ut extends T {
|
|
|
24736
24737
|
return e;
|
|
24737
24738
|
}
|
|
24738
24739
|
};
|
|
24739
|
-
|
|
24740
|
+
Fe([
|
|
24740
24741
|
u(_e)
|
|
24741
24742
|
], lu.prototype, "materialToSwitch");
|
|
24742
|
-
|
|
24743
|
+
Fe([
|
|
24743
24744
|
u(_e)
|
|
24744
24745
|
], lu.prototype, "variantMaterial");
|
|
24745
|
-
|
|
24746
|
+
Fe([
|
|
24746
24747
|
u()
|
|
24747
24748
|
], lu.prototype, "fadeDuration");
|
|
24748
24749
|
let Iv = lu;
|
|
@@ -24825,16 +24826,16 @@ const Sc = class Ae extends T {
|
|
|
24825
24826
|
this.gameObject[Ae.wasVisible] !== void 0 && (this.gameObject.visible = this.gameObject[Ae.wasVisible], delete this.gameObject[Ae.wasVisible]), this.target && this.target[Ae.wasVisible] !== void 0 && (this.target.visible = this.target[Ae.wasVisible], delete this.target[Ae.wasVisible]), delete this.gameObject[Ae.toggleClone], delete this.gameObject[Ae.reverseToggleClone];
|
|
24826
24827
|
}
|
|
24827
24828
|
};
|
|
24828
|
-
|
|
24829
|
+
Fe([
|
|
24829
24830
|
u(M)
|
|
24830
24831
|
], Sc.prototype, "target");
|
|
24831
|
-
|
|
24832
|
+
Fe([
|
|
24832
24833
|
u()
|
|
24833
24834
|
], Sc.prototype, "toggleOnClick");
|
|
24834
|
-
|
|
24835
|
+
Fe([
|
|
24835
24836
|
u()
|
|
24836
24837
|
], Sc.prototype, "targetState");
|
|
24837
|
-
|
|
24838
|
+
Fe([
|
|
24838
24839
|
u()
|
|
24839
24840
|
], Sc.prototype, "hideSelf");
|
|
24840
24841
|
let Lv = Sc;
|
|
@@ -24882,13 +24883,13 @@ class Cc extends T {
|
|
|
24882
24883
|
afterCreateDocument(e, t) {
|
|
24883
24884
|
}
|
|
24884
24885
|
}
|
|
24885
|
-
|
|
24886
|
+
Fe([
|
|
24886
24887
|
u()
|
|
24887
24888
|
], Cc.prototype, "target");
|
|
24888
|
-
|
|
24889
|
+
Fe([
|
|
24889
24890
|
u()
|
|
24890
24891
|
], Cc.prototype, "duration");
|
|
24891
|
-
|
|
24892
|
+
Fe([
|
|
24892
24893
|
u()
|
|
24893
24894
|
], Cc.prototype, "motionType");
|
|
24894
24895
|
class or extends T {
|
|
@@ -24947,13 +24948,13 @@ class or extends T {
|
|
|
24947
24948
|
}
|
|
24948
24949
|
}
|
|
24949
24950
|
}
|
|
24950
|
-
|
|
24951
|
+
Fe([
|
|
24951
24952
|
u(hn)
|
|
24952
24953
|
], or.prototype, "target");
|
|
24953
|
-
|
|
24954
|
+
Fe([
|
|
24954
24955
|
u(URL)
|
|
24955
24956
|
], or.prototype, "clip");
|
|
24956
|
-
|
|
24957
|
+
Fe([
|
|
24957
24958
|
u()
|
|
24958
24959
|
], or.prototype, "toggleOnClick");
|
|
24959
24960
|
const lg = class bn extends T {
|
|
@@ -25155,10 +25156,10 @@ const lg = class bn extends T {
|
|
|
25155
25156
|
n && (this.animationSequence = n.animationSequence, this.animationLoopAfterSequence = n.animationLoopAfterSequence, this.randomOffsetNormalized = n.randomTimeOffset, this.stateAnimationModel = t);
|
|
25156
25157
|
}
|
|
25157
25158
|
};
|
|
25158
|
-
|
|
25159
|
+
Fe([
|
|
25159
25160
|
u(It)
|
|
25160
25161
|
], lg.prototype, "animator");
|
|
25161
|
-
|
|
25162
|
+
Fe([
|
|
25162
25163
|
u()
|
|
25163
25164
|
], lg.prototype, "stateName");
|
|
25164
25165
|
let gd = lg;
|
|
@@ -25169,13 +25170,13 @@ class Pc extends T {
|
|
|
25169
25170
|
getDuration() {
|
|
25170
25171
|
}
|
|
25171
25172
|
}
|
|
25172
|
-
|
|
25173
|
+
Fe([
|
|
25173
25174
|
u(M)
|
|
25174
25175
|
], Pc.prototype, "target");
|
|
25175
25176
|
class cu extends T {
|
|
25176
25177
|
target;
|
|
25177
25178
|
}
|
|
25178
|
-
|
|
25179
|
+
Fe([
|
|
25179
25180
|
u(Pc)
|
|
25180
25181
|
], cu.prototype, "target");
|
|
25181
25182
|
class hu extends Pc {
|
|
@@ -25193,10 +25194,10 @@ class hu extends Pc {
|
|
|
25193
25194
|
return this.duration;
|
|
25194
25195
|
}
|
|
25195
25196
|
}
|
|
25196
|
-
|
|
25197
|
+
Fe([
|
|
25197
25198
|
u()
|
|
25198
25199
|
], hu.prototype, "type");
|
|
25199
|
-
|
|
25200
|
+
Fe([
|
|
25200
25201
|
u()
|
|
25201
25202
|
], hu.prototype, "duration");
|
|
25202
25203
|
class Dv extends cu {
|
|
@@ -25283,7 +25284,7 @@ class tr {
|
|
|
25283
25284
|
const e = "https://oculus.com/open_url/?url=", t = document.createElement("button");
|
|
25284
25285
|
return this._sendToQuestButton = t, t.dataset.needle = "webxr-sendtoquest-button", t.innerText = "Open on Quest", t.prepend(Rt("share_windows")), t.title = "Click to send this page to the Oculus Browser on your Quest", t.addEventListener("click", () => {
|
|
25285
25286
|
const i = encodeURIComponent(window.location.href), n = e + i;
|
|
25286
|
-
window.open(n) == null &&
|
|
25287
|
+
window.open(n) == null && Be("This page doesn't allow popups. Please paste " + n + " into your browser.");
|
|
25287
25288
|
}), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => {
|
|
25288
25289
|
navigator.xr?.isSessionSupported("immersive-vr") ? t.style.display = "none" : t.style.display = "";
|
|
25289
25290
|
}), t;
|
|
@@ -26400,12 +26401,12 @@ class ar extends T {
|
|
|
26400
26401
|
rl && console.warn("AVATAR ENTER XR", this.guid, this.sourceId, this, this.activeAndEnabled), this._syncTransforms && (this._syncTransforms.length = 0), await this.prepareAvatar();
|
|
26401
26402
|
const t = En.getFor(this);
|
|
26402
26403
|
if (t?.owner) {
|
|
26403
|
-
const i = this.gameObject.addComponent(
|
|
26404
|
+
const i = this.gameObject.addComponent(je);
|
|
26404
26405
|
i.avatar = this.gameObject, i.connectionId = t.owner;
|
|
26405
26406
|
} else this.context.connection.isConnected ? console.error("No player state found for avatar", this) : t && !this.context.connection.isConnected && (t.dontDestroy = !0);
|
|
26406
26407
|
}
|
|
26407
26408
|
onLeaveXR(e) {
|
|
26408
|
-
const t = this.gameObject.getComponent(
|
|
26409
|
+
const t = this.gameObject.getComponent(je);
|
|
26409
26410
|
t && t.destroy();
|
|
26410
26411
|
}
|
|
26411
26412
|
onUpdateXR(e) {
|
|
@@ -29027,11 +29028,11 @@ const si = class Wp extends T {
|
|
|
29027
29028
|
/** @internal */
|
|
29028
29029
|
onEnable() {
|
|
29029
29030
|
const e = q.supportsQuickLookAR(), t = q.isiOS() || q.isiPad();
|
|
29030
|
-
!this.button && (oi || e || t) && (this.allowCreateQuicklookButton && (this.button = this.createQuicklookButton()), this.lastCallback = this.quicklookCallback.bind(this), this.link = j_(this.context, e), this.link.addEventListener("message", this.lastCallback)), oi &&
|
|
29031
|
+
!this.button && (oi || e || t) && (this.allowCreateQuicklookButton && (this.button = this.createQuicklookButton()), this.lastCallback = this.quicklookCallback.bind(this), this.link = j_(this.context, e), this.link.addEventListener("message", this.lastCallback)), oi && Be("USDZ Exporter enabled: " + this.name), document.getElementById("open-in-ar")?.addEventListener("click", this.onClickedOpenInARElement), ic.registerExporter(this);
|
|
29031
29032
|
}
|
|
29032
29033
|
/** @internal */
|
|
29033
29034
|
onDisable() {
|
|
29034
|
-
this.button?.remove(), this.link?.removeEventListener("message", this.lastCallback), oi &&
|
|
29035
|
+
this.button?.remove(), this.link?.removeEventListener("message", this.lastCallback), oi && Be("USDZ Exporter disabled: " + this.name), document.getElementById("open-in-ar")?.removeEventListener("click", this.onClickedOpenInARElement), ic.unregisterExporter(this);
|
|
29035
29036
|
}
|
|
29036
29037
|
onClickedOpenInARElement = (e) => {
|
|
29037
29038
|
e.preventDefault(), this.exportAndOpen();
|
|
@@ -29103,7 +29104,7 @@ const si = class Wp extends T {
|
|
|
29103
29104
|
}));
|
|
29104
29105
|
}
|
|
29105
29106
|
}
|
|
29106
|
-
oi &&
|
|
29107
|
+
oi && Be("Progressive Loading: " + n.length), await Promise.all(n), oi && Be("Progressive Loading: done"), le.end("export-usdz-textures");
|
|
29107
29108
|
const r = Jt.Global.Mask;
|
|
29108
29109
|
Jt.Global.Set(us.AR);
|
|
29109
29110
|
const a = new jM(), l = new ag(this.quickLookCompatible);
|
|
@@ -29186,7 +29187,7 @@ const si = class Wp extends T {
|
|
|
29186
29187
|
const i = new URLSearchParams(this.link.href);
|
|
29187
29188
|
if (i) {
|
|
29188
29189
|
const n = i.get("callToActionURL");
|
|
29189
|
-
oi &&
|
|
29190
|
+
oi && Be("Quicklook url: " + n), n && (bs() ? globalThis.open(n, "_blank") : console.warn("Quicklook closed: custom redirects require a Needle Engine Pro license: https://needle.tools/pricing", n));
|
|
29190
29191
|
}
|
|
29191
29192
|
}
|
|
29192
29193
|
}
|
|
@@ -31509,7 +31510,7 @@ class ow {
|
|
|
31509
31510
|
), this.particleSystem.worldSpace || i.multiplyMatrices(this._emitterMatrix, i), this.subParticleSystem.emit(t, e.emissionState, i);
|
|
31510
31511
|
}
|
|
31511
31512
|
}
|
|
31512
|
-
var oT = Object.defineProperty,
|
|
31513
|
+
var oT = Object.defineProperty, ze = (s, e, t, i) => {
|
|
31513
31514
|
for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
|
|
31514
31515
|
(r = s[o]) && (n = r(e, t, n) || n);
|
|
31515
31516
|
return n && oT(e, t, n), n;
|
|
@@ -31559,28 +31560,28 @@ class mn extends T {
|
|
|
31559
31560
|
return new H(t, this.getMaterial());
|
|
31560
31561
|
}
|
|
31561
31562
|
}
|
|
31562
|
-
|
|
31563
|
+
ze([
|
|
31563
31564
|
u()
|
|
31564
31565
|
], mn.prototype, "renderMode");
|
|
31565
|
-
|
|
31566
|
+
ze([
|
|
31566
31567
|
u(_e)
|
|
31567
31568
|
], mn.prototype, "particleMaterial");
|
|
31568
|
-
|
|
31569
|
+
ze([
|
|
31569
31570
|
u(_e)
|
|
31570
31571
|
], mn.prototype, "trailMaterial");
|
|
31571
|
-
|
|
31572
|
+
ze([
|
|
31572
31573
|
u()
|
|
31573
31574
|
], mn.prototype, "maxParticleSize");
|
|
31574
|
-
|
|
31575
|
+
ze([
|
|
31575
31576
|
u()
|
|
31576
31577
|
], mn.prototype, "minParticleSize");
|
|
31577
|
-
|
|
31578
|
+
ze([
|
|
31578
31579
|
u()
|
|
31579
31580
|
], mn.prototype, "velocityScale");
|
|
31580
|
-
|
|
31581
|
+
ze([
|
|
31581
31582
|
u()
|
|
31582
31583
|
], mn.prototype, "cameraVelocityScale");
|
|
31583
|
-
|
|
31584
|
+
ze([
|
|
31584
31585
|
u()
|
|
31585
31586
|
], mn.prototype, "lengthScale");
|
|
31586
31587
|
class vh {
|
|
@@ -32217,49 +32218,49 @@ const jt = class Uh extends T {
|
|
|
32217
32218
|
}
|
|
32218
32219
|
}
|
|
32219
32220
|
};
|
|
32220
|
-
|
|
32221
|
+
ze([
|
|
32221
32222
|
u(Cg)
|
|
32222
32223
|
], jt.prototype, "colorOverLifetime");
|
|
32223
|
-
|
|
32224
|
+
ze([
|
|
32224
32225
|
u(Qt)
|
|
32225
32226
|
], jt.prototype, "main");
|
|
32226
|
-
|
|
32227
|
+
ze([
|
|
32227
32228
|
u(Co)
|
|
32228
32229
|
], jt.prototype, "emission");
|
|
32229
|
-
|
|
32230
|
+
ze([
|
|
32230
32231
|
u(Va)
|
|
32231
32232
|
], jt.prototype, "sizeOverLifetime");
|
|
32232
|
-
|
|
32233
|
+
ze([
|
|
32233
32234
|
u(iw)
|
|
32234
32235
|
], jt.prototype, "shape");
|
|
32235
|
-
|
|
32236
|
+
ze([
|
|
32236
32237
|
u(ve)
|
|
32237
32238
|
], jt.prototype, "noise");
|
|
32238
|
-
|
|
32239
|
+
ze([
|
|
32239
32240
|
u(Ne)
|
|
32240
32241
|
], jt.prototype, "trails");
|
|
32241
|
-
|
|
32242
|
+
ze([
|
|
32242
32243
|
u(Ve)
|
|
32243
32244
|
], jt.prototype, "velocityOverLifetime");
|
|
32244
|
-
|
|
32245
|
+
ze([
|
|
32245
32246
|
u(yt)
|
|
32246
32247
|
], jt.prototype, "limitVelocityOverLifetime");
|
|
32247
|
-
|
|
32248
|
+
ze([
|
|
32248
32249
|
u(sw)
|
|
32249
32250
|
], jt.prototype, "inheritVelocity");
|
|
32250
|
-
|
|
32251
|
+
ze([
|
|
32251
32252
|
u(Ic)
|
|
32252
32253
|
], jt.prototype, "colorBySpeed");
|
|
32253
|
-
|
|
32254
|
+
ze([
|
|
32254
32255
|
u(Yt)
|
|
32255
32256
|
], jt.prototype, "textureSheetAnimation");
|
|
32256
|
-
|
|
32257
|
+
ze([
|
|
32257
32258
|
u(Gn)
|
|
32258
32259
|
], jt.prototype, "rotationOverLifetime");
|
|
32259
|
-
|
|
32260
|
+
ze([
|
|
32260
32261
|
u(pn)
|
|
32261
32262
|
], jt.prototype, "rotationBySpeed");
|
|
32262
|
-
|
|
32263
|
+
ze([
|
|
32263
32264
|
u(Oi)
|
|
32264
32265
|
], jt.prototype, "sizeBySpeed");
|
|
32265
32266
|
let bd = jt;
|
|
@@ -32308,7 +32309,7 @@ class uc extends T {
|
|
|
32308
32309
|
const e = x.getComponentInParent(this.gameObject, En);
|
|
32309
32310
|
if (e && e.owner)
|
|
32310
32311
|
return this._didAssignPlayerColor = !0, this.assignUserColor(e.owner), !0;
|
|
32311
|
-
const t = x.getComponentInParent(this.gameObject,
|
|
32312
|
+
const t = x.getComponentInParent(this.gameObject, je);
|
|
32312
32313
|
return t?.connectionId ? (this._didAssignPlayerColor = !0, this.assignUserColor(t.connectionId), !0) : !1;
|
|
32313
32314
|
};
|
|
32314
32315
|
assignUserColor(e) {
|
|
@@ -33593,7 +33594,7 @@ class Dc extends T {
|
|
|
33593
33594
|
/** @internal */
|
|
33594
33595
|
awake() {
|
|
33595
33596
|
Bo && (console.log("PostprocessingManager Awake", this), console.log("Press P to toggle post processing"), window.addEventListener("keydown", (e) => {
|
|
33596
|
-
e.key === "p" && (this.enabled = !this.enabled,
|
|
33597
|
+
e.key === "p" && (this.enabled = !this.enabled, Be("Toggle PostProcessing " + this.name + ": Enabled=" + this.enabled), this.markDirty());
|
|
33597
33598
|
})), this.sharedProfile?.__init(this);
|
|
33598
33599
|
}
|
|
33599
33600
|
_componentEnabledTime = -1;
|
|
@@ -33791,7 +33792,7 @@ class Ze extends T {
|
|
|
33791
33792
|
}
|
|
33792
33793
|
/** @internal */
|
|
33793
33794
|
async onEnable() {
|
|
33794
|
-
if (globalThis.addEventListener("popstate", this.onPopState), this.context.input.addEventListener(
|
|
33795
|
+
if (globalThis.addEventListener("popstate", this.onPopState), this.context.input.addEventListener(De.KeyDown, this.onInputKeyDown), this.context.input.addEventListener(De.PointerMove, this.onInputPointerMove), this.context.input.addEventListener(De.PointerUp, this.onInputPointerUp), this._engineElementOverserver || (this._engineElementOverserver = new MutationObserver((e) => {
|
|
33795
33796
|
for (const t of e)
|
|
33796
33797
|
if (t.type === "attributes" && t.attributeName === $h) {
|
|
33797
33798
|
const i = this.context.domElement.getAttribute($h);
|
|
@@ -33823,7 +33824,7 @@ class Ze extends T {
|
|
|
33823
33824
|
}
|
|
33824
33825
|
/** @internal */
|
|
33825
33826
|
onDisable() {
|
|
33826
|
-
if (globalThis.removeEventListener("popstate", this.onPopState), this.context.input.removeEventListener(
|
|
33827
|
+
if (globalThis.removeEventListener("popstate", this.onPopState), this.context.input.removeEventListener(De.KeyDown, this.onInputKeyDown), this.context.input.removeEventListener(De.PointerMove, this.onInputPointerMove), this.context.input.removeEventListener(De.PointerUp, this.onInputPointerUp), this._preloadScheduler?.stop(), this._menuButtons) {
|
|
33827
33828
|
for (const e of this._menuButtons)
|
|
33828
33829
|
e.remove();
|
|
33829
33830
|
this._menuButtons = void 0;
|
|
@@ -35860,7 +35861,7 @@ class Lg extends T {
|
|
|
35860
35861
|
*/
|
|
35861
35862
|
setAvatarFlagsBeforeRender() {
|
|
35862
35863
|
const e = this._mode === 0;
|
|
35863
|
-
for (const t of
|
|
35864
|
+
for (const t of je.instances)
|
|
35864
35865
|
if (t.avatar && "isLocalAvatar" in t.avatar && "flags" in t.avatar) {
|
|
35865
35866
|
let i = us.All;
|
|
35866
35867
|
this.isSpectatingSelf && (i = e && t.avatar.isLocalAvatar ? us.FirstPerson : us.ThirdPerson);
|
|
@@ -35874,7 +35875,7 @@ class Lg extends T {
|
|
|
35874
35875
|
* Restores avatar visibility flags after spectator rendering
|
|
35875
35876
|
*/
|
|
35876
35877
|
resetAvatarFlags() {
|
|
35877
|
-
for (const e of
|
|
35878
|
+
for (const e of je.instances)
|
|
35878
35879
|
if (e.avatar && "flags" in e.avatar) {
|
|
35879
35880
|
const t = e.avatar.flags;
|
|
35880
35881
|
if (!t) continue;
|
|
@@ -35960,9 +35961,9 @@ class OE {
|
|
|
35960
35961
|
n.key === "Escape" && this.spectator.stopSpectating();
|
|
35961
35962
|
});
|
|
35962
35963
|
let i = 0;
|
|
35963
|
-
this.context.input.addEventListener(
|
|
35964
|
+
this.context.input.addEventListener(De.PointerDown, (n) => {
|
|
35964
35965
|
i = this.context.time.time;
|
|
35965
|
-
}), this.context.input.addEventListener(
|
|
35966
|
+
}), this.context.input.addEventListener(De.PointerUp, (n) => {
|
|
35966
35967
|
const o = this.context.time.time - i;
|
|
35967
35968
|
o > 1 ? this.spectator.stopSpectating() : this.context.input.getPointerClicked(0) && o < 0.3 && this.trySelectObject();
|
|
35968
35969
|
});
|
|
@@ -35977,7 +35978,7 @@ class OE {
|
|
|
35977
35978
|
if (pi && console.log(...t), t?.length)
|
|
35978
35979
|
for (const i of t) {
|
|
35979
35980
|
if (i.distance < 0.2) continue;
|
|
35980
|
-
const n = i.object, o = x.getComponentInParent(n,
|
|
35981
|
+
const n = i.object, o = x.getComponentInParent(n, je), r = o?.connectionId;
|
|
35981
35982
|
if (r) {
|
|
35982
35983
|
const a = this.context.players.getPlayerView(r);
|
|
35983
35984
|
this.spectator.target = a, pi && console.log("spectate", r, o);
|
|
@@ -36259,7 +36260,7 @@ const xw = class em extends T {
|
|
|
36259
36260
|
l.context = this.context;
|
|
36260
36261
|
const c = x.instantiate(this.cameraPrefab, l);
|
|
36261
36262
|
n = this.remoteCams[t] = { obj: c, lastUpdate: this.context.time.realtimeSinceStartup, userId: i }, n.obj.visible = !0, this.gameObject.add(c), this.userToCamMap[i] = t, em.instances.push(n);
|
|
36262
|
-
const h = x.getOrAddComponent(c,
|
|
36263
|
+
const h = x.getOrAddComponent(c, je);
|
|
36263
36264
|
h.connectionId = i, h.avatar = c;
|
|
36264
36265
|
} else
|
|
36265
36266
|
return;
|
|
@@ -36420,7 +36421,7 @@ C) Set "joinRandomRoom" to true`), !1) : (qf && console.log("Join " + this.roomN
|
|
|
36420
36421
|
const t = this.getViewOnlyUrl();
|
|
36421
36422
|
t?.length ? navigator.canShare({ url: t }) ? navigator.share({ url: t })?.catch((i) => {
|
|
36422
36423
|
console.warn(i);
|
|
36423
|
-
}) : (navigator.clipboard.writeText(t),
|
|
36424
|
+
}) : (navigator.clipboard.writeText(t), Be("View only URL copied to clipboard")) : me("Could not create view only URL");
|
|
36424
36425
|
}, e.title = "Copy the view only URL: A page accessed by the view only URL can not be modified by visiting users.", e.textContent = "Share View URL", e.prepend(Rt("visibility"));
|
|
36425
36426
|
}
|
|
36426
36427
|
this.context.menu.appendChild(this._viewOnlyButton);
|
|
@@ -37791,7 +37792,7 @@ class Mo extends T {
|
|
|
37791
37792
|
Fo && console.warn("Button Up", this.animationTriggers?.highlightedTrigger, this.animator, this._isHovered), this.interactable && (this.transition == 3 && this.animationTriggers && this.animator ? this.animator.setTrigger(this._isHovered ? this.animationTriggers.highlightedTrigger : this.animationTriggers.normalTrigger) : this.transition === 1 && this.colors && this._image?.setState(this._isHovered ? "hovered" : "normal"));
|
|
37792
37793
|
}
|
|
37793
37794
|
onPointerClick(e) {
|
|
37794
|
-
if (this.interactable && !(e.button !== 0 && e.event.pointerType === Pm.Mouse) && (Fo && (console.warn("Button Click", this.onClick),
|
|
37795
|
+
if (this.interactable && !(e.button !== 0 && e.event.pointerType === Pm.Mouse) && (Fo && (console.warn("Button Click", this.onClick), Be("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), e.use(), Fo))) {
|
|
37795
37796
|
const t = this.gameObject.worldPosition;
|
|
37796
37797
|
t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), F.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
|
|
37797
37798
|
}
|
|
@@ -38365,7 +38366,7 @@ class Wc extends T {
|
|
|
38365
38366
|
}
|
|
38366
38367
|
this._validateUrl();
|
|
38367
38368
|
let e = this.url;
|
|
38368
|
-
switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), L() &&
|
|
38369
|
+
switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), L() && Be("Open URL: " + e), this.mode) {
|
|
38369
38370
|
case 0:
|
|
38370
38371
|
q.isSafari(), globalThis.open(e, "_blank");
|
|
38371
38372
|
break;
|
|
@@ -39542,7 +39543,7 @@ P.add("TeleportTarget", ug);
|
|
|
39542
39543
|
P.add("WebARCameraBackground", zu);
|
|
39543
39544
|
P.add("WebARSessionRoot", $i);
|
|
39544
39545
|
P.add("WebXR", fg);
|
|
39545
|
-
P.add("AvatarMarker",
|
|
39546
|
+
P.add("AvatarMarker", je);
|
|
39546
39547
|
P.add("WebXRImageTracking", Pd);
|
|
39547
39548
|
P.add("WebXRPlaneTracking", Ao);
|
|
39548
39549
|
P.add("XRRig", Vg);
|
|
@@ -39631,7 +39632,7 @@ async function sm(s, e, t, i) {
|
|
|
39631
39632
|
}
|
|
39632
39633
|
if (ul.length > 0) {
|
|
39633
39634
|
const r = ul.join(", ");
|
|
39634
|
-
console.warn("unknown components: " + r), ul.length = 0, ti() &&
|
|
39635
|
+
console.warn("unknown components: " + r), ul.length = 0, ti() && Be(`<strong>Unknown components in scene</strong>:
|
|
39635
39636
|
|
|
39636
39637
|
${r}
|
|
39637
39638
|
|
|
@@ -39814,7 +39815,7 @@ function xA(s) {
|
|
|
39814
39815
|
if (new URL(s, window.location.href).href.startsWith("file://")) {
|
|
39815
39816
|
const t = `Hi - it looks like you are trying to load a local file which will not work. You need to use a webserver to serve your files.
|
|
39816
39817
|
Please refer to the documentation on <a href="https://fwd.needle.tools/needle-engine/docs/local-server">https://docs.needle.tools</a> or ask for help in our <a href="https://discord.needle.tools">discord community</a>`;
|
|
39817
|
-
|
|
39818
|
+
Be(t), console.warn(t);
|
|
39818
39819
|
}
|
|
39819
39820
|
}
|
|
39820
39821
|
function SA(s, e) {
|
|
@@ -41743,7 +41744,7 @@ const pL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
41743
41744
|
AvatarBlink_Simple: Ta,
|
|
41744
41745
|
AvatarEyeLook_Rotation: ev,
|
|
41745
41746
|
AvatarLoader: FA,
|
|
41746
|
-
AvatarMarker:
|
|
41747
|
+
AvatarMarker: je,
|
|
41747
41748
|
AvatarModel: Hw,
|
|
41748
41749
|
Avatar_Brain_LookAt: ud,
|
|
41749
41750
|
Avatar_MouthShapes: eu,
|
|
@@ -42008,11 +42009,7 @@ he.registerCallback(ce.ContextCreated, (s) => {
|
|
|
42008
42009
|
});
|
|
42009
42010
|
class NA extends NS {
|
|
42010
42011
|
constructor() {
|
|
42011
|
-
super(new Worker(new URL(
|
|
42012
|
-
/* @vite-ignore */
|
|
42013
|
-
"/generateMeshBVH.worker-2qGLkQjg.js",
|
|
42014
|
-
import.meta.url
|
|
42015
|
-
), { type: "module" })), this.name = "GenerateMeshBVHWorker";
|
|
42012
|
+
super(new Worker(URL.createObjectURL(new Blob(["import '" + `${new URL('./generateMeshBVH.worker-2qGLkQjg.js', import.meta.url).toString()}` + "';"], { type: 'text/javascript' })), { type: "module" })), this.name = "GenerateMeshBVHWorker";
|
|
42016
42013
|
}
|
|
42017
42014
|
runTask(e, t, i = {}) {
|
|
42018
42015
|
return new Promise((n, o) => {
|
|
@@ -42086,7 +42083,7 @@ export {
|
|
|
42086
42083
|
Ta as AvatarBlink_Simple,
|
|
42087
42084
|
ev as AvatarEyeLook_Rotation,
|
|
42088
42085
|
FA as AvatarLoader,
|
|
42089
|
-
|
|
42086
|
+
je as AvatarMarker,
|
|
42090
42087
|
Hw as AvatarModel,
|
|
42091
42088
|
ud as Avatar_Brain_LookAt,
|
|
42092
42089
|
eu as Avatar_MouthShapes,
|
|
@@ -42193,7 +42190,7 @@ export {
|
|
|
42193
42190
|
sw as InheritVelocityModule,
|
|
42194
42191
|
r1 as Input,
|
|
42195
42192
|
di as InputEventQueue,
|
|
42196
|
-
|
|
42193
|
+
De as InputEvents,
|
|
42197
42194
|
Rw as InputField,
|
|
42198
42195
|
ra as InstanceHandle,
|
|
42199
42196
|
Pa as InstancingHandler,
|
|
@@ -42608,7 +42605,7 @@ export {
|
|
|
42608
42605
|
Ud as setWorldRotationXYZ,
|
|
42609
42606
|
tc as setWorldScale,
|
|
42610
42607
|
Nd as showBalloonError,
|
|
42611
|
-
|
|
42608
|
+
Be as showBalloonMessage,
|
|
42612
42609
|
me as showBalloonWarning,
|
|
42613
42610
|
Hb as showDebugConsole,
|
|
42614
42611
|
pI as slerp,
|