@jdultra/threedtiles 14.0.23 → 14.0.25
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/assets/{rapier-CaKmQPsS.js → physicsRapier.worker-BMqv2qnC.js} +2482 -1982
- package/dist/assets/physicsRapier.worker-BMqv2qnC.js.map +1 -0
- package/dist/simulation/physics.d.ts +36 -2
- package/dist/threedtiles.cjs.js +11 -11
- package/dist/threedtiles.cjs.js.map +1 -1
- package/dist/threedtiles.es.js +143 -126
- package/dist/threedtiles.es.js.map +1 -1
- package/dist/threedtiles.umd.js +10 -10
- package/dist/threedtiles.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/physicsRapier.worker-D664sBAY.js +0 -393
- package/dist/assets/physicsRapier.worker-D664sBAY.js.map +0 -1
- package/dist/assets/rapier-CaKmQPsS.js.map +0 -1
package/dist/threedtiles.es.js
CHANGED
|
@@ -9,7 +9,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
9
9
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
10
10
|
var _vi_instances, B_fn, Q_fn, C_fn, a_fn, A_fn, g_fn, E_fn, I_fn, e_fn;
|
|
11
11
|
import * as J from "three";
|
|
12
|
-
import { Matrix3 as wI, Vector3 as wA, Box3 as sC, Matrix4 as iI, Ray as Te, BufferGeometry as BQ, LineBasicMaterial as Za, LineSegments as _a, TrianglesDrawMode as Oe, TriangleFanDrawMode as OQ, TriangleStripDrawMode as $a, BufferAttribute as aI, Loader as rC, LoaderUtils as eB, FileLoader as fI, MeshPhysicalMaterial as xg, Vector2 as TB, Color as tI, LinearSRGBColorSpace as kg, SRGBColorSpace as Yg, SpotLight as We, PointLight as Pe, DirectionalLight as Ve, Quaternion as AE, InstancedMesh as ze, InstancedBufferAttribute as WQ, Object3D as gE, TextureLoader as Xe, ImageBitmapLoader as Ze, InterleavedBuffer as _e, InterleavedBufferAttribute as $e, LinearMipmapLinearFilter as OB, NearestMipmapLinearFilter as Ai, LinearMipmapNearestFilter as gi, NearestMipmapNearestFilter as IE, LinearFilter as bI, NearestFilter as og, RepeatWrapping as PQ, MirroredRepeatWrapping as Ii, ClampToEdgeWrapping as Bi, PointsMaterial as Qi, Material as hQ, MeshStandardMaterial as RC, DoubleSide as Ci, MeshBasicMaterial as CB, PropertyBinding as ai, SkinnedMesh as Ei, Mesh as VQ, Line as ei, LineLoop as ii, Points as ti, Group as DQ, PerspectiveCamera as oi, MathUtils as ni, OrthographicCamera as BE, Skeleton as si, AnimationClip as ri, Bone as ci, InterpolateDiscrete as hi, InterpolateLinear as QE, Texture as kC, VectorKeyframeTrack as NC, NumberKeyframeTrack as mC, QuaternionKeyframeTrack as UC, ColorManagement as WB, FrontSide as LB, Interpolant as Di, Sphere as di, CompressedCubeTexture as li, CompressedArrayTexture as bi, CompressedTexture as SC, NoColorSpace as ui, RGBA_PVRTC_2BPPV1_Format as LC, RGBA_PVRTC_4BPPV1_Format as zQ, RGBA_BPTC_Format as XQ, RED_GREEN_RGTC2_Format as wi, SIGNED_RED_GREEN_RGTC2_Format as fi, RED_RGTC1_Format as yi, SIGNED_RED_RGTC1_Format as Fi, RGBA_S3TC_DXT3_Format as JC, RGB_S3TC_DXT1_Format as YC, RGBA_S3TC_DXT1_Format as ZQ, RGBA_ASTC_6x6_Format as dQ, RGBA_ASTC_4x4_Format as JB, RGB_ETC2_Format as CE, RGBA_ETC2_EAC_Format as aE, RGBFormat as _Q, RedFormat as aB, RGFormat as EB, RGBAFormat as
|
|
12
|
+
import { Matrix3 as wI, Vector3 as wA, Box3 as sC, Matrix4 as iI, Ray as Te, BufferGeometry as BQ, LineBasicMaterial as Za, LineSegments as _a, TrianglesDrawMode as Oe, TriangleFanDrawMode as OQ, TriangleStripDrawMode as $a, BufferAttribute as aI, Loader as rC, LoaderUtils as eB, FileLoader as fI, MeshPhysicalMaterial as xg, Vector2 as TB, Color as tI, LinearSRGBColorSpace as kg, SRGBColorSpace as Yg, SpotLight as We, PointLight as Pe, DirectionalLight as Ve, Quaternion as AE, InstancedMesh as ze, InstancedBufferAttribute as WQ, Object3D as gE, TextureLoader as Xe, ImageBitmapLoader as Ze, InterleavedBuffer as _e, InterleavedBufferAttribute as $e, LinearMipmapLinearFilter as OB, NearestMipmapLinearFilter as Ai, LinearMipmapNearestFilter as gi, NearestMipmapNearestFilter as IE, LinearFilter as bI, NearestFilter as og, RepeatWrapping as PQ, MirroredRepeatWrapping as Ii, ClampToEdgeWrapping as Bi, PointsMaterial as Qi, Material as hQ, MeshStandardMaterial as RC, DoubleSide as Ci, MeshBasicMaterial as CB, PropertyBinding as ai, SkinnedMesh as Ei, Mesh as VQ, Line as ei, LineLoop as ii, Points as ti, Group as DQ, PerspectiveCamera as oi, MathUtils as ni, OrthographicCamera as BE, Skeleton as si, AnimationClip as ri, Bone as ci, InterpolateDiscrete as hi, InterpolateLinear as QE, Texture as kC, VectorKeyframeTrack as NC, NumberKeyframeTrack as mC, QuaternionKeyframeTrack as UC, ColorManagement as WB, FrontSide as LB, Interpolant as Di, Sphere as di, CompressedCubeTexture as li, CompressedArrayTexture as bi, CompressedTexture as SC, NoColorSpace as ui, RGBA_PVRTC_2BPPV1_Format as LC, RGBA_PVRTC_4BPPV1_Format as zQ, RGBA_BPTC_Format as XQ, RED_GREEN_RGTC2_Format as wi, SIGNED_RED_GREEN_RGTC2_Format as fi, RED_RGTC1_Format as yi, SIGNED_RED_RGTC1_Format as Fi, RGBA_S3TC_DXT3_Format as JC, RGB_S3TC_DXT1_Format as YC, RGBA_S3TC_DXT1_Format as ZQ, RGBA_ASTC_6x6_Format as dQ, RGBA_ASTC_4x4_Format as JB, RGB_ETC2_Format as CE, RGBA_ETC2_EAC_Format as aE, RGBFormat as _Q, RedFormat as aB, RGFormat as EB, RGBAFormat as ag, UnsignedByteType as GA, HalfFloatType as DI, UnsignedInt101111Type as EE, UnsignedInt5999Type as eE, FloatType as ng, DataTexture as iE, Data3DTexture as pi, RGB_PVRTC_4BPPV1_Format as Mi, RGB_ETC1_Format as Gi, RGBA_S3TC_DXT5_Format as Ri, RGB_BPTC_UNSIGNED_Format as ki, WebGL3DRenderTarget as fB, ShaderMaterial as lQ, NormalBlending as Ni, GLSL3 as bQ, InstancedBufferGeometry as xC, DynamicDrawUsage as HC, Scene as mi, PlaneGeometry as Ui, DataUtils as KC } from "three";
|
|
13
13
|
class cs {
|
|
14
14
|
constructor() {
|
|
15
15
|
this.cullMap = [], this.cullMaterial = new J.MeshBasicMaterial({ vertexColors: true }), this.cullMaterial.side = J.FrontSide, this.cullTarget = this._createCullTarget(), this.cullPixels = new Uint8Array(4 * this.cullTarget.width * this.cullTarget.height);
|
|
@@ -599,7 +599,7 @@ async function Ji(B3 = {}) {
|
|
|
599
599
|
w = b.ea(w), b = b.U;
|
|
600
600
|
}
|
|
601
601
|
return w;
|
|
602
|
-
},
|
|
602
|
+
}, eg = (w) => {
|
|
603
603
|
if (w === null) return "null";
|
|
604
604
|
var b = typeof w;
|
|
605
605
|
return b === "object" || b === "array" || b === "function" ? w.toString() : "" + w;
|
|
@@ -609,7 +609,7 @@ async function Ji(B3 = {}) {
|
|
|
609
609
|
if (this.ha) throw new hA(`null is not a valid ${this.name}`);
|
|
610
610
|
return 0;
|
|
611
611
|
}
|
|
612
|
-
if (!b.L) throw new hA(`Cannot pass "${
|
|
612
|
+
if (!b.L) throw new hA(`Cannot pass "${eg(b)}" as a ${this.name}`);
|
|
613
613
|
if (!b.L.O) throw new hA(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
614
614
|
return VA(b.L.O, b.L.P.M, this.M);
|
|
615
615
|
}
|
|
@@ -622,7 +622,7 @@ async function Ji(B3 = {}) {
|
|
|
622
622
|
}
|
|
623
623
|
return 0;
|
|
624
624
|
}
|
|
625
|
-
if (!b || !b.L) throw new hA(`Cannot pass "${
|
|
625
|
+
if (!b || !b.L) throw new hA(`Cannot pass "${eg(b)}" as a ${this.name}`);
|
|
626
626
|
if (!b.L.O) throw new hA(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
627
627
|
if (!this.fa && b.L.P.fa) throw new hA(`Cannot convert argument of type ${b.L.W ? b.L.W.name : b.L.P.name} to parameter type ${this.name}`);
|
|
628
628
|
if (F = VA(b.L.O, b.L.P.M, this.M), this.ga) {
|
|
@@ -653,7 +653,7 @@ async function Ji(B3 = {}) {
|
|
|
653
653
|
if (this.ha) throw new hA(`null is not a valid ${this.name}`);
|
|
654
654
|
return 0;
|
|
655
655
|
}
|
|
656
|
-
if (!b.L) throw new hA(`Cannot pass "${
|
|
656
|
+
if (!b.L) throw new hA(`Cannot pass "${eg(b)}" as a ${this.name}`);
|
|
657
657
|
if (!b.L.O) throw new hA(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
658
658
|
if (b.L.P.fa) throw new hA(`Cannot convert argument of type ${b.L.P.name} to parameter type ${this.name}`);
|
|
659
659
|
return VA(b.L.O, b.L.P.M, this.M);
|
|
@@ -709,9 +709,9 @@ async function Ji(B3 = {}) {
|
|
|
709
709
|
var kA = gA ? "destructors" : "null", dg = "humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");
|
|
710
710
|
for (W && (IA += `var thisWired = toClassParamWire(${kA}, this);
|
|
711
711
|
`), H = 0; H < S; ++H) {
|
|
712
|
-
var
|
|
713
|
-
IA += `var arg${H}Wired = ${
|
|
714
|
-
`, dg.push(
|
|
712
|
+
var Bg = `toArg${H}Wire`;
|
|
713
|
+
IA += `var arg${H}Wired = ${Bg}(${kA}, arg${H});
|
|
714
|
+
`, dg.push(Bg);
|
|
715
715
|
}
|
|
716
716
|
if (IA += (F || T ? "var rv = " : "") + `invoker(${BA});
|
|
717
717
|
`, gA) IA += `runDestructors(destructors);
|
|
@@ -919,10 +919,10 @@ return ret;
|
|
|
919
919
|
rg([w], T, (H) => {
|
|
920
920
|
var W = {};
|
|
921
921
|
return S.forEach((gA, BA) => {
|
|
922
|
-
var IA = H[BA], kA = gA.ta, dg = gA.ua,
|
|
922
|
+
var IA = H[BA], kA = gA.ta, dg = gA.ua, Bg = H[BA + S.length], OA = gA.Aa, Qg = gA.Ca;
|
|
923
923
|
W[gA.qa] = { read: (Kg) => IA.N(kA(dg, Kg)), write: (Kg, $I) => {
|
|
924
924
|
var Zg = [];
|
|
925
|
-
OA(
|
|
925
|
+
OA(Qg, Kg, Bg.T(Zg, $I)), FA(Zg);
|
|
926
926
|
}, optional: H[BA].optional };
|
|
927
927
|
}), [{ name: b.name, N: (gA) => {
|
|
928
928
|
var BA, IA = {};
|
|
@@ -953,14 +953,14 @@ return ret;
|
|
|
953
953
|
}, V: null });
|
|
954
954
|
}, j: (w, b, F, f, S, T, H, W, gA, BA, IA, kA, dg) => {
|
|
955
955
|
IA = TA(IA), T = hg(S, T), W && (W = hg(H, W)), BA && (BA = hg(gA, BA)), dg = hg(kA, dg);
|
|
956
|
-
var
|
|
957
|
-
var
|
|
958
|
-
return 48 <=
|
|
956
|
+
var Bg = ((OA) => {
|
|
957
|
+
var Qg = (OA = OA.replace(/[^a-zA-Z0-9_]/g, "$")).charCodeAt(0);
|
|
958
|
+
return 48 <= Qg && 57 >= Qg ? `_${OA}` : OA;
|
|
959
959
|
})(IA);
|
|
960
|
-
dA(
|
|
960
|
+
dA(Bg, function() {
|
|
961
961
|
GI(`Cannot construct ${IA} due to unbound types`, [f]);
|
|
962
962
|
}), rg([w, b, F], f ? [f] : [], (OA) => {
|
|
963
|
-
if (OA = OA[0], f) var
|
|
963
|
+
if (OA = OA[0], f) var Qg = OA.M, Kg = Qg.$;
|
|
964
964
|
else Kg = q.prototype;
|
|
965
965
|
OA = AA(IA, function(...cQ) {
|
|
966
966
|
if (Object.getPrototypeOf(this) !== $I) throw new hA(`Use 'new' to construct ${IA}`);
|
|
@@ -971,8 +971,8 @@ return ret;
|
|
|
971
971
|
});
|
|
972
972
|
var $I = Object.create(Kg, { constructor: { value: OA } });
|
|
973
973
|
OA.prototype = $I;
|
|
974
|
-
var Zg, Ng = new YA(IA, OA, $I, dg,
|
|
975
|
-
return Ng.U && ((Zg = Ng.U).ja ?? (Zg.ja = []), Ng.U.ja.push(Ng)),
|
|
974
|
+
var Zg, Ng = new YA(IA, OA, $I, dg, Qg, T, W, BA);
|
|
975
|
+
return Ng.U && ((Zg = Ng.U).ja ?? (Zg.ja = []), Ng.U.ja.push(Ng)), Qg = new MI(IA, Ng, true, false, false), Zg = new MI(IA + "*", Ng, false, false, false), Kg = new MI(IA + " const*", Ng, false, true, false), P[w] = { pointerType: Zg, oa: Kg }, rB(Bg, OA), [Qg, Zg, Kg];
|
|
976
976
|
});
|
|
977
977
|
}, g: (w, b, F, f, S, T) => {
|
|
978
978
|
var H = OI(b, F);
|
|
@@ -991,8 +991,8 @@ return ret;
|
|
|
991
991
|
}
|
|
992
992
|
var dg = `${(IA = IA[0]).name}.${b}`;
|
|
993
993
|
b.startsWith("@@") && (b = Symbol[b.substring(2)]), W && IA.M.ya.push(b);
|
|
994
|
-
var
|
|
995
|
-
return OA === void 0 || OA.R === void 0 && OA.className !== IA.name && OA.aa === F - 2 ? (kA.aa = F - 2, kA.className = IA.name,
|
|
994
|
+
var Bg = IA.M.$, OA = Bg[b];
|
|
995
|
+
return OA === void 0 || OA.R === void 0 && OA.className !== IA.name && OA.aa === F - 2 ? (kA.aa = F - 2, kA.className = IA.name, Bg[b] = kA) : (pA(Bg, b, dg), Bg[b].R[F - 2] = kA), rg([], BA, (Qg) => (Qg = WI(dg, Qg, IA, T, H, gA), Bg[b].R === void 0 ? (Qg.aa = F - 2, Bg[b] = Qg) : Bg[b].R[F - 2] = Qg, [])), [];
|
|
996
996
|
});
|
|
997
997
|
}, z: (w) => m(w, lB), r: (w, b, F, f) => {
|
|
998
998
|
function S() {
|
|
@@ -3778,7 +3778,7 @@ class AB {
|
|
|
3778
3778
|
return Q < A && this._offset++, new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + I, Q);
|
|
3779
3779
|
}
|
|
3780
3780
|
}
|
|
3781
|
-
const
|
|
3781
|
+
const Cg = [171, 75, 84, 88, 32, 50, 48, 187, 13, 10, 26, 10];
|
|
3782
3782
|
function zC(B3) {
|
|
3783
3783
|
return new TextDecoder().decode(B3);
|
|
3784
3784
|
}
|
|
@@ -3865,11 +3865,11 @@ class ug extends rC {
|
|
|
3865
3865
|
}
|
|
3866
3866
|
async _createTexture(A, g = {}) {
|
|
3867
3867
|
const I = function(E) {
|
|
3868
|
-
const e = new Uint8Array(E.buffer, E.byteOffset,
|
|
3869
|
-
if (e[0] !==
|
|
3870
|
-
const t = { vkFormat: 0, typeSize: 1, pixelWidth: 0, pixelHeight: 0, pixelDepth: 0, layerCount: 0, faceCount: 1, levelCount: 0, supercompressionScheme: 0, levels: [], dataFormatDescriptor: [{ vendorId: 0, descriptorType: 0, versionNumber: 2, colorModel: 0, colorPrimaries: 1, transferFunction: 2, flags: 0, texelBlockDimension: [0, 0, 0, 0], bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0], samples: [] }], keyValue: {}, globalData: null }, i = 17 * Uint32Array.BYTES_PER_ELEMENT, o = new AB(E,
|
|
3868
|
+
const e = new Uint8Array(E.buffer, E.byteOffset, Cg.length);
|
|
3869
|
+
if (e[0] !== Cg[0] || e[1] !== Cg[1] || e[2] !== Cg[2] || e[3] !== Cg[3] || e[4] !== Cg[4] || e[5] !== Cg[5] || e[6] !== Cg[6] || e[7] !== Cg[7] || e[8] !== Cg[8] || e[9] !== Cg[9] || e[10] !== Cg[10] || e[11] !== Cg[11]) throw new Error("Missing KTX 2.0 identifier.");
|
|
3870
|
+
const t = { vkFormat: 0, typeSize: 1, pixelWidth: 0, pixelHeight: 0, pixelDepth: 0, layerCount: 0, faceCount: 1, levelCount: 0, supercompressionScheme: 0, levels: [], dataFormatDescriptor: [{ vendorId: 0, descriptorType: 0, versionNumber: 2, colorModel: 0, colorPrimaries: 1, transferFunction: 2, flags: 0, texelBlockDimension: [0, 0, 0, 0], bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0], samples: [] }], keyValue: {}, globalData: null }, i = 17 * Uint32Array.BYTES_PER_ELEMENT, o = new AB(E, Cg.length, i, true);
|
|
3871
3871
|
t.vkFormat = o._nextUint32(), t.typeSize = o._nextUint32(), t.pixelWidth = o._nextUint32(), t.pixelHeight = o._nextUint32(), t.pixelDepth = o._nextUint32(), t.layerCount = o._nextUint32(), t.faceCount = o._nextUint32(), t.levelCount = o._nextUint32(), t.supercompressionScheme = o._nextUint32();
|
|
3872
|
-
const s = o._nextUint32(), n = o._nextUint32(), r = o._nextUint32(), c = o._nextUint32(), D = o._nextUint64(), d = o._nextUint64(), h = 3 * Math.max(t.levelCount, 1) * 8, l = new AB(E,
|
|
3872
|
+
const s = o._nextUint32(), n = o._nextUint32(), r = o._nextUint32(), c = o._nextUint32(), D = o._nextUint64(), d = o._nextUint64(), h = 3 * Math.max(t.levelCount, 1) * 8, l = new AB(E, Cg.length + i, h, true);
|
|
3873
3873
|
for (let oA = 0, cA = Math.max(t.levelCount, 1); oA < cA; oA++) t.levels.push({ levelData: new Uint8Array(E.buffer, E.byteOffset + l._nextUint64(), l._nextUint64()), uncompressedByteLength: l._nextUint64() });
|
|
3874
3874
|
const u = new AB(E, s, n, true);
|
|
3875
3875
|
u._skip(4);
|
|
@@ -3930,7 +3930,7 @@ class ug extends rC {
|
|
|
3930
3930
|
this.workerPool.dispose(), this.workerSourceURL && URL.revokeObjectURL(this.workerSourceURL), RQ--;
|
|
3931
3931
|
}
|
|
3932
3932
|
}
|
|
3933
|
-
ug.BasisFormat = { ETC1S: 0, UASTC: 1, UASTC_HDR: 2 }, ug.TranscoderFormat = { ETC1: 0, ETC2: 1, BC1: 2, BC3: 3, BC4: 4, BC5: 5, BC7_M6_OPAQUE_ONLY: 6, BC7_M5: 7, PVRTC1_4_RGB: 8, PVRTC1_4_RGBA: 9, ASTC_4x4: 10, ATC_RGB: 11, ATC_RGBA_INTERPOLATED_ALPHA: 12, RGBA32: 13, RGB565: 14, BGR565: 15, RGBA4444: 16, BC6H: 22, RGB_HALF: 24, RGBA_HALF: 25 }, ug.EngineFormat = { RGBAFormat:
|
|
3933
|
+
ug.BasisFormat = { ETC1S: 0, UASTC: 1, UASTC_HDR: 2 }, ug.TranscoderFormat = { ETC1: 0, ETC2: 1, BC1: 2, BC3: 3, BC4: 4, BC5: 5, BC7_M6_OPAQUE_ONLY: 6, BC7_M5: 7, PVRTC1_4_RGB: 8, PVRTC1_4_RGBA: 9, ASTC_4x4: 10, ATC_RGB: 11, ATC_RGBA_INTERPOLATED_ALPHA: 12, RGBA32: 13, RGB565: 14, BGR565: 15, RGBA4444: 16, BC6H: 22, RGB_HALF: 24, RGBA_HALF: 25 }, ug.EngineFormat = { RGBAFormat: ag, RGBA_ASTC_4x4_Format: JB, RGB_BPTC_UNSIGNED_Format: ki, RGBA_BPTC_Format: XQ, RGBA_ETC2_EAC_Format: aE, RGBA_PVRTC_4BPPV1_Format: zQ, RGBA_S3TC_DXT5_Format: Ri, RGB_ETC1_Format: Gi, RGB_ETC2_Format: CE, RGB_PVRTC_4BPPV1_Format: Mi, RGBA_S3TC_DXT1_Format: ZQ }, ug.EngineType = { UnsignedByteType: GA, HalfFloatType: DI, FloatType: ng }, ug.BasisWorker = function() {
|
|
3934
3934
|
let B3, A, g;
|
|
3935
3935
|
const I = _EngineFormat, Q = _EngineType, C = _TranscoderFormat, a = _BasisFormat;
|
|
3936
3936
|
self.addEventListener("message", function(o) {
|
|
@@ -4017,7 +4017,7 @@ ug.BasisFormat = { ETC1S: 0, UASTC: 1, UASTC_HDR: 2 }, ug.TranscoderFormat = { E
|
|
|
4017
4017
|
return n;
|
|
4018
4018
|
}
|
|
4019
4019
|
};
|
|
4020
|
-
const Mt = /* @__PURE__ */ new Set([
|
|
4020
|
+
const Mt = /* @__PURE__ */ new Set([ag, _Q, EB, aB]), kQ = { [RE]: ag, [GE]: EB, [ME]: aB, [pE]: ag, [FE]: EB, [yE]: aB, [fE]: ag, [wE]: ag, [uE]: EB, [bE]: EB, [lE]: aB, [dE]: aB, [NE]: _Q, [kE]: _Q, [OE]: aE, [TE]: CE, [cC]: JB, [PE]: JB, [WE]: JB, [Ae]: dQ, [zE]: dQ, [VE]: dQ, [LE]: ZQ, [SE]: ZQ, [UE]: YC, [mE]: YC, [YE]: JC, [JE]: JC, [HE]: Fi, [xE]: yi, [jE]: fi, [KE]: wi, [qE]: XQ, [vE]: XQ, [$E]: zQ, [ZE]: zQ, [_E]: LC, [XE]: LC }, NI = { [RE]: ng, [GE]: ng, [ME]: ng, [pE]: DI, [FE]: DI, [yE]: DI, [fE]: GA, [wE]: GA, [uE]: GA, [bE]: GA, [lE]: GA, [dE]: GA, [NE]: eE, [kE]: EE, [OE]: GA, [TE]: GA, [cC]: DI, [PE]: GA, [WE]: GA, [Ae]: DI, [zE]: GA, [VE]: GA, [LE]: GA, [SE]: GA, [UE]: GA, [mE]: GA, [YE]: GA, [JE]: GA, [HE]: GA, [xE]: GA, [jE]: GA, [KE]: GA, [qE]: GA, [vE]: GA, [$E]: GA, [ZE]: GA, [_E]: GA, [XE]: GA };
|
|
4021
4021
|
function ZC(B3) {
|
|
4022
4022
|
const A = B3.dataFormatDescriptor[0];
|
|
4023
4023
|
return A.colorPrimaries === 1 ? A.transferFunction === 2 ? Yg : kg : A.colorPrimaries === 10 ? A.transferFunction === 2 ? "display-p3" : "display-p3-linear" : (A.colorPrimaries === 0 || console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${A.colorPrimaries}"`), ui);
|
|
@@ -4513,8 +4513,8 @@ function Ia(B3) {
|
|
|
4513
4513
|
for (Q = 0; Q < I; Q++) a += "/" + g[Q];
|
|
4514
4514
|
return a;
|
|
4515
4515
|
}
|
|
4516
|
-
const
|
|
4517
|
-
for (let B3 = 0; B3 < 256; ++B3)
|
|
4516
|
+
const $A = [];
|
|
4517
|
+
for (let B3 = 0; B3 < 256; ++B3) $A.push((B3 + 256).toString(16).slice(1));
|
|
4518
4518
|
let SQ;
|
|
4519
4519
|
const kt = new Uint8Array(16), Ba = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
|
|
4520
4520
|
function Nt(B3, A, g) {
|
|
@@ -4528,7 +4528,7 @@ function Nt(B3, A, g) {
|
|
|
4528
4528
|
}();
|
|
4529
4529
|
if (I.length < 16) throw new Error("Random bytes length must be >= 16");
|
|
4530
4530
|
return I[6] = 15 & I[6] | 64, I[8] = 63 & I[8] | 128, function(Q, C = 0) {
|
|
4531
|
-
return (
|
|
4531
|
+
return ($A[Q[C + 0]] + $A[Q[C + 1]] + $A[Q[C + 2]] + $A[Q[C + 3]] + "-" + $A[Q[C + 4]] + $A[Q[C + 5]] + "-" + $A[Q[C + 6]] + $A[Q[C + 7]] + "-" + $A[Q[C + 8]] + $A[Q[C + 9]] + "-" + $A[Q[C + 10]] + $A[Q[C + 11]] + $A[Q[C + 12]] + $A[Q[C + 13]] + $A[Q[C + 14]] + $A[Q[C + 15]]).toLowerCase();
|
|
4532
4532
|
}(I);
|
|
4533
4533
|
}
|
|
4534
4534
|
function Ie(B3, A, g) {
|
|
@@ -4997,8 +4997,8 @@ const Ea = "Argument is not a typed-function.", XB = function B() {
|
|
|
4997
4997
|
const VA = M(YA.params, P);
|
|
4998
4998
|
if (VA && (!pA.restParam || VA.restParam)) {
|
|
4999
4999
|
if (!VA.hasAny) {
|
|
5000
|
-
const
|
|
5001
|
-
if (pA.types.some((cg) => !
|
|
5000
|
+
const eg = d(VA);
|
|
5001
|
+
if (pA.types.some((cg) => !eg.has(cg.name))) continue;
|
|
5002
5002
|
}
|
|
5003
5003
|
dA.push(YA);
|
|
5004
5004
|
}
|
|
@@ -5196,14 +5196,14 @@ const Ea = "Argument is not a typed-function.", XB = function B() {
|
|
|
5196
5196
|
} else if (q) return -1;
|
|
5197
5197
|
const VA = (L.length - x.length) * (X ? -1 : 1);
|
|
5198
5198
|
if (VA !== 0) return VA;
|
|
5199
|
-
const
|
|
5199
|
+
const eg = [];
|
|
5200
5200
|
let cg, pg = 0;
|
|
5201
5201
|
for (let Og = 0; Og < L.length; ++Og) {
|
|
5202
5202
|
const oI = V(L[Og], x[Og]);
|
|
5203
|
-
|
|
5203
|
+
eg.push(oI), pg += oI;
|
|
5204
5204
|
}
|
|
5205
5205
|
if (pg !== 0) return pg;
|
|
5206
|
-
for (cg of
|
|
5206
|
+
for (cg of eg) if (cg !== 0) return cg;
|
|
5207
5207
|
return 0;
|
|
5208
5208
|
}
|
|
5209
5209
|
function Z(p, m) {
|
|
@@ -5348,11 +5348,11 @@ const Ea = "Argument is not a typed-function.", XB = function B() {
|
|
|
5348
5348
|
for (AA in j) Object.prototype.hasOwnProperty.call(j, AA) && (j[AA] = q[j[AA]]);
|
|
5349
5349
|
const P = [], pA = /* @__PURE__ */ new Map();
|
|
5350
5350
|
for (AA of O) pA.has(AA.name) || (AA.fn = q[AA.fn], P.push(AA), pA.set(AA.name, AA));
|
|
5351
|
-
const dA = P[0] && P[0].params.length <= 2 && !l(P[0].params), YA = P[1] && P[1].params.length <= 2 && !l(P[1].params), VA = P[2] && P[2].params.length <= 2 && !l(P[2].params),
|
|
5351
|
+
const dA = P[0] && P[0].params.length <= 2 && !l(P[0].params), YA = P[1] && P[1].params.length <= 2 && !l(P[1].params), VA = P[2] && P[2].params.length <= 2 && !l(P[2].params), eg = P[3] && P[3].params.length <= 2 && !l(P[3].params), cg = P[4] && P[4].params.length <= 2 && !l(P[4].params), pg = P[5] && P[5].params.length <= 2 && !l(P[5].params), Og = dA && YA && VA && eg && cg && pg;
|
|
5352
5352
|
for (let DA = 0; DA < P.length; ++DA) P[DA].test = G(P[DA].params);
|
|
5353
|
-
const oI = dA ? u(P[0].params[0]) : wg, aQ = YA ? u(P[1].params[0]) : wg, pI = VA ? u(P[2].params[0]) : wg, MI =
|
|
5353
|
+
const oI = dA ? u(P[0].params[0]) : wg, aQ = YA ? u(P[1].params[0]) : wg, pI = VA ? u(P[2].params[0]) : wg, MI = eg ? u(P[3].params[0]) : wg, sB = cg ? u(P[4].params[0]) : wg, rB = pg ? u(P[5].params[0]) : wg, hg = dA ? u(P[0].params[1]) : wg, EQ = YA ? u(P[1].params[1]) : wg, cB = VA ? u(P[2].params[1]) : wg, GI = eg ? u(P[3].params[1]) : wg, OI = cg ? u(P[4].params[1]) : wg, hB = pg ? u(P[5].params[1]) : wg;
|
|
5354
5354
|
for (let DA = 0; DA < P.length; ++DA) P[DA].implementation = Z(P[DA].params, P[DA].fn);
|
|
5355
|
-
const WI = dA ? P[0].implementation : mI, PI = YA ? P[1].implementation : mI, DB = VA ? P[2].implementation : mI, dB =
|
|
5355
|
+
const WI = dA ? P[0].implementation : mI, PI = YA ? P[1].implementation : mI, DB = VA ? P[2].implementation : mI, dB = eg ? P[3].implementation : mI, Wg = cg ? P[4].implementation : mI, VI = pg ? P[5].implementation : mI, zI = dA ? P[0].params.length : -1, XI = YA ? P[1].params.length : -1, lB = VA ? P[2].params.length : -1, eQ = eg ? P[3].params.length : -1, bB = cg ? P[4].params.length : -1, iQ = pg ? P[5].params.length : -1, tQ = Og ? 6 : 0, Pg = P.length, uB = P.map((DA) => DA.test), wB = P.map((DA) => DA.implementation), ZI = function() {
|
|
5356
5356
|
for (let DA = tQ; DA < Pg; DA++) if (uB[DA](arguments)) return wB[DA].apply(this, arguments);
|
|
5357
5357
|
return E.onMismatch(p, arguments, P);
|
|
5358
5358
|
};
|
|
@@ -5731,8 +5731,8 @@ function MB(B3) {
|
|
|
5731
5731
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
5732
5732
|
* MIT Licence
|
|
5733
5733
|
*/
|
|
5734
|
-
var ie, Tg, xI = 9e15, CI = 1e9, BC = "0123456789abcdef", ZB = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", _B = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", QC = { precision: 20, rounding: 4, modulo: 1, toExpNeg: -7, toExpPos: 21, minE: -xI, maxE: xI, crypto: false }, iA = true, QQ = "[DecimalError] ", eI = QQ + "Invalid argument: ", te = QQ + "Precision limit exceeded", oe = QQ + "crypto unavailable", ne = "[object Decimal]",
|
|
5735
|
-
function
|
|
5734
|
+
var ie, Tg, xI = 9e15, CI = 1e9, BC = "0123456789abcdef", ZB = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", _B = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", QC = { precision: 20, rounding: 4, modulo: 1, toExpNeg: -7, toExpPos: 21, minE: -xI, maxE: xI, crypto: false }, iA = true, QQ = "[DecimalError] ", eI = QQ + "Invalid argument: ", te = QQ + "Precision limit exceeded", oe = QQ + "crypto unavailable", ne = "[object Decimal]", Ig = Math.floor, XA = Math.pow, ro = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, co = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, ho = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, se = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Rg = 1e7, Do = ZB.length - 1, CC = _B.length - 1, v = { toStringTag: ne };
|
|
5735
|
+
function Ag(B3) {
|
|
5736
5736
|
var A, g, I, Q = B3.length - 1, C = "", a = B3[0];
|
|
5737
5737
|
if (Q > 0) {
|
|
5738
5738
|
for (C += a, A = 1; A < Q; A++) (g = 7 - (I = B3[A] + "").length) && (C += QI(g)), C += I;
|
|
@@ -5741,7 +5741,7 @@ function $A(B3) {
|
|
|
5741
5741
|
for (; a % 10 == 0; ) a /= 10;
|
|
5742
5742
|
return C + a;
|
|
5743
5743
|
}
|
|
5744
|
-
function
|
|
5744
|
+
function tg(B3, A, g) {
|
|
5745
5745
|
if (B3 !== ~~B3 || B3 < A || B3 > g) throw Error(eI + B3);
|
|
5746
5746
|
}
|
|
5747
5747
|
function iB(B3, A, g, I) {
|
|
@@ -5789,7 +5789,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5789
5789
|
}, v.cubeRoot = v.cbrt = function() {
|
|
5790
5790
|
var B3, A, g, I, Q, C, a, E, e, t, i = this, o = i.constructor;
|
|
5791
5791
|
if (!i.isFinite() || i.isZero()) return new o(i);
|
|
5792
|
-
for (iA = false, (C = i.s * XA(i.s * i, 1 / 3)) && Math.abs(C) != 1 / 0 ? I = new o(C.toString()) : (g =
|
|
5792
|
+
for (iA = false, (C = i.s * XA(i.s * i, 1 / 3)) && Math.abs(C) != 1 / 0 ? I = new o(C.toString()) : (g = Ag(i.d), (C = ((B3 = i.e) - g.length + 1) % 3) && (g += C == 1 || C == -2 ? "0" : "00"), C = XA(g, 1 / 3), B3 = Ig((B3 + 1) / 3) - (B3 % 3 == (B3 < 0 ? -1 : 2)), (I = new o(g = C == 1 / 0 ? "5e" + B3 : (g = C.toExponential()).slice(0, g.indexOf("e") + 1) + B3)).s = i.s), a = (B3 = o.precision) + 3; ; ) if (t = (e = (E = I).times(E).times(E)).plus(i), I = NA(t.plus(i).times(E), t.plus(e), a + 2, 1), Ag(E.d).slice(0, a) === (g = Ag(I.d)).slice(0, a)) {
|
|
5793
5793
|
if ((g = g.slice(a - 3, a + 1)) != "9999" && (Q || g != "4999")) {
|
|
5794
5794
|
+g && (+g.slice(1) || g.charAt(0) != "5") || (CA(I, B3 + 1, 1), A = !I.times(I).times(I).eq(i));
|
|
5795
5795
|
break;
|
|
@@ -5804,7 +5804,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5804
5804
|
}, v.decimalPlaces = v.dp = function() {
|
|
5805
5805
|
var B3, A = this.d, g = NaN;
|
|
5806
5806
|
if (A) {
|
|
5807
|
-
if (g = 7 * ((B3 = A.length - 1) -
|
|
5807
|
+
if (g = 7 * ((B3 = A.length - 1) - Ig(this.e / 7)), B3 = A[B3]) for (; B3 % 10 == 0; B3 /= 10) g--;
|
|
5808
5808
|
g < 0 && (g = 0);
|
|
5809
5809
|
}
|
|
5810
5810
|
return g;
|
|
@@ -5871,7 +5871,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5871
5871
|
}, v.isFinite = function() {
|
|
5872
5872
|
return !!this.d;
|
|
5873
5873
|
}, v.isInteger = v.isInt = function() {
|
|
5874
|
-
return !!this.d &&
|
|
5874
|
+
return !!this.d && Ig(this.e / 7) > this.d.length - 2;
|
|
5875
5875
|
}, v.isNaN = function() {
|
|
5876
5876
|
return !this.s;
|
|
5877
5877
|
}, v.isNegative = v.isNeg = function() {
|
|
@@ -5899,7 +5899,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5899
5899
|
}
|
|
5900
5900
|
if (iA = false, a = II(t, E = o + 5), I = A ? $B(i, E + 10) : II(B3, E), iB((e = NA(a, I, E, 1)).d, Q = o, s)) do
|
|
5901
5901
|
if (a = II(t, E += 10), I = A ? $B(i, E + 10) : II(B3, E), e = NA(a, I, E, 1), !C) {
|
|
5902
|
-
|
|
5902
|
+
+Ag(e.d).slice(Q + 1, Q + 15) + 1 == 1e14 && (e = CA(e, o + 1, 0));
|
|
5903
5903
|
break;
|
|
5904
5904
|
}
|
|
5905
5905
|
while (iB(e.d, Q += 10, s));
|
|
@@ -5916,7 +5916,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5916
5916
|
}
|
|
5917
5917
|
return iA ? CA(B3, E, e) : B3;
|
|
5918
5918
|
}
|
|
5919
|
-
if (g =
|
|
5919
|
+
if (g = Ig(B3.e / 7), i = Ig(n.e / 7), t = t.slice(), C = i - g) {
|
|
5920
5920
|
for ((o = C < 0) ? (A = t, C = -C, a = s.length) : (A = s, g = i, a = t.length), C > (I = Math.max(Math.ceil(E / 7), a) + 2) && (C = I, A.length = 1), A.reverse(), I = C; I--; ) A.push(0);
|
|
5921
5921
|
A.reverse();
|
|
5922
5922
|
} else {
|
|
@@ -5952,7 +5952,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5952
5952
|
if (B3 = new s(B3), !o.d || !B3.d) return o.s && B3.s ? o.d || (B3 = new s(B3.d || o.s === B3.s ? o : NaN)) : B3 = new s(NaN), B3;
|
|
5953
5953
|
if (o.s != B3.s) return B3.s = -B3.s, o.minus(B3);
|
|
5954
5954
|
if (t = o.d, i = B3.d, E = s.precision, e = s.rounding, !t[0] || !i[0]) return i[0] || (B3 = new s(o)), iA ? CA(B3, E, e) : B3;
|
|
5955
|
-
if (C =
|
|
5955
|
+
if (C = Ig(o.e / 7), I = Ig(B3.e / 7), t = t.slice(), Q = C - I) {
|
|
5956
5956
|
for (Q < 0 ? (g = t, Q = -Q, a = i.length) : (g = i, I = C, a = t.length), Q > (a = (C = Math.ceil(E / 7)) > a ? C + 1 : a + 1) && (Q = a, g.length = 1), g.reverse(); Q--; ) g.push(0);
|
|
5957
5957
|
g.reverse();
|
|
5958
5958
|
}
|
|
@@ -5978,7 +5978,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5978
5978
|
}, v.squareRoot = v.sqrt = function() {
|
|
5979
5979
|
var B3, A, g, I, Q, C, a = this, E = a.d, e = a.e, t = a.s, i = a.constructor;
|
|
5980
5980
|
if (t !== 1 || !E || !E[0]) return new i(!t || t < 0 && (!E || E[0]) ? NaN : E ? a : 1 / 0);
|
|
5981
|
-
for (iA = false, (t = Math.sqrt(+a)) == 0 || t == 1 / 0 ? (((A =
|
|
5981
|
+
for (iA = false, (t = Math.sqrt(+a)) == 0 || t == 1 / 0 ? (((A = Ag(E)).length + e) % 2 == 0 && (A += "0"), t = Math.sqrt(A), e = Ig((e + 1) / 2) - (e < 0 || e % 2), I = new i(A = t == 1 / 0 ? "5e" + e : (A = t.toExponential()).slice(0, A.indexOf("e") + 1) + e)) : I = new i(t.toString()), g = (e = i.precision) + 3; ; ) if (I = (C = I).plus(NA(a, C, g + 2, 1)).times(0.5), Ag(C.d).slice(0, g) === (A = Ag(I.d)).slice(0, g)) {
|
|
5982
5982
|
if ((A = A.slice(g - 3, g + 1)) != "9999" && (Q || A != "4999")) {
|
|
5983
5983
|
+A && (+A.slice(1) || A.charAt(0) != "5") || (CA(I, e + 1, 1), B3 = !I.times(I).eq(a));
|
|
5984
5984
|
break;
|
|
@@ -5996,7 +5996,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
5996
5996
|
}, v.times = v.mul = function(B3) {
|
|
5997
5997
|
var A, g, I, Q, C, a, E, e, t, i = this, o = i.constructor, s = i.d, n = (B3 = new o(B3)).d;
|
|
5998
5998
|
if (B3.s *= i.s, !(s && s[0] && n && n[0])) return new o(!B3.s || s && !s[0] && !n || n && !n[0] && !s ? NaN : s && n ? 0 * B3.s : B3.s / 0);
|
|
5999
|
-
for (g =
|
|
5999
|
+
for (g = Ig(i.e / 7) + Ig(B3.e / 7), (e = s.length) < (t = n.length) && (C = s, s = n, n = C, a = e, e = t, t = a), C = [], I = a = e + t; I--; ) C.push(0);
|
|
6000
6000
|
for (I = t; --I >= 0; ) {
|
|
6001
6001
|
for (A = 0, Q = e + I; Q > I; ) E = C[Q] + n[I] * s[Q - I - 1] + A, C[Q--] = E % Rg | 0, A = E / Rg | 0;
|
|
6002
6002
|
C[Q] = (C[Q] + A) % Rg | 0;
|
|
@@ -6007,13 +6007,13 @@ v.absoluteValue = v.abs = function() {
|
|
|
6007
6007
|
return YQ(this, 2, B3, A);
|
|
6008
6008
|
}, v.toDecimalPlaces = v.toDP = function(B3, A) {
|
|
6009
6009
|
var g = this, I = g.constructor;
|
|
6010
|
-
return g = new I(g), B3 === void 0 ? g : (
|
|
6010
|
+
return g = new I(g), B3 === void 0 ? g : (tg(B3, 0, CI), A === void 0 ? A = I.rounding : tg(A, 0, 8), CA(g, B3 + g.e + 1, A));
|
|
6011
6011
|
}, v.toExponential = function(B3, A) {
|
|
6012
6012
|
var g, I = this, Q = I.constructor;
|
|
6013
|
-
return B3 === void 0 ? g = Ug(I, true) : (
|
|
6013
|
+
return B3 === void 0 ? g = Ug(I, true) : (tg(B3, 0, CI), A === void 0 ? A = Q.rounding : tg(A, 0, 8), g = Ug(I = CA(new Q(I), B3 + 1, A), true, B3 + 1)), I.isNeg() && !I.isZero() ? "-" + g : g;
|
|
6014
6014
|
}, v.toFixed = function(B3, A) {
|
|
6015
6015
|
var g, I, Q = this, C = Q.constructor;
|
|
6016
|
-
return B3 === void 0 ? g = Ug(Q) : (
|
|
6016
|
+
return B3 === void 0 ? g = Ug(Q) : (tg(B3, 0, CI), A === void 0 ? A = C.rounding : tg(A, 0, 8), g = Ug(I = CA(new C(Q), B3 + Q.e + 1, A), false, B3 + I.e + 1)), Q.isNeg() && !Q.isZero() ? "-" + g : g;
|
|
6017
6017
|
}, v.toFraction = function(B3) {
|
|
6018
6018
|
var A, g, I, Q, C, a, E, e, t, i, o, s, n = this, r = n.d, c = n.constructor;
|
|
6019
6019
|
if (!r) return new c(n);
|
|
@@ -6022,7 +6022,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
6022
6022
|
if (!(E = new c(B3)).isInt() || E.lt(t)) throw Error(eI + E);
|
|
6023
6023
|
B3 = E.gt(A) ? C > 0 ? A : t : E;
|
|
6024
6024
|
}
|
|
6025
|
-
for (iA = false, E = new c(
|
|
6025
|
+
for (iA = false, E = new c(Ag(r)), i = c.precision, c.precision = C = 7 * r.length * 2; o = NA(E, A, 0, 1, 1), (Q = g.plus(o.times(I))).cmp(B3) != 1; ) g = I, I = Q, Q = t, t = e.plus(o.times(Q)), e = Q, Q = A, A = E.minus(o.times(Q)), E = Q;
|
|
6026
6026
|
return Q = NA(B3.minus(g), I, 0, 1, 1), e = e.plus(Q.times(t)), g = g.plus(Q.times(I)), e.s = t.s = n.s, s = NA(t, I, C, 1).minus(n).abs().cmp(NA(e, g, C, 1).minus(n).abs()) < 1 ? [t, I] : [e, g], c.precision = i, iA = true, s;
|
|
6027
6027
|
}, v.toHexadecimal = v.toHex = function(B3, A) {
|
|
6028
6028
|
return YQ(this, 16, B3, A);
|
|
@@ -6032,7 +6032,7 @@ v.absoluteValue = v.abs = function() {
|
|
|
6032
6032
|
if (!g.d) return g;
|
|
6033
6033
|
B3 = new I(1), A = I.rounding;
|
|
6034
6034
|
} else {
|
|
6035
|
-
if (B3 = new I(B3), A === void 0 ? A = I.rounding :
|
|
6035
|
+
if (B3 = new I(B3), A === void 0 ? A = I.rounding : tg(A, 0, 8), !g.d) return B3.s ? g : B3;
|
|
6036
6036
|
if (!B3.d) return B3.s && (B3.s = g.s), B3;
|
|
6037
6037
|
}
|
|
6038
6038
|
return B3.d[0] ? (iA = false, g = NA(g, B3, 0, A, 1).times(B3), iA = true, CA(g)) : (B3.s = g.s, g = B3), g;
|
|
@@ -6045,18 +6045,18 @@ v.absoluteValue = v.abs = function() {
|
|
|
6045
6045
|
if (!(E.d && B3.d && E.d[0] && B3.d[0])) return new e(XA(+E, t));
|
|
6046
6046
|
if ((E = new e(E)).eq(1)) return E;
|
|
6047
6047
|
if (I = e.precision, C = e.rounding, B3.eq(1)) return CA(E, I, C);
|
|
6048
|
-
if ((A =
|
|
6048
|
+
if ((A = Ig(B3.e / 7)) >= B3.d.length - 1 && (g = t < 0 ? -t : t) <= 9007199254740991) return Q = re(e, E, g, I), B3.s < 0 ? new e(1).div(Q) : CA(Q, I, C);
|
|
6049
6049
|
if ((a = E.s) < 0) {
|
|
6050
6050
|
if (A < B3.d.length - 1) return new e(NaN);
|
|
6051
6051
|
if (1 & B3.d[A] || (a = 1), E.e == 0 && E.d[0] == 1 && E.d.length == 1) return E.s = a, E;
|
|
6052
6052
|
}
|
|
6053
|
-
return (A = (g = XA(+E, t)) != 0 && isFinite(g) ? new e(g + "").e :
|
|
6053
|
+
return (A = (g = XA(+E, t)) != 0 && isFinite(g) ? new e(g + "").e : Ig(t * (Math.log("0." + Ag(E.d)) / Math.LN10 + E.e + 1))) > e.maxE + 1 || A < e.minE - 1 ? new e(A > 0 ? a / 0 : 0) : (iA = false, e.rounding = E.s = 1, g = Math.min(12, (A + "").length), (Q = JQ(B3.times(II(E, I + g)), I)).d && iB((Q = CA(Q, I + 5, 1)).d, I, C) && (A = I + 10, +Ag((Q = CA(JQ(B3.times(II(E, A + g)), A), A + 5, 1)).d).slice(I + 1, I + 15) + 1 == 1e14 && (Q = CA(Q, I + 1, 0))), Q.s = a, iA = true, e.rounding = C, CA(Q, I, C));
|
|
6054
6054
|
}, v.toPrecision = function(B3, A) {
|
|
6055
6055
|
var g, I = this, Q = I.constructor;
|
|
6056
|
-
return B3 === void 0 ? g = Ug(I, I.e <= Q.toExpNeg || I.e >= Q.toExpPos) : (
|
|
6056
|
+
return B3 === void 0 ? g = Ug(I, I.e <= Q.toExpNeg || I.e >= Q.toExpPos) : (tg(B3, 1, CI), A === void 0 ? A = Q.rounding : tg(A, 0, 8), g = Ug(I = CA(new Q(I), B3, A), B3 <= I.e || I.e <= Q.toExpNeg, B3)), I.isNeg() && !I.isZero() ? "-" + g : g;
|
|
6057
6057
|
}, v.toSignificantDigits = v.toSD = function(B3, A) {
|
|
6058
6058
|
var g = this.constructor;
|
|
6059
|
-
return B3 === void 0 ? (B3 = g.precision, A = g.rounding) : (
|
|
6059
|
+
return B3 === void 0 ? (B3 = g.precision, A = g.rounding) : (tg(B3, 1, CI), A === void 0 ? A = g.rounding : tg(A, 0, 8)), CA(new g(this), B3, A);
|
|
6060
6060
|
}, v.toString = function() {
|
|
6061
6061
|
var B3 = this, A = B3.constructor, g = Ug(B3, B3.e <= A.toExpNeg || B3.e >= A.toExpPos);
|
|
6062
6062
|
return B3.isNeg() && !B3.isZero() ? "-" + g : g;
|
|
@@ -6088,7 +6088,7 @@ var NA = /* @__PURE__ */ function() {
|
|
|
6088
6088
|
return function(I, Q, C, a, E, e) {
|
|
6089
6089
|
var t, i, o, s, n, r, c, D, d, h, l, u, G, M, R, y, k, N, U, K, V = I.constructor, _ = I.s == Q.s ? 1 : -1, Z = I.d, z = Q.d;
|
|
6090
6090
|
if (!(Z && Z[0] && z && z[0])) return new V(I.s && Q.s && (Z ? !z || Z[0] != z[0] : z) ? Z && Z[0] == 0 || !z ? 0 * _ : _ / 0 : NaN);
|
|
6091
|
-
for (e ? (n = 1, i = I.e - Q.e) : (e = Rg, n = 7, i =
|
|
6091
|
+
for (e ? (n = 1, i = I.e - Q.e) : (e = Rg, n = 7, i = Ig(I.e / n) - Ig(Q.e / n)), U = z.length, k = Z.length, h = (d = new V(_)).d = [], o = 0; z[o] == (Z[o] || 0); o++) ;
|
|
6092
6092
|
if (z[o] > (Z[o] || 0) && i--, C == null ? (M = C = V.precision, a = V.rounding) : M = E ? C + (I.e - Q.e) + 1 : C, M < 0) h.push(1), r = true;
|
|
6093
6093
|
else {
|
|
6094
6094
|
if (M = M / n + 2 | 0, o = 0, U == 1) {
|
|
@@ -6143,7 +6143,7 @@ function CA(B3, A, g, I) {
|
|
|
6143
6143
|
}
|
|
6144
6144
|
function Ug(B3, A, g) {
|
|
6145
6145
|
if (!B3.isFinite()) return he(B3);
|
|
6146
|
-
var I, Q = B3.e, C =
|
|
6146
|
+
var I, Q = B3.e, C = Ag(B3.d), a = C.length;
|
|
6147
6147
|
return A ? (g && (I = g - a) > 0 ? C = C.charAt(0) + "." + C.slice(1) + QI(I) : a > 1 && (C = C.charAt(0) + "." + C.slice(1)), C = C + (B3.e < 0 ? "e" : "e+") + B3.e) : Q < 0 ? (C = "0." + QI(-Q - 1) + C, g && (I = g - a) > 0 && (C += QI(I))) : Q >= a ? (C += QI(Q + 1 - a), g && (I = g - Q - 1) > 0 && (C = C + "." + QI(I))) : ((I = Q + 1) < a && (C = C.slice(0, I) + "." + C.slice(I)), g && (I = g - a) > 0 && (Q + 1 === a && (C += "."), C += QI(I))), C;
|
|
6148
6148
|
}
|
|
6149
6149
|
function vB(B3, A) {
|
|
@@ -6174,7 +6174,7 @@ function QI(B3) {
|
|
|
6174
6174
|
function re(B3, A, g, I) {
|
|
6175
6175
|
var Q, C = new B3(1), a = Math.ceil(I / 7 + 4);
|
|
6176
6176
|
for (iA = false; ; ) {
|
|
6177
|
-
if (g % 2 && ra((C = C.times(A)).d, a) && (Q = true), (g =
|
|
6177
|
+
if (g % 2 && ra((C = C.times(A)).d, a) && (Q = true), (g = Ig(g / 2)) === 0) {
|
|
6178
6178
|
g = C.d.length - 1, Q && C.d[g] === 0 && ++C.d[g];
|
|
6179
6179
|
break;
|
|
6180
6180
|
}
|
|
@@ -6200,7 +6200,7 @@ function JQ(B3, A) {
|
|
|
6200
6200
|
if (!B3.d || !B3.d[0] || B3.e > 17) return new s(B3.d ? B3.d[0] ? B3.s < 0 ? 0 : 1 / 0 : 1 : B3.s ? B3.s < 0 ? 0 : B3 : NaN);
|
|
6201
6201
|
for (A == null ? (iA = false, e = r) : e = A, E = new s(0.03125); B3.e > -2; ) B3 = B3.times(E), o += 5;
|
|
6202
6202
|
for (e += I = Math.log(XA(2, o)) / Math.LN10 * 2 + 5 | 0, g = C = a = new s(1), s.precision = e; ; ) {
|
|
6203
|
-
if (C = CA(C.times(B3), e, 1), g = g.times(++i),
|
|
6203
|
+
if (C = CA(C.times(B3), e, 1), g = g.times(++i), Ag((E = a.plus(NA(C, g, e, 1))).d).slice(0, e) === Ag(a.d).slice(0, e)) {
|
|
6204
6204
|
for (Q = o; Q--; ) a = CA(a.times(a), e, 1);
|
|
6205
6205
|
if (A != null) return s.precision = r, a;
|
|
6206
6206
|
if (!(t < 3 && iB(a.d, e - I, n, t))) return CA(a, s.precision = r, n, iA = true);
|
|
@@ -6212,10 +6212,10 @@ function JQ(B3, A) {
|
|
|
6212
6212
|
function II(B3, A) {
|
|
6213
6213
|
var g, I, Q, C, a, E, e, t, i, o, s, n = 1, r = B3, c = r.d, D = r.constructor, d = D.rounding, h = D.precision;
|
|
6214
6214
|
if (r.s < 0 || !c || !c[0] || !r.e && c[0] == 1 && c.length == 1) return new D(c && !c[0] ? -1 / 0 : r.s != 1 ? NaN : c ? 0 : r);
|
|
6215
|
-
if (A == null ? (iA = false, i = h) : i = A, D.precision = i += 10, I = (g =
|
|
6216
|
-
for (; I < 7 && I != 1 || I == 1 && g.charAt(1) > 3; ) I = (g =
|
|
6215
|
+
if (A == null ? (iA = false, i = h) : i = A, D.precision = i += 10, I = (g = Ag(c)).charAt(0), !(Math.abs(C = r.e) < 15e14)) return t = $B(D, i + 2, h).times(C + ""), r = II(new D(I + "." + g.slice(1)), i - 10).plus(t), D.precision = h, A == null ? CA(r, h, d, iA = true) : r;
|
|
6216
|
+
for (; I < 7 && I != 1 || I == 1 && g.charAt(1) > 3; ) I = (g = Ag((r = r.times(B3)).d)).charAt(0), n++;
|
|
6217
6217
|
for (C = r.e, I > 1 ? (r = new D("0." + g), C++) : r = new D(I + "." + g.slice(1)), o = r, e = a = r = NA(r.minus(1), r.plus(1), i, 1), s = CA(r.times(r), i, 1), Q = 3; ; ) {
|
|
6218
|
-
if (a = CA(a.times(s), i, 1),
|
|
6218
|
+
if (a = CA(a.times(s), i, 1), Ag((t = e.plus(NA(a, new D(Q), i, 1))).d).slice(0, i) === Ag(e.d).slice(0, i)) {
|
|
6219
6219
|
if (e = e.times(2), C !== 0 && (e = e.plus($B(D, i + 2, h).times(C + ""))), e = NA(e, new D(n), i, 1), A != null) return D.precision = h, e;
|
|
6220
6220
|
if (!iB(e.d, i - 10, d, E)) return CA(e, D.precision = h, d, iA = true);
|
|
6221
6221
|
D.precision = i += 10, t = a = r = NA(o.minus(1), o.plus(1), i, 1), s = CA(r.times(r), i, 1), Q = E = 1;
|
|
@@ -6281,7 +6281,7 @@ function sa(B3, A) {
|
|
|
6281
6281
|
}
|
|
6282
6282
|
function YQ(B3, A, g, I) {
|
|
6283
6283
|
var Q, C, a, E, e, t, i, o, s, n = B3.constructor, r = g !== void 0;
|
|
6284
|
-
if (r ? (
|
|
6284
|
+
if (r ? (tg(g, 1, CI), I === void 0 ? I = n.rounding : tg(I, 0, 8)) : (g = n.precision, I = n.rounding), B3.isFinite()) {
|
|
6285
6285
|
for (r ? (Q = 2, A == 16 ? g = 4 * g - 3 : A == 8 && (g = 3 * g - 2)) : Q = A, (a = (i = Ug(B3)).indexOf(".")) >= 0 && (i = i.replace(".", ""), (s = new n(1)).e = i.length - a, s.d = jB(Ug(s), 10, Q), s.e = s.d.length), C = e = (o = jB(i, 10, Q)).length; o[--e] == 0; ) o.pop();
|
|
6286
6286
|
if (o[0]) {
|
|
6287
6287
|
if (a < 0 ? C-- : ((B3 = new n(B3)).d = o, B3.e = C, o = (B3 = NA(B3, s, g, I, 0, Q)).d, C = B3.e, t = ie), a = o[g], E = Q / 2, t = t || o[g + 1] !== void 0, t = I < 4 ? (a !== void 0 || t) && (I === 0 || I === (B3.s < 0 ? 3 : 2)) : a > E || a === E && (I === 4 || t || I === 6 && 1 & o[g - 1] || I === (B3.s < 0 ? 8 : 7)), o.length = g, t) for (; ++o[--g] > Q - 1; ) o[g] = 0, g || (++C, o.unshift(1));
|
|
@@ -6349,7 +6349,7 @@ function mo(B3) {
|
|
|
6349
6349
|
if (!B3 || typeof B3 != "object") throw Error(QQ + "Object expected");
|
|
6350
6350
|
var A, g, I, Q = B3.defaults === true, C = ["precision", 1, CI, "rounding", 0, 8, "toExpNeg", -xI, 0, "toExpPos", 0, xI, "maxE", 0, xI, "minE", -xI, 0, "modulo", 0, 9];
|
|
6351
6351
|
for (A = 0; A < C.length; A += 3) if (g = C[A], Q && (this[g] = QC[g]), (I = B3[g]) !== void 0) {
|
|
6352
|
-
if (!(
|
|
6352
|
+
if (!(Ig(I) === I && I >= C[A + 1] && I <= C[A + 2])) throw Error(eI + g + ": " + I);
|
|
6353
6353
|
this[g] = I;
|
|
6354
6354
|
}
|
|
6355
6355
|
if (g = "crypto", Q && (this[g] = QC[g]), (I = B3[g]) !== void 0) {
|
|
@@ -6417,7 +6417,7 @@ function Po(B3, A) {
|
|
|
6417
6417
|
}
|
|
6418
6418
|
function Vo(B3) {
|
|
6419
6419
|
var A, g, I, Q, C = 0, a = new this(1), E = [];
|
|
6420
|
-
if (B3 === void 0 ? B3 = this.precision :
|
|
6420
|
+
if (B3 === void 0 ? B3 = this.precision : tg(B3, 1, CI), I = Math.ceil(B3 / 7), this.crypto) if (crypto.getRandomValues) for (A = crypto.getRandomValues(new Uint32Array(I)); C < I; ) (Q = A[C]) >= 429e7 ? A[C] = crypto.getRandomValues(new Uint32Array(1))[0] : E[C++] = Q % 1e7;
|
|
6421
6421
|
else {
|
|
6422
6422
|
if (!crypto.randomBytes) throw Error(oe);
|
|
6423
6423
|
for (A = crypto.randomBytes(I *= 4); C < I; ) (Q = A[C] + (A[C + 1] << 8) + (A[C + 2] << 16) + ((127 & A[C + 3]) << 24)) >= 214e7 ? crypto.randomBytes(4).copy(A, C) : (E.push(Q % 1e7), C += 4);
|
|
@@ -6498,7 +6498,7 @@ var Cn = fA("BigNumber", ["?on", "config"], (B3) => {
|
|
|
6498
6498
|
Q.precision !== C.precision && I.config({ precision: Q.precision });
|
|
6499
6499
|
}), I;
|
|
6500
6500
|
}, { isClass: true });
|
|
6501
|
-
const
|
|
6501
|
+
const gg = Math.cosh || function(B3) {
|
|
6502
6502
|
return Math.abs(B3) < 1e-9 ? 1 - B3 : 0.5 * (Math.exp(B3) + Math.exp(-B3));
|
|
6503
6503
|
}, fg = Math.sinh || function(B3) {
|
|
6504
6504
|
return Math.abs(B3) < 1e-9 ? B3 : 0.5 * (Math.exp(B3) - Math.exp(-B3));
|
|
@@ -6623,22 +6623,22 @@ Y.prototype = { re: 0, im: 0, sign: function() {
|
|
|
6623
6623
|
return Math.atan2(this.im, this.re);
|
|
6624
6624
|
}, sin: function() {
|
|
6625
6625
|
const B3 = this.re, A = this.im;
|
|
6626
|
-
return new Y(Math.sin(B3) *
|
|
6626
|
+
return new Y(Math.sin(B3) * gg(A), Math.cos(B3) * fg(A));
|
|
6627
6627
|
}, cos: function() {
|
|
6628
6628
|
const B3 = this.re, A = this.im;
|
|
6629
|
-
return new Y(Math.cos(B3) *
|
|
6629
|
+
return new Y(Math.cos(B3) * gg(A), -Math.sin(B3) * fg(A));
|
|
6630
6630
|
}, tan: function() {
|
|
6631
|
-
const B3 = 2 * this.re, A = 2 * this.im, g = Math.cos(B3) +
|
|
6631
|
+
const B3 = 2 * this.re, A = 2 * this.im, g = Math.cos(B3) + gg(A);
|
|
6632
6632
|
return new Y(Math.sin(B3) / g, fg(A) / g);
|
|
6633
6633
|
}, cot: function() {
|
|
6634
|
-
const B3 = 2 * this.re, A = 2 * this.im, g = Math.cos(B3) -
|
|
6634
|
+
const B3 = 2 * this.re, A = 2 * this.im, g = Math.cos(B3) - gg(A);
|
|
6635
6635
|
return new Y(-Math.sin(B3) / g, fg(A) / g);
|
|
6636
6636
|
}, sec: function() {
|
|
6637
|
-
const B3 = this.re, A = this.im, g = 0.5 *
|
|
6638
|
-
return new Y(Math.cos(B3) *
|
|
6637
|
+
const B3 = this.re, A = this.im, g = 0.5 * gg(2 * A) + 0.5 * Math.cos(2 * B3);
|
|
6638
|
+
return new Y(Math.cos(B3) * gg(A) / g, Math.sin(B3) * fg(A) / g);
|
|
6639
6639
|
}, csc: function() {
|
|
6640
|
-
const B3 = this.re, A = this.im, g = 0.5 *
|
|
6641
|
-
return new Y(Math.sin(B3) *
|
|
6640
|
+
const B3 = this.re, A = this.im, g = 0.5 * gg(2 * A) - 0.5 * Math.cos(2 * B3);
|
|
6641
|
+
return new Y(Math.sin(B3) * gg(A) / g, -Math.cos(B3) * fg(A) / g);
|
|
6642
6642
|
}, asin: function() {
|
|
6643
6643
|
const B3 = this.re, A = this.im, g = new Y(A * A - B3 * B3 + 1, -2 * B3 * A).sqrt(), I = new Y(g.re - A, g.im + B3).log();
|
|
6644
6644
|
return new Y(I.im, -I.re);
|
|
@@ -6670,22 +6670,22 @@ Y.prototype = { re: 0, im: 0, sign: function() {
|
|
|
6670
6670
|
return g !== 0 ? new Y(B3 / g, -A / g).asin() : new Y(B3 !== 0 ? B3 / 0 : 0, A !== 0 ? -A / 0 : 0).asin();
|
|
6671
6671
|
}, sinh: function() {
|
|
6672
6672
|
const B3 = this.re, A = this.im;
|
|
6673
|
-
return new Y(fg(B3) * Math.cos(A),
|
|
6673
|
+
return new Y(fg(B3) * Math.cos(A), gg(B3) * Math.sin(A));
|
|
6674
6674
|
}, cosh: function() {
|
|
6675
6675
|
const B3 = this.re, A = this.im;
|
|
6676
|
-
return new Y(
|
|
6676
|
+
return new Y(gg(B3) * Math.cos(A), fg(B3) * Math.sin(A));
|
|
6677
6677
|
}, tanh: function() {
|
|
6678
|
-
const B3 = 2 * this.re, A = 2 * this.im, g =
|
|
6678
|
+
const B3 = 2 * this.re, A = 2 * this.im, g = gg(B3) + Math.cos(A);
|
|
6679
6679
|
return new Y(fg(B3) / g, Math.sin(A) / g);
|
|
6680
6680
|
}, coth: function() {
|
|
6681
|
-
const B3 = 2 * this.re, A = 2 * this.im, g =
|
|
6681
|
+
const B3 = 2 * this.re, A = 2 * this.im, g = gg(B3) - Math.cos(A);
|
|
6682
6682
|
return new Y(fg(B3) / g, -Math.sin(A) / g);
|
|
6683
6683
|
}, csch: function() {
|
|
6684
|
-
const B3 = this.re, A = this.im, g = Math.cos(2 * A) -
|
|
6685
|
-
return new Y(-2 * fg(B3) * Math.cos(A) / g, 2 *
|
|
6684
|
+
const B3 = this.re, A = this.im, g = Math.cos(2 * A) - gg(2 * B3);
|
|
6685
|
+
return new Y(-2 * fg(B3) * Math.cos(A) / g, 2 * gg(B3) * Math.sin(A) / g);
|
|
6686
6686
|
}, sech: function() {
|
|
6687
|
-
const B3 = this.re, A = this.im, g = Math.cos(2 * A) +
|
|
6688
|
-
return new Y(2 *
|
|
6687
|
+
const B3 = this.re, A = this.im, g = Math.cos(2 * A) + gg(2 * B3);
|
|
6688
|
+
return new Y(2 * gg(B3) * Math.cos(A) / g, -2 * fg(B3) * Math.sin(A) / g);
|
|
6689
6689
|
}, asinh: function() {
|
|
6690
6690
|
let B3 = this.im;
|
|
6691
6691
|
this.im = -this.re, this.re = B3;
|
|
@@ -7177,7 +7177,7 @@ function HI(B3, A, g) {
|
|
|
7177
7177
|
if (!(this instanceof HI)) throw new SyntaxError("Constructor must be called with the new operator");
|
|
7178
7178
|
this.index = B3, arguments.length < 3 ? (this.min = 0, this.max = A) : (this.min = A, this.max = g), this.min !== void 0 && this.index < this.min ? this.message = "Index out of range (" + this.index + " < " + this.min + ")" : this.max !== void 0 && this.index >= this.max ? this.message = "Index out of range (" + this.index + " > " + (this.max - 1) + ")" : this.message = "Index out of range (" + this.index + ")", this.stack = new Error().stack;
|
|
7179
7179
|
}
|
|
7180
|
-
function
|
|
7180
|
+
function Eg(B3) {
|
|
7181
7181
|
for (var A = []; Array.isArray(B3); ) A.push(B3.length), B3 = B3[0];
|
|
7182
7182
|
return A;
|
|
7183
7183
|
}
|
|
@@ -7271,7 +7271,7 @@ function be(B3) {
|
|
|
7271
7271
|
return B3.reduce((A, g) => A * g, 1);
|
|
7272
7272
|
}
|
|
7273
7273
|
function ue(B3, A, g, I) {
|
|
7274
|
-
var Q = I ||
|
|
7274
|
+
var Q = I || Eg(B3);
|
|
7275
7275
|
if (g) for (var C = 0; C < g; C++) B3 = [B3], Q.unshift(1);
|
|
7276
7276
|
for (B3 = we(B3, A, 0); Q.length < A; ) Q.push(1);
|
|
7277
7277
|
return B3;
|
|
@@ -7317,7 +7317,7 @@ function wa(B3, A) {
|
|
|
7317
7317
|
}
|
|
7318
7318
|
}
|
|
7319
7319
|
function fa(B3, A) {
|
|
7320
|
-
var g =
|
|
7320
|
+
var g = Eg(B3);
|
|
7321
7321
|
if (qI(g, A)) return B3;
|
|
7322
7322
|
wa(g, A);
|
|
7323
7323
|
var I, Q, C, a = function() {
|
|
@@ -7331,13 +7331,13 @@ function fa(B3, A) {
|
|
|
7331
7331
|
}(g, A), E = a.length, e = [...Array(E - g.length).fill(1), ...g], t = function(o) {
|
|
7332
7332
|
return PB([], o);
|
|
7333
7333
|
}(B3);
|
|
7334
|
-
g.length < E && (g =
|
|
7335
|
-
for (var i = 0; i < E; i++) g[i] < a[i] && (I = t, Q = a[i], C = i, g =
|
|
7334
|
+
g.length < E && (g = Eg(t = le(t, e)));
|
|
7335
|
+
for (var i = 0; i < E; i++) g[i] < a[i] && (I = t, Q = a[i], C = i, g = Eg(t = sn(...Array(Q).fill(I), C)));
|
|
7336
7336
|
return t;
|
|
7337
7337
|
}
|
|
7338
7338
|
function ye(B3, A) {
|
|
7339
7339
|
if (!Array.isArray(B3)) throw new Error("Array expected");
|
|
7340
|
-
var g =
|
|
7340
|
+
var g = Eg(B3);
|
|
7341
7341
|
if (A.length !== g.length) throw new LA(A.length, g.length);
|
|
7342
7342
|
for (var I = 0; I < A.length; I++) HA(A[I], g[I]);
|
|
7343
7343
|
return A.reduce((Q, C) => Q[C], B3);
|
|
@@ -7367,7 +7367,7 @@ function AQ(B3, A, g) {
|
|
|
7367
7367
|
var Q, C;
|
|
7368
7368
|
if (I) Q = 1;
|
|
7369
7369
|
else {
|
|
7370
|
-
var a = (A.isMatrix ? A.size() :
|
|
7370
|
+
var a = (A.isMatrix ? A.size() : Eg(A)).map(() => 0), E = A.isMatrix ? A.get(a) : ye(A, a);
|
|
7371
7371
|
Q = function(t, i, o, s) {
|
|
7372
7372
|
for (var n = [i, o, s], r = 3; r > 0; r--) {
|
|
7373
7373
|
var c = n.slice(0, r);
|
|
@@ -7424,7 +7424,7 @@ var cn = fA("DenseMatrix", ["Matrix"], (B3) => {
|
|
|
7424
7424
|
if (E && !Lg(E)) throw new Error("Invalid datatype: " + E);
|
|
7425
7425
|
if (qA(a)) a.type === "DenseMatrix" ? (this._data = vA(a._data), this._size = vA(a._size), this._datatype = E || a._datatype) : (this._data = a.toArray(), this._size = a.size(), this._datatype = E || a._datatype);
|
|
7426
7426
|
else if (a && zA(a.data) && zA(a.size)) this._data = a.data, this._size = a.size, ua(this._data, this._size), this._datatype = E || a.datatype;
|
|
7427
|
-
else if (zA(a)) this._data = C(a), this._size =
|
|
7427
|
+
else if (zA(a)) this._data = C(a), this._size = Eg(this._data), ua(this._data, this._size), this._datatype = E;
|
|
7428
7428
|
else {
|
|
7429
7429
|
if (a) throw new TypeError("Unsupported type of data (" + EI(a) + ")");
|
|
7430
7430
|
this._data = [], this._size = [0], this._datatype = E;
|
|
@@ -7480,12 +7480,12 @@ var cn = fA("DenseMatrix", ["Matrix"], (B3) => {
|
|
|
7480
7480
|
return function(t, i, o, s) {
|
|
7481
7481
|
if (!i || i.isIndex !== true) throw new TypeError("Invalid index");
|
|
7482
7482
|
var n, r = i.size(), c = i.isScalar();
|
|
7483
|
-
if (qA(o) ? (n = o.size(), o = o.valueOf()) : n =
|
|
7483
|
+
if (qA(o) ? (n = o.size(), o = o.valueOf()) : n = Eg(o), c) {
|
|
7484
7484
|
if (n.length !== 0) throw new TypeError("Scalar expected");
|
|
7485
7485
|
t.set(i.min(), o, s);
|
|
7486
7486
|
} else {
|
|
7487
7487
|
if (!qI(n, r)) try {
|
|
7488
|
-
n =
|
|
7488
|
+
n = Eg(o = n.length === 0 ? fa([o], r) : fa(o, r));
|
|
7489
7489
|
} catch {
|
|
7490
7490
|
}
|
|
7491
7491
|
if (r.length < t._size.length) throw new LA(r.length, t._size.length, "<");
|
|
@@ -7861,7 +7861,7 @@ var ln = fA("SparseMatrix", ["typed", "equalScalar", "Matrix"], (B3) => {
|
|
|
7861
7861
|
return function(n, r, c, D) {
|
|
7862
7862
|
if (!r || r.isIndex !== true) throw new TypeError("Invalid index");
|
|
7863
7863
|
var d, h = r.size(), l = r.isScalar();
|
|
7864
|
-
if (qA(c) ? (d = c.size(), c = c.toArray()) : d =
|
|
7864
|
+
if (qA(c) ? (d = c.size(), c = c.toArray()) : d = Eg(c), l) {
|
|
7865
7865
|
if (d.length !== 0) throw new TypeError("Scalar expected");
|
|
7866
7866
|
n.set(r.min(), c, D);
|
|
7867
7867
|
} else {
|
|
@@ -8410,7 +8410,7 @@ var ln = fA("SparseMatrix", ["typed", "equalScalar", "Matrix"], (B3) => {
|
|
|
8410
8410
|
return yA[k] = eA.length, EA;
|
|
8411
8411
|
} });
|
|
8412
8412
|
return A(ma, Q, { "Array, Array": A.referTo("Matrix, Matrix", (n) => (r, c) => {
|
|
8413
|
-
t(
|
|
8413
|
+
t(Eg(r), Eg(c));
|
|
8414
8414
|
var D = n(g(r), g(c));
|
|
8415
8415
|
return qA(D) ? D.valueOf() : D;
|
|
8416
8416
|
}), "Matrix, Matrix": function(n, r) {
|
|
@@ -8497,7 +8497,7 @@ var La, Ja = "size", Jn = fA(Ja, ["typed", "config", "?matrix"], (B3) => {
|
|
|
8497
8497
|
var { typed: A, config: g, matrix: I } = B3;
|
|
8498
8498
|
return A(Ja, { Matrix: function(Q) {
|
|
8499
8499
|
return Q.create(Q.size(), "number");
|
|
8500
|
-
}, Array:
|
|
8500
|
+
}, Array: Eg, string: function(Q) {
|
|
8501
8501
|
return g.matrix === "Array" ? [Q.length] : I([Q.length], "dense", "number");
|
|
8502
8502
|
}, "number | Complex | BigNumber | Unit | boolean | null": function(Q) {
|
|
8503
8503
|
return g.matrix === "Array" ? [] : I ? I([], "dense", "number") : function() {
|
|
@@ -8555,7 +8555,7 @@ var La, Ja = "size", Jn = fA(Ja, ["typed", "config", "?matrix"], (B3) => {
|
|
|
8555
8555
|
}
|
|
8556
8556
|
function o(n, r) {
|
|
8557
8557
|
if (!xA(r)) throw new TypeError("For A^b, b must be an integer (value is " + r + ")");
|
|
8558
|
-
var c =
|
|
8558
|
+
var c = Eg(n);
|
|
8559
8559
|
if (c.length !== 2) throw new Error("For A^b, A must be 2 dimensional (A has " + c.length + " dimensions)");
|
|
8560
8560
|
if (c[0] !== c[1]) throw new Error("For A^b, A must be square (size is " + c[0] + "x" + c[1] + ")");
|
|
8561
8561
|
if (r < 0) try {
|
|
@@ -8662,7 +8662,7 @@ var La, Ja = "size", Jn = fA(Ja, ["typed", "config", "?matrix"], (B3) => {
|
|
|
8662
8662
|
}), vn = fA("inv", ["typed", "matrix", "divideScalar", "addScalar", "multiply", "unaryMinus", "det", "identity", "abs"], (B3) => {
|
|
8663
8663
|
var { typed: A, matrix: g, divideScalar: I, addScalar: Q, multiply: C, unaryMinus: a, det: E, identity: e, abs: t } = B3;
|
|
8664
8664
|
return A("inv", { "Array | Matrix": function(o) {
|
|
8665
|
-
var s = qA(o) ? o.size() :
|
|
8665
|
+
var s = qA(o) ? o.size() : Eg(o);
|
|
8666
8666
|
switch (s.length) {
|
|
8667
8667
|
case 1:
|
|
8668
8668
|
if (s[0] === 1) return qA(o) ? g([I(1, o.valueOf()[0])]) : [I(1, o[0])];
|
|
@@ -9211,10 +9211,10 @@ class gs extends VQ {
|
|
|
9211
9211
|
const a = Math.min(Math.ceil(4) * 1024, Math.pow(1024, 2));
|
|
9212
9212
|
let E = 1 * Math.pow(1024, 2);
|
|
9213
9213
|
E = Math.floor(E / a) * a;
|
|
9214
|
-
const e = new fB(1024, 1024, 1, { magFilter: og, minFilter: og, type: ng, format:
|
|
9215
|
-
e.texture.type = ng, e.texture.format =
|
|
9216
|
-
const t = new fB(1024, 1024, 1, { magFilter: og, minFilter: og, anisotropy: 0, type: ng, format:
|
|
9217
|
-
t.texture.type = ng, t.texture.format =
|
|
9214
|
+
const e = new fB(1024, 1024, 1, { magFilter: og, minFilter: og, type: ng, format: ag, anisotropy: 0, depthBuffer: false, resolveDepthBuffer: false });
|
|
9215
|
+
e.texture.type = ng, e.texture.format = ag, e.texture.internalFormat = "RGBA32F", A.initRenderTarget(e);
|
|
9216
|
+
const t = new fB(1024, 1024, 1, { magFilter: og, minFilter: og, anisotropy: 0, type: ng, format: ag, depthBuffer: false, resolveDepthBuffer: false });
|
|
9217
|
+
t.texture.type = ng, t.texture.format = ag, t.texture.internalFormat = "RGBA32F", A.initRenderTarget(t);
|
|
9218
9218
|
const i = new lQ({ glslVersion: bQ, uniforms: { textureSize: { value: 1024 }, numSlices: { value: 1 }, covarianceTexture: { value: t.texture }, positionColorTexture: { value: e.texture }, zUpToYUpMatrix3x3: { value: Ye }, sizeMultiplier: { value: 1 * (Q || 1) }, cropRadius: { value: Number.MAX_VALUE }, viewportPixelSize: { value: new TB() }, k: { value: 2 }, beta_k: { value: 2 }, minSplatPixelSize: { value: 0 }, minOpacity: { value: 0.01 }, culling: { value: false }, antialiasingFactor: { value: 2 }, depthBias: { value: 0 }, exposureEV: { value: 0 }, saturation: { value: 1 }, contrast: { value: 1 }, tempTint: { value: new TB(0, 0) } }, vertexShader: Is(), fragmentShader: I || Bs(), transparent: true, side: LB, depthTest: true, depthWrite: false, blending: Ni }), o = new xC(), s = new Float32Array([-0.5, 0.5, 0, 0.5, 0.5, 0, -0.5, -0.5, 0, 0.5, -0.5, 0]);
|
|
9219
9219
|
o.setIndex([0, 2, 1, 2, 3, 1]), o.setAttribute("position", new aI(s, 3));
|
|
9220
9220
|
const n = new Uint32Array(E), r = new WQ(n, 1, false);
|
|
@@ -9316,7 +9316,7 @@ void main() {
|
|
|
9316
9316
|
this.renderer.initRenderTarget(A.newPositionColorRenderTarget), this.copyTex3D(A.oldPositionColorRenderTarget.texture, A.newPositionColorRenderTarget, g), A.oldPositionColorRenderTarget.dispose(), this.positionColorRenderTarget = A.newPositionColorRenderTarget, this.material.uniforms.positionColorTexture.value = this.positionColorRenderTarget.texture, this.renderer.initRenderTarget(A.newCovarianceRenderTarget), this.copyTex3D(A.oldCovarianceRenderTarget.texture, A.newCovarianceRenderTarget, g), A.oldCovarianceRenderTarget.dispose(), this.covarianceRenderTarget = A.newCovarianceRenderTarget, this.material.uniforms.covarianceTexture.value = this.covarianceRenderTarget.texture, this.numTextures = A.newNumTextures, this.material.uniforms.numSlices.value = this.numTextures;
|
|
9317
9317
|
}
|
|
9318
9318
|
for (; this._pendingTextureCopies.length > 0; ) {
|
|
9319
|
-
const A = this._pendingTextureCopies.shift(), g = new iE(A.array, A.textureSize, A.srcHeight,
|
|
9319
|
+
const A = this._pendingTextureCopies.shift(), g = new iE(A.array, A.textureSize, A.srcHeight, ag, ng);
|
|
9320
9320
|
g.internalFormat = "RGBA32F", g.generateMipmaps = false, g.magFilter = og, g.minFilter = og, g.anisotropy = 0, g.needsUpdate = true, this.renderer.initTexture(g);
|
|
9321
9321
|
const I = A.kind === "positionColor" ? this.positionColorRenderTarget : this.covarianceRenderTarget;
|
|
9322
9322
|
this.copyTex2D(g, I, A.scissor, A.destTextureLayer), g.dispose();
|
|
@@ -9395,10 +9395,10 @@ void main() {
|
|
|
9395
9395
|
growTextures() {
|
|
9396
9396
|
for (let Q = this.maxSplats; Q < this.maxSplats + this.textureSize * this.textureSize; Q += this.batchSize) this.freeAddresses.add(Q);
|
|
9397
9397
|
this.maxSplats += this.textureSize * this.textureSize;
|
|
9398
|
-
const A = this.numTextures + 1, g = new fB(this.textureSize, this.textureSize, A, { magFilter: og, minFilter: og, type: ng, format:
|
|
9399
|
-
g.texture.type = ng, g.texture.internalFormat = "RGBA32F", g.texture.format =
|
|
9400
|
-
const I = new fB(this.textureSize, this.textureSize, A, { magFilter: og, minFilter: og, anisotropy: 0, type: ng, format:
|
|
9401
|
-
I.texture.type = ng, I.texture.internalFormat = "RGBA32F", I.texture.format =
|
|
9398
|
+
const A = this.numTextures + 1, g = new fB(this.textureSize, this.textureSize, A, { magFilter: og, minFilter: og, type: ng, format: ag, anisotropy: 0, depthBuffer: false, resolveDepthBuffer: false });
|
|
9399
|
+
g.texture.type = ng, g.texture.internalFormat = "RGBA32F", g.texture.format = ag;
|
|
9400
|
+
const I = new fB(this.textureSize, this.textureSize, A, { magFilter: og, minFilter: og, anisotropy: 0, type: ng, format: ag, depthBuffer: false, resolveDepthBuffer: false });
|
|
9401
|
+
I.texture.type = ng, I.texture.internalFormat = "RGBA32F", I.texture.format = ag, this._pendingGrowOperations.push({ newPositionColorRenderTarget: g, newCovarianceRenderTarget: I, oldPositionColorRenderTarget: this.positionColorRenderTarget, oldCovarianceRenderTarget: this.covarianceRenderTarget, oldNumTextures: this.numTextures, newNumTextures: A });
|
|
9402
9402
|
}
|
|
9403
9403
|
}
|
|
9404
9404
|
function Is() {
|
|
@@ -10344,7 +10344,7 @@ function vQ() {
|
|
|
10344
10344
|
A += g + ", ";
|
|
10345
10345
|
}), A = A.slice(0, -2), MA.textContent = A;
|
|
10346
10346
|
}
|
|
10347
|
-
const
|
|
10347
|
+
const ig = new J.Sphere(new J.Vector3(0, 0, 0), 1), gI = new J.Vector3(0, 0, 0), qQ = new J.Vector3(0, 0, 0), es = new J.Vector3(0, 1, 0), TQ = new J.Vector2(), Va = new J.Quaternion(), za = new J.Matrix4();
|
|
10348
10348
|
class FC extends J.Object3D {
|
|
10349
10349
|
constructor(A) {
|
|
10350
10350
|
super();
|
|
@@ -10490,12 +10490,12 @@ class FC extends J.Object3D {
|
|
|
10490
10490
|
}
|
|
10491
10491
|
calculateUpdateMetric(A, g) {
|
|
10492
10492
|
if (this.boundingVolume instanceof bg) {
|
|
10493
|
-
if (
|
|
10493
|
+
if (ig.copy(this.boundingVolume.sphere), ig.applyMatrix4(this.matrixWorld), !g.intersectsSphere(ig)) return -1;
|
|
10494
10494
|
} else {
|
|
10495
10495
|
if (!(this.boundingVolume instanceof J.Sphere)) return console.error("unsupported shape"), -1;
|
|
10496
|
-
if (
|
|
10496
|
+
if (ig.copy(this.boundingVolume), ig.applyMatrix4(this.matrixWorld), !g.intersectsSphere(ig)) return -1;
|
|
10497
10497
|
}
|
|
10498
|
-
let I = Math.max(0, A.position.distanceTo(
|
|
10498
|
+
let I = Math.max(0, A.position.distanceTo(ig.center) - ig.radius);
|
|
10499
10499
|
if (I = Math.pow(I, this.distanceBias), I == 0) return 0;
|
|
10500
10500
|
const Q = this.matrixWorld.getMaxScaleOnAxis();
|
|
10501
10501
|
this.master._renderSize(TQ);
|
|
@@ -10517,7 +10517,7 @@ class FC extends J.Object3D {
|
|
|
10517
10517
|
}), g;
|
|
10518
10518
|
}
|
|
10519
10519
|
calculateDistanceToCamera(A) {
|
|
10520
|
-
return this.boundingVolume instanceof bg ? (
|
|
10520
|
+
return this.boundingVolume instanceof bg ? (ig.copy(this.boundingVolume.sphere), ig.applyMatrix4(this.matrixWorld)) : this.boundingVolume instanceof J.Sphere ? (ig.copy(this.boundingVolume), ig.applyMatrix4(this.matrixWorld)) : console.error("unsupported shape"), Math.max(0, A.position.distanceTo(ig.center) - ig.radius);
|
|
10521
10521
|
}
|
|
10522
10522
|
getWorldMatrix() {
|
|
10523
10523
|
return this.matrixWorld;
|
|
@@ -10767,12 +10767,12 @@ async function os(B3) {
|
|
|
10767
10767
|
});
|
|
10768
10768
|
}
|
|
10769
10769
|
function ns(B3) {
|
|
10770
|
-
return new Worker("" + new URL("assets/physicsRapier.worker-
|
|
10770
|
+
return new Worker("" + new URL("assets/physicsRapier.worker-BMqv2qnC.js", import.meta.url).href, { type: "module", name: B3 == null ? void 0 : B3.name });
|
|
10771
10771
|
}
|
|
10772
10772
|
function ss(B3) {
|
|
10773
10773
|
return new Worker("" + new URL("assets/physicsHelper.worker-Cr8S3sZk.js", import.meta.url).href, { type: "module", name: B3 == null ? void 0 : B3.name });
|
|
10774
10774
|
}
|
|
10775
|
-
function
|
|
10775
|
+
function _A(B3, A = [0, -9.81, 0]) {
|
|
10776
10776
|
return B3 ? Array.isArray(B3) && B3.length === 3 ? [Number(B3[0]), Number(B3[1]), Number(B3[2])] : B3.isVector3 ? [B3.x, B3.y, B3.z] : typeof B3 == "object" && "x" in B3 && "y" in B3 && "z" in B3 ? [Number(B3.x), Number(B3.y), Number(B3.z)] : A.slice() : A.slice();
|
|
10777
10777
|
}
|
|
10778
10778
|
function QB(B3, A = [0, 0, 0, 1]) {
|
|
@@ -10786,9 +10786,9 @@ function QB(B3, A = [0, 0, 0, 1]) {
|
|
|
10786
10786
|
return A.slice();
|
|
10787
10787
|
}
|
|
10788
10788
|
function Xa(B3) {
|
|
10789
|
-
if (Array.isArray(B3) || B3 && B3.isVector3) return { mode: "vector", vector:
|
|
10789
|
+
if (Array.isArray(B3) || B3 && B3.isVector3) return { mode: "vector", vector: _A(B3) };
|
|
10790
10790
|
const A = B3 || {};
|
|
10791
|
-
return (A.mode || "vector").toLowerCase() === "geocentric" ? { mode: "geocentric", planetCenter:
|
|
10791
|
+
return (A.mode || "vector").toLowerCase() === "geocentric" ? { mode: "geocentric", planetCenter: _A(A.planetCenter || [0, 0, 0], [0, 0, 0]), intensity: typeof A.intensity == "number" ? A.intensity : 9.81 } : { mode: "vector", vector: _A(A.vector || A, [0, -9.81, 0]) };
|
|
10792
10792
|
}
|
|
10793
10793
|
function SB() {
|
|
10794
10794
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
@@ -10805,7 +10805,7 @@ class ds {
|
|
|
10805
10805
|
});
|
|
10806
10806
|
}
|
|
10807
10807
|
addObject(A = {}) {
|
|
10808
|
-
const g = "rb-" + this._nextBodyId++, I = (A.type || "dynamic").toLowerCase(), Q = typeof A.mass == "number" ? A.mass : 1, C =
|
|
10808
|
+
const g = "rb-" + this._nextBodyId++, I = (A.type || "dynamic").toLowerCase(), Q = typeof A.mass == "number" ? A.mass : 1, C = _A(A.position, [0, 0, 0]), a = QB(A.rotation, [0, 0, 0, 1]), E = A.velocity ? _A(A.velocity, [0, 0, 0]) : void 0, e = A.angularVelocity ? _A(A.angularVelocity, [0, 0, 0]) : void 0;
|
|
10809
10809
|
return this.rigidBodies.set(g, { id: g, object: A.object || null, type: I, mass: Q, last: { p: C, q: a }, current: { p: C.slice(), q: a.slice() } }), this.bodyToColliders.set(g, /* @__PURE__ */ new Set()), this._post({ type: "addObject", id: g, body: { type: I, mass: Q, p: C, q: a, v: E, w: e } }), g;
|
|
10810
10810
|
}
|
|
10811
10811
|
attachTrimeshCollider({ bodyId: A, geometry: g, positions: I, indices: Q, localPosition: C, localRotation: a, localScale: E }) {
|
|
@@ -10827,7 +10827,7 @@ class ds {
|
|
|
10827
10827
|
}
|
|
10828
10828
|
} else I && (e = Array.isArray(I) || I instanceof Float32Array ? new Float32Array(I) : new Float32Array(I.buffer || I)), Q && (t = Array.isArray(Q) || Q instanceof Uint32Array ? new Uint32Array(Q) : new Uint32Array(Q.buffer || Q));
|
|
10829
10829
|
if (!(e instanceof Float32Array)) return console.warn("attachTrimeshCollider: missing or invalid positions buffer"), Promise.resolve(null);
|
|
10830
|
-
const i = C ?
|
|
10830
|
+
const i = C ? _A(C, [0, 0, 0]) : [0, 0, 0], o = a ? QB(a, [0, 0, 0, 1]) : [0, 0, 0, 1], s = Array.isArray(E) && E.length === 3 ? [Number(E[0]), Number(E[1]), Number(E[2])] : [1, 1, 1], n = "col-" + this._nextColliderId++, r = this.bodyToColliders.get(A) || /* @__PURE__ */ new Set();
|
|
10831
10831
|
r.add(n), this.bodyToColliders.set(A, r), this.colliderToBody.set(n, A);
|
|
10832
10832
|
const c = { type: "attachTrimeshCollider", id: n, bodyId: A, positions: e, indices: t || null, local: { p: i, q: o, s } }, D = [];
|
|
10833
10833
|
return (e == null ? void 0 : e.buffer) && D.push(e.buffer), (t == null ? void 0 : t.buffer) && D.push(t.buffer), this._post(c, D).then(() => n);
|
|
@@ -10851,7 +10851,7 @@ class ds {
|
|
|
10851
10851
|
}
|
|
10852
10852
|
} else I && (e = Array.isArray(I) || I instanceof Float32Array ? new Float32Array(I) : new Float32Array(I.buffer || I)), Q && (t = Array.isArray(Q) || Q instanceof Uint32Array ? new Uint32Array(Q) : new Uint32Array(Q.buffer || Q));
|
|
10853
10853
|
if (!(e instanceof Float32Array)) return console.warn("addConvexHullCollider: missing or invalid positions buffer"), Promise.resolve(null);
|
|
10854
|
-
const i = C ?
|
|
10854
|
+
const i = C ? _A(C, [0, 0, 0]) : [0, 0, 0], o = a ? QB(a, [0, 0, 0, 1]) : [0, 0, 0, 1], s = Array.isArray(E) && E.length === 3 ? [Number(E[0]), Number(E[1]), Number(E[2])] : [1, 1, 1], n = "col-" + this._nextColliderId++, r = this.bodyToColliders.get(A) || /* @__PURE__ */ new Set();
|
|
10855
10855
|
r.add(n), this.bodyToColliders.set(A, r), this.colliderToBody.set(n, A);
|
|
10856
10856
|
const c = { type: "computeConvexHull", positions: e, indices: t || null, localScale: s }, D = [];
|
|
10857
10857
|
return (e == null ? void 0 : e.buffer) && D.push(e.buffer), (t == null ? void 0 : t.buffer) && D.push(t.buffer), this._helperPost(c, D).then((d) => {
|
|
@@ -10867,7 +10867,7 @@ class ds {
|
|
|
10867
10867
|
attachShapeCollider({ bodyId: A, shape: g, localPosition: I, localRotation: Q }) {
|
|
10868
10868
|
if (!this.rigidBodies.has(A)) return console.warn(`attachShapeCollider: unknown bodyId ${A}`), Promise.resolve(null);
|
|
10869
10869
|
if (!g || typeof g != "object") return console.warn("attachShapeCollider: missing or invalid shape descriptor"), Promise.resolve(null);
|
|
10870
|
-
const C = I ?
|
|
10870
|
+
const C = I ? _A(I, [0, 0, 0]) : [0, 0, 0], a = Q ? QB(Q, [0, 0, 0, 1]) : [0, 0, 0, 1], E = "col-" + this._nextColliderId++, e = this.bodyToColliders.get(A) || /* @__PURE__ */ new Set();
|
|
10871
10871
|
e.add(E), this.bodyToColliders.set(A, e), this.colliderToBody.set(E, A);
|
|
10872
10872
|
const t = { type: "attachShapeCollider", id: E, bodyId: A, shape: g, local: { p: C, q: a } };
|
|
10873
10873
|
return this._post(t), E;
|
|
@@ -10884,10 +10884,27 @@ class ds {
|
|
|
10884
10884
|
if (g) for (const I of g) this.colliderToBody.delete(I);
|
|
10885
10885
|
this.bodyToColliders.delete(A), this.rigidBodies.delete(A), this._post({ type: "removeObject", id: A });
|
|
10886
10886
|
}
|
|
10887
|
-
applyForce({ bodyId: A, force: g, worldPoint: I, wake: Q = true, impulse: C = false }) {
|
|
10887
|
+
applyForce({ bodyId: A, force: g, worldPoint: I, wake: Q = true, impulse: C = false, resetForces: a = false, resetTorques: E = false }) {
|
|
10888
10888
|
if (!this.rigidBodies.has(A)) return void console.warn(`applyForce: unknown bodyId ${A}`);
|
|
10889
|
-
const
|
|
10890
|
-
this._post({ type: "applyForce", id: A, force:
|
|
10889
|
+
const e = _A(g, [0, 0, 0]), t = I ? _A(I, [0, 0, 0]) : void 0;
|
|
10890
|
+
this._post({ type: "applyForce", id: A, force: e, point: t, wake: !!Q, impulse: !!C, resetForces: !!a, resetTorques: !!E });
|
|
10891
|
+
}
|
|
10892
|
+
applyForces({ bodyId: A, forces: g, worldPoints: I, wake: Q = true, impulse: C = false, resetForces: a = false, resetTorques: E = false }) {
|
|
10893
|
+
if (!this.rigidBodies.has(A)) return void console.warn(`applyForces: unknown bodyId ${A}`);
|
|
10894
|
+
if (!Array.isArray(g)) return;
|
|
10895
|
+
const e = g.map((i) => _A(i, [0, 0, 0])), t = Array.isArray(I) ? I.map((i) => i ? _A(i, [0, 0, 0]) : void 0) : [];
|
|
10896
|
+
this._post({ type: "applyForces", id: A, forces: e, points: t, wake: !!Q, impulse: !!C, resetForces: !!a, resetTorques: !!E });
|
|
10897
|
+
}
|
|
10898
|
+
applyTorque({ bodyId: A, torque: g, wake: I = true, impulse: Q = false, resetTorques: C = false }) {
|
|
10899
|
+
if (!this.rigidBodies.has(A)) return void console.warn(`applyTorque: unknown bodyId ${A}`);
|
|
10900
|
+
const a = _A(g, [0, 0, 0]);
|
|
10901
|
+
this._post({ type: "applyTorque", id: A, torque: a, wake: !!I, impulse: !!Q, resetTorques: !!C });
|
|
10902
|
+
}
|
|
10903
|
+
applyTorques({ bodyId: A, torques: g, wake: I = true, impulse: Q = false, resetTorques: C = false }) {
|
|
10904
|
+
if (!this.rigidBodies.has(A)) return void console.warn(`applyTorques: unknown bodyId ${A}`);
|
|
10905
|
+
if (!Array.isArray(g)) return;
|
|
10906
|
+
const a = g.map((E) => _A(E, [0, 0, 0]));
|
|
10907
|
+
this._post({ type: "applyTorques", id: A, torques: a, wake: !!I, impulse: !!Q, resetTorques: !!C });
|
|
10891
10908
|
}
|
|
10892
10909
|
setGravity(A) {
|
|
10893
10910
|
this.gravity = Xa(A), this._post({ type: "setGravity", gravity: this.gravity });
|
|
@@ -10895,13 +10912,13 @@ class ds {
|
|
|
10895
10912
|
setPose({ bodyId: A, position: g, rotation: I, wake: Q = true }) {
|
|
10896
10913
|
var _a2, _b, _c;
|
|
10897
10914
|
if (!this.rigidBodies.has(A)) return void console.warn(`setPose: unknown bodyId ${A}`);
|
|
10898
|
-
const C = g != null ?
|
|
10915
|
+
const C = g != null ? _A(g, [0, 0, 0]) : null, a = I != null ? QB(I, [0, 0, 0, 1]) : null;
|
|
10899
10916
|
this._post({ type: "setPose", id: A, p: C, q: a, wake: !!Q });
|
|
10900
10917
|
const E = this.rigidBodies.get(A);
|
|
10901
10918
|
E && (C && (E.last.p = C.slice(), E.current.p = C.slice(), ((_a2 = E.object) == null ? void 0 : _a2.isObject3D) && E.object.position.set(C[0], C[1], C[2])), a && (E.last.q = a.slice(), E.current.q = a.slice(), ((_b = E.object) == null ? void 0 : _b.isObject3D) && E.object.quaternion.set(a[0], a[1], a[2], a[3])), ((_c = E.object) == null ? void 0 : _c.isObject3D) && (E.object.updateMatrices ? E.object.updateMatrices() : (E.object.matrixAutoUpdate !== false && E.object.updateMatrix(), E.object.matrixWorldAutoUpdate !== false && E.object.updateMatrixWorld(true))));
|
|
10902
10919
|
}
|
|
10903
10920
|
raycast({ origin: A, direction: g, maxToi: I = 1e6, filter: Q }) {
|
|
10904
|
-
const C =
|
|
10921
|
+
const C = _A(A, [0, 0, 0]), a = _A(g, [0, -1, 0]);
|
|
10905
10922
|
return this._post({ type: "raycast", origin: C, direction: a, maxToi: I, filter: Q || null });
|
|
10906
10923
|
}
|
|
10907
10924
|
pause() {
|