minerender 2.1.0-alpha.70 → 2.1.0-alpha.73
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/README.md +38 -0
- package/dist/browser/index.d.mts +44 -4
- package/dist/browser/index.d.ts +44 -4
- package/dist/browser/index.js +416 -196
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +416 -196
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +974 -748
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +44 -4
- package/dist/node/index.d.ts +44 -4
- package/dist/node/index.js +420 -196
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +418 -196
- package/dist/node/index.mjs.map +1 -1
- package/package.json +12 -4
package/dist/bundle.js
CHANGED
|
@@ -498,7 +498,7 @@ var MineRender = (() => {
|
|
|
498
498
|
Buffer2.isBuffer = function isBuffer2(b4) {
|
|
499
499
|
return b4 != null && b4._isBuffer === true && b4 !== Buffer2.prototype;
|
|
500
500
|
};
|
|
501
|
-
Buffer2.compare = function
|
|
501
|
+
Buffer2.compare = function compare2(a4, b4) {
|
|
502
502
|
if (isInstance(a4, Uint8Array)) a4 = Buffer2.from(a4, a4.offset, a4.byteLength);
|
|
503
503
|
if (isInstance(b4, Uint8Array)) b4 = Buffer2.from(b4, b4.offset, b4.byteLength);
|
|
504
504
|
if (!Buffer2.isBuffer(a4) || !Buffer2.isBuffer(b4)) {
|
|
@@ -720,7 +720,7 @@ var MineRender = (() => {
|
|
|
720
720
|
if (customInspectSymbol) {
|
|
721
721
|
Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
|
|
722
722
|
}
|
|
723
|
-
Buffer2.prototype.compare = function
|
|
723
|
+
Buffer2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) {
|
|
724
724
|
if (isInstance(target, Uint8Array)) {
|
|
725
725
|
target = Buffer2.from(target, target.offset, target.byteLength);
|
|
726
726
|
}
|
|
@@ -4473,7 +4473,7 @@ var MineRender = (() => {
|
|
|
4473
4473
|
}
|
|
4474
4474
|
return true;
|
|
4475
4475
|
}
|
|
4476
|
-
function checkIntersection$1(
|
|
4476
|
+
function checkIntersection$1(object2, material, raycaster, ray, pA, pB, pC, point) {
|
|
4477
4477
|
let intersect2;
|
|
4478
4478
|
if (material.side === BackSide) {
|
|
4479
4479
|
intersect2 = ray.intersectTriangle(pC, pB, pA, true, point);
|
|
@@ -4482,20 +4482,20 @@ var MineRender = (() => {
|
|
|
4482
4482
|
}
|
|
4483
4483
|
if (intersect2 === null) return null;
|
|
4484
4484
|
_intersectionPointWorld.copy(point);
|
|
4485
|
-
_intersectionPointWorld.applyMatrix4(
|
|
4485
|
+
_intersectionPointWorld.applyMatrix4(object2.matrixWorld);
|
|
4486
4486
|
const distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld);
|
|
4487
4487
|
if (distance < raycaster.near || distance > raycaster.far) return null;
|
|
4488
4488
|
return {
|
|
4489
4489
|
distance,
|
|
4490
4490
|
point: _intersectionPointWorld.clone(),
|
|
4491
|
-
object
|
|
4491
|
+
object: object2
|
|
4492
4492
|
};
|
|
4493
4493
|
}
|
|
4494
|
-
function checkGeometryIntersection(
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
const intersection = checkIntersection$1(
|
|
4494
|
+
function checkGeometryIntersection(object2, material, raycaster, ray, uv, uv1, normal, a4, b4, c4) {
|
|
4495
|
+
object2.getVertexPosition(a4, _vA);
|
|
4496
|
+
object2.getVertexPosition(b4, _vB);
|
|
4497
|
+
object2.getVertexPosition(c4, _vC);
|
|
4498
|
+
const intersection = checkIntersection$1(object2, material, raycaster, ray, _vA, _vB, _vC, _intersectionPoint);
|
|
4499
4499
|
if (intersection) {
|
|
4500
4500
|
const barycoord = new Vector3();
|
|
4501
4501
|
Triangle.getBarycoord(_intersectionPoint, _vA, _vB, _vC, barycoord);
|
|
@@ -4524,25 +4524,25 @@ var MineRender = (() => {
|
|
|
4524
4524
|
}
|
|
4525
4525
|
return intersection;
|
|
4526
4526
|
}
|
|
4527
|
-
function checkIntersection(
|
|
4528
|
-
const positionAttribute =
|
|
4527
|
+
function checkIntersection(object2, raycaster, ray, thresholdSq, a4, b4, i4) {
|
|
4528
|
+
const positionAttribute = object2.geometry.attributes.position;
|
|
4529
4529
|
_vStart.fromBufferAttribute(positionAttribute, a4);
|
|
4530
4530
|
_vEnd.fromBufferAttribute(positionAttribute, b4);
|
|
4531
4531
|
const distSq = ray.distanceSqToSegment(_vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment);
|
|
4532
4532
|
if (distSq > thresholdSq) return;
|
|
4533
|
-
_intersectPointOnRay.applyMatrix4(
|
|
4533
|
+
_intersectPointOnRay.applyMatrix4(object2.matrixWorld);
|
|
4534
4534
|
const distance = raycaster.ray.origin.distanceTo(_intersectPointOnRay);
|
|
4535
4535
|
if (distance < raycaster.near || distance > raycaster.far) return;
|
|
4536
4536
|
return {
|
|
4537
4537
|
distance,
|
|
4538
4538
|
// What do we want? intersection point on the ray or on the segment??
|
|
4539
4539
|
// point: raycaster.ray.at( distance ),
|
|
4540
|
-
point: _intersectPointOnSegment.clone().applyMatrix4(
|
|
4540
|
+
point: _intersectPointOnSegment.clone().applyMatrix4(object2.matrixWorld),
|
|
4541
4541
|
index: i4,
|
|
4542
4542
|
face: null,
|
|
4543
4543
|
faceIndex: null,
|
|
4544
4544
|
barycoord: null,
|
|
4545
|
-
object
|
|
4545
|
+
object: object2
|
|
4546
4546
|
};
|
|
4547
4547
|
}
|
|
4548
4548
|
function cloneUniforms(src) {
|
|
@@ -4642,22 +4642,22 @@ var MineRender = (() => {
|
|
|
4642
4642
|
function ascSort(a4, b4) {
|
|
4643
4643
|
return a4.distance - b4.distance;
|
|
4644
4644
|
}
|
|
4645
|
-
function intersect(
|
|
4645
|
+
function intersect(object2, raycaster, intersects, recursive) {
|
|
4646
4646
|
let propagate = true;
|
|
4647
|
-
if (
|
|
4648
|
-
const result =
|
|
4647
|
+
if (object2.layers.test(raycaster.layers)) {
|
|
4648
|
+
const result = object2.raycast(raycaster, intersects);
|
|
4649
4649
|
if (result === false) propagate = false;
|
|
4650
4650
|
}
|
|
4651
4651
|
if (propagate === true && recursive === true) {
|
|
4652
|
-
const children =
|
|
4652
|
+
const children = object2.children;
|
|
4653
4653
|
for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
|
|
4654
4654
|
intersect(children[i4], raycaster, intersects, true);
|
|
4655
4655
|
}
|
|
4656
4656
|
}
|
|
4657
4657
|
}
|
|
4658
|
-
function getByteLength(width, height,
|
|
4658
|
+
function getByteLength(width, height, format3, type) {
|
|
4659
4659
|
const typeByteLength = getTextureTypeByteLength(type);
|
|
4660
|
-
switch (
|
|
4660
|
+
switch (format3) {
|
|
4661
4661
|
// https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
|
|
4662
4662
|
case AlphaFormat:
|
|
4663
4663
|
return width * height;
|
|
@@ -4742,7 +4742,7 @@ var MineRender = (() => {
|
|
|
4742
4742
|
return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;
|
|
4743
4743
|
}
|
|
4744
4744
|
throw new Error(
|
|
4745
|
-
`Unable to determine texture byte length for ${
|
|
4745
|
+
`Unable to determine texture byte length for ${format3} format.`
|
|
4746
4746
|
);
|
|
4747
4747
|
}
|
|
4748
4748
|
function getTextureTypeByteLength(type) {
|
|
@@ -8076,7 +8076,7 @@ var MineRender = (() => {
|
|
|
8076
8076
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
8077
8077
|
* @param {string} [colorSpace=NoColorSpace] - The color space.
|
|
8078
8078
|
*/
|
|
8079
|
-
constructor(image = _Texture.DEFAULT_IMAGE, mapping = _Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter,
|
|
8079
|
+
constructor(image = _Texture.DEFAULT_IMAGE, mapping = _Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format3 = RGBAFormat, type = UnsignedByteType, anisotropy = _Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace) {
|
|
8080
8080
|
super();
|
|
8081
8081
|
this.isTexture = true;
|
|
8082
8082
|
Object.defineProperty(this, "id", { value: _textureId++ });
|
|
@@ -8091,7 +8091,7 @@ var MineRender = (() => {
|
|
|
8091
8091
|
this.magFilter = magFilter;
|
|
8092
8092
|
this.minFilter = minFilter;
|
|
8093
8093
|
this.anisotropy = anisotropy;
|
|
8094
|
-
this.format =
|
|
8094
|
+
this.format = format3;
|
|
8095
8095
|
this.internalFormat = null;
|
|
8096
8096
|
this.type = type;
|
|
8097
8097
|
this.offset = new Vector2(0, 0);
|
|
@@ -11302,27 +11302,27 @@ var MineRender = (() => {
|
|
|
11302
11302
|
* @param {Object3D} object - The 3D object to add.
|
|
11303
11303
|
* @return {Object3D} A reference to this instance.
|
|
11304
11304
|
*/
|
|
11305
|
-
add(
|
|
11305
|
+
add(object2) {
|
|
11306
11306
|
if (arguments.length > 1) {
|
|
11307
11307
|
for (let i4 = 0; i4 < arguments.length; i4++) {
|
|
11308
11308
|
this.add(arguments[i4]);
|
|
11309
11309
|
}
|
|
11310
11310
|
return this;
|
|
11311
11311
|
}
|
|
11312
|
-
if (
|
|
11313
|
-
error("Object3D.add: object can't be added as a child of itself.",
|
|
11312
|
+
if (object2 === this) {
|
|
11313
|
+
error("Object3D.add: object can't be added as a child of itself.", object2);
|
|
11314
11314
|
return this;
|
|
11315
11315
|
}
|
|
11316
|
-
if (
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
this.children.push(
|
|
11320
|
-
|
|
11321
|
-
_childaddedEvent.child =
|
|
11316
|
+
if (object2 && object2.isObject3D) {
|
|
11317
|
+
object2.removeFromParent();
|
|
11318
|
+
object2.parent = this;
|
|
11319
|
+
this.children.push(object2);
|
|
11320
|
+
object2.dispatchEvent(_addedEvent);
|
|
11321
|
+
_childaddedEvent.child = object2;
|
|
11322
11322
|
this.dispatchEvent(_childaddedEvent);
|
|
11323
11323
|
_childaddedEvent.child = null;
|
|
11324
11324
|
} else {
|
|
11325
|
-
error("Object3D.add: object not an instance of THREE.Object3D.",
|
|
11325
|
+
error("Object3D.add: object not an instance of THREE.Object3D.", object2);
|
|
11326
11326
|
}
|
|
11327
11327
|
return this;
|
|
11328
11328
|
}
|
|
@@ -11335,19 +11335,19 @@ var MineRender = (() => {
|
|
|
11335
11335
|
* @param {Object3D} object - The 3D object to remove.
|
|
11336
11336
|
* @return {Object3D} A reference to this instance.
|
|
11337
11337
|
*/
|
|
11338
|
-
remove(
|
|
11338
|
+
remove(object2) {
|
|
11339
11339
|
if (arguments.length > 1) {
|
|
11340
11340
|
for (let i4 = 0; i4 < arguments.length; i4++) {
|
|
11341
11341
|
this.remove(arguments[i4]);
|
|
11342
11342
|
}
|
|
11343
11343
|
return this;
|
|
11344
11344
|
}
|
|
11345
|
-
const index = this.children.indexOf(
|
|
11345
|
+
const index = this.children.indexOf(object2);
|
|
11346
11346
|
if (index !== -1) {
|
|
11347
|
-
|
|
11347
|
+
object2.parent = null;
|
|
11348
11348
|
this.children.splice(index, 1);
|
|
11349
|
-
|
|
11350
|
-
_childremovedEvent.child =
|
|
11349
|
+
object2.dispatchEvent(_removedEvent);
|
|
11350
|
+
_childremovedEvent.child = object2;
|
|
11351
11351
|
this.dispatchEvent(_childremovedEvent);
|
|
11352
11352
|
_childremovedEvent.child = null;
|
|
11353
11353
|
}
|
|
@@ -11386,20 +11386,20 @@ var MineRender = (() => {
|
|
|
11386
11386
|
* @param {Object3D} object - The 3D object to attach.
|
|
11387
11387
|
* @return {Object3D} A reference to this instance.
|
|
11388
11388
|
*/
|
|
11389
|
-
attach(
|
|
11389
|
+
attach(object2) {
|
|
11390
11390
|
this.updateWorldMatrix(true, false);
|
|
11391
11391
|
_m1$1.copy(this.matrixWorld).invert();
|
|
11392
|
-
if (
|
|
11393
|
-
|
|
11394
|
-
_m1$1.multiply(
|
|
11395
|
-
}
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
this.children.push(
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
_childaddedEvent.child =
|
|
11392
|
+
if (object2.parent !== null) {
|
|
11393
|
+
object2.parent.updateWorldMatrix(true, false);
|
|
11394
|
+
_m1$1.multiply(object2.parent.matrixWorld);
|
|
11395
|
+
}
|
|
11396
|
+
object2.applyMatrix4(_m1$1);
|
|
11397
|
+
object2.removeFromParent();
|
|
11398
|
+
object2.parent = this;
|
|
11399
|
+
this.children.push(object2);
|
|
11400
|
+
object2.updateWorldMatrix(false, true);
|
|
11401
|
+
object2.dispatchEvent(_addedEvent);
|
|
11402
|
+
_childaddedEvent.child = object2;
|
|
11403
11403
|
this.dispatchEvent(_childaddedEvent);
|
|
11404
11404
|
_childaddedEvent.child = null;
|
|
11405
11405
|
return this;
|
|
@@ -11436,9 +11436,9 @@ var MineRender = (() => {
|
|
|
11436
11436
|
if (this[name2] === value) return this;
|
|
11437
11437
|
for (let i4 = 0, l4 = this.children.length; i4 < l4; i4++) {
|
|
11438
11438
|
const child = this.children[i4];
|
|
11439
|
-
const
|
|
11440
|
-
if (
|
|
11441
|
-
return
|
|
11439
|
+
const object2 = child.getObjectByProperty(name2, value);
|
|
11440
|
+
if (object2 !== void 0) {
|
|
11441
|
+
return object2;
|
|
11442
11442
|
}
|
|
11443
11443
|
}
|
|
11444
11444
|
return void 0;
|
|
@@ -11676,61 +11676,61 @@ var MineRender = (() => {
|
|
|
11676
11676
|
generator: "Object3D.toJSON"
|
|
11677
11677
|
};
|
|
11678
11678
|
}
|
|
11679
|
-
const
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
if (Object.keys(this.userData).length > 0)
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
if (this.pivot !== null)
|
|
11695
|
-
if (this.morphTargetDictionary !== void 0)
|
|
11696
|
-
if (this.morphTargetInfluences !== void 0)
|
|
11679
|
+
const object2 = {};
|
|
11680
|
+
object2.uuid = this.uuid;
|
|
11681
|
+
object2.type = this.type;
|
|
11682
|
+
object2.name = this.name;
|
|
11683
|
+
object2.castShadow = this.castShadow;
|
|
11684
|
+
object2.receiveShadow = this.receiveShadow;
|
|
11685
|
+
object2.visible = this.visible;
|
|
11686
|
+
object2.frustumCulled = this.frustumCulled;
|
|
11687
|
+
object2.renderOrder = this.renderOrder;
|
|
11688
|
+
object2.static = this.static;
|
|
11689
|
+
object2.matrixAutoUpdate = this.matrixAutoUpdate;
|
|
11690
|
+
if (Object.keys(this.userData).length > 0) object2.userData = this.userData;
|
|
11691
|
+
object2.layers = this.layers.mask;
|
|
11692
|
+
object2.matrix = this.matrix.toArray();
|
|
11693
|
+
object2.up = this.up.toArray();
|
|
11694
|
+
if (this.pivot !== null) object2.pivot = this.pivot.toArray();
|
|
11695
|
+
if (this.morphTargetDictionary !== void 0) object2.morphTargetDictionary = Object.assign({}, this.morphTargetDictionary);
|
|
11696
|
+
if (this.morphTargetInfluences !== void 0) object2.morphTargetInfluences = this.morphTargetInfluences.slice();
|
|
11697
11697
|
if (this.isInstancedMesh) {
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
if (this.instanceColor !== null)
|
|
11698
|
+
object2.type = "InstancedMesh";
|
|
11699
|
+
object2.count = this.count;
|
|
11700
|
+
object2.instanceMatrix = this.instanceMatrix.toJSON();
|
|
11701
|
+
if (this.instanceColor !== null) object2.instanceColor = this.instanceColor.toJSON();
|
|
11702
11702
|
}
|
|
11703
11703
|
if (this.isBatchedMesh) {
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11704
|
+
object2.type = "BatchedMesh";
|
|
11705
|
+
object2.perObjectFrustumCulled = this.perObjectFrustumCulled;
|
|
11706
|
+
object2.sortObjects = this.sortObjects;
|
|
11707
|
+
object2.drawRanges = this._drawRanges;
|
|
11708
|
+
object2.reservedRanges = this._reservedRanges;
|
|
11709
|
+
object2.geometryInfo = this._geometryInfo.map((info) => ({
|
|
11710
11710
|
...info,
|
|
11711
11711
|
boundingBox: info.boundingBox ? info.boundingBox.toJSON() : void 0,
|
|
11712
11712
|
boundingSphere: info.boundingSphere ? info.boundingSphere.toJSON() : void 0
|
|
11713
11713
|
}));
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11714
|
+
object2.instanceInfo = this._instanceInfo.map((info) => ({ ...info }));
|
|
11715
|
+
object2.availableInstanceIds = this._availableInstanceIds.slice();
|
|
11716
|
+
object2.availableGeometryIds = this._availableGeometryIds.slice();
|
|
11717
|
+
object2.nextIndexStart = this._nextIndexStart;
|
|
11718
|
+
object2.nextVertexStart = this._nextVertexStart;
|
|
11719
|
+
object2.geometryCount = this._geometryCount;
|
|
11720
|
+
object2.maxInstanceCount = this._maxInstanceCount;
|
|
11721
|
+
object2.maxVertexCount = this._maxVertexCount;
|
|
11722
|
+
object2.maxIndexCount = this._maxIndexCount;
|
|
11723
|
+
object2.geometryInitialized = this._geometryInitialized;
|
|
11724
|
+
object2.matricesTexture = this._matricesTexture.toJSON(meta);
|
|
11725
|
+
object2.indirectTexture = this._indirectTexture.toJSON(meta);
|
|
11726
11726
|
if (this._colorsTexture !== null) {
|
|
11727
|
-
|
|
11727
|
+
object2.colorsTexture = this._colorsTexture.toJSON(meta);
|
|
11728
11728
|
}
|
|
11729
11729
|
if (this.boundingSphere !== null) {
|
|
11730
|
-
|
|
11730
|
+
object2.boundingSphere = this.boundingSphere.toJSON();
|
|
11731
11731
|
}
|
|
11732
11732
|
if (this.boundingBox !== null) {
|
|
11733
|
-
|
|
11733
|
+
object2.boundingBox = this.boundingBox.toJSON();
|
|
11734
11734
|
}
|
|
11735
11735
|
}
|
|
11736
11736
|
function serialize(library, element) {
|
|
@@ -11742,16 +11742,16 @@ var MineRender = (() => {
|
|
|
11742
11742
|
if (this.isScene) {
|
|
11743
11743
|
if (this.background) {
|
|
11744
11744
|
if (this.background.isColor) {
|
|
11745
|
-
|
|
11745
|
+
object2.background = this.background.toJSON();
|
|
11746
11746
|
} else if (this.background.isTexture) {
|
|
11747
|
-
|
|
11747
|
+
object2.background = this.background.toJSON(meta).uuid;
|
|
11748
11748
|
}
|
|
11749
11749
|
}
|
|
11750
11750
|
if (this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true) {
|
|
11751
|
-
|
|
11751
|
+
object2.environment = this.environment.toJSON(meta).uuid;
|
|
11752
11752
|
}
|
|
11753
11753
|
} else if (this.isMesh || this.isLine || this.isPoints) {
|
|
11754
|
-
|
|
11754
|
+
object2.geometry = serialize(meta.geometries, this.geometry);
|
|
11755
11755
|
const parameters = this.geometry.parameters;
|
|
11756
11756
|
if (parameters !== void 0 && parameters.shapes !== void 0) {
|
|
11757
11757
|
const shapes = parameters.shapes;
|
|
@@ -11766,11 +11766,11 @@ var MineRender = (() => {
|
|
|
11766
11766
|
}
|
|
11767
11767
|
}
|
|
11768
11768
|
if (this.isSkinnedMesh) {
|
|
11769
|
-
|
|
11770
|
-
|
|
11769
|
+
object2.bindMode = this.bindMode;
|
|
11770
|
+
object2.bindMatrix = this.bindMatrix.toArray();
|
|
11771
11771
|
if (this.skeleton !== void 0) {
|
|
11772
11772
|
serialize(meta.skeletons, this.skeleton);
|
|
11773
|
-
|
|
11773
|
+
object2.skeleton = this.skeleton.uuid;
|
|
11774
11774
|
}
|
|
11775
11775
|
}
|
|
11776
11776
|
if (this.material !== void 0) {
|
|
@@ -11779,22 +11779,22 @@ var MineRender = (() => {
|
|
|
11779
11779
|
for (let i4 = 0, l4 = this.material.length; i4 < l4; i4++) {
|
|
11780
11780
|
uuids.push(serialize(meta.materials, this.material[i4]));
|
|
11781
11781
|
}
|
|
11782
|
-
|
|
11782
|
+
object2.material = uuids;
|
|
11783
11783
|
} else {
|
|
11784
|
-
|
|
11784
|
+
object2.material = serialize(meta.materials, this.material);
|
|
11785
11785
|
}
|
|
11786
11786
|
}
|
|
11787
11787
|
if (this.children.length > 0) {
|
|
11788
|
-
|
|
11788
|
+
object2.children = [];
|
|
11789
11789
|
for (let i4 = 0; i4 < this.children.length; i4++) {
|
|
11790
|
-
|
|
11790
|
+
object2.children.push(this.children[i4].toJSON(meta).object);
|
|
11791
11791
|
}
|
|
11792
11792
|
}
|
|
11793
11793
|
if (this.animations.length > 0) {
|
|
11794
|
-
|
|
11794
|
+
object2.animations = [];
|
|
11795
11795
|
for (let i4 = 0; i4 < this.animations.length; i4++) {
|
|
11796
11796
|
const animation = this.animations[i4];
|
|
11797
|
-
|
|
11797
|
+
object2.animations.push(serialize(meta.animations, animation));
|
|
11798
11798
|
}
|
|
11799
11799
|
}
|
|
11800
11800
|
if (isRootObject) {
|
|
@@ -11815,7 +11815,7 @@ var MineRender = (() => {
|
|
|
11815
11815
|
if (animations.length > 0) output.animations = animations;
|
|
11816
11816
|
if (nodes.length > 0) output.nodes = nodes;
|
|
11817
11817
|
}
|
|
11818
|
-
output.object =
|
|
11818
|
+
output.object = object2;
|
|
11819
11819
|
return output;
|
|
11820
11820
|
function extractFromCache(cache) {
|
|
11821
11821
|
const values = [];
|
|
@@ -13407,9 +13407,9 @@ var MineRender = (() => {
|
|
|
13407
13407
|
* world-axis-aligned bounding box at the expense of more computation.
|
|
13408
13408
|
* @return {Box3} A reference to this bounding box.
|
|
13409
13409
|
*/
|
|
13410
|
-
setFromObject(
|
|
13410
|
+
setFromObject(object2, precise = false) {
|
|
13411
13411
|
this.makeEmpty();
|
|
13412
|
-
return this.expandByObject(
|
|
13412
|
+
return this.expandByObject(object2, precise);
|
|
13413
13413
|
}
|
|
13414
13414
|
/**
|
|
13415
13415
|
* Returns a new box with copied values from this instance.
|
|
@@ -13517,38 +13517,38 @@ var MineRender = (() => {
|
|
|
13517
13517
|
* as little as necessary at the expense of more computation.
|
|
13518
13518
|
* @return {Box3} A reference to this bounding box.
|
|
13519
13519
|
*/
|
|
13520
|
-
expandByObject(
|
|
13521
|
-
|
|
13522
|
-
const geometry =
|
|
13520
|
+
expandByObject(object2, precise = false) {
|
|
13521
|
+
object2.updateWorldMatrix(false, false);
|
|
13522
|
+
const geometry = object2.geometry;
|
|
13523
13523
|
if (geometry !== void 0) {
|
|
13524
13524
|
const positionAttribute = geometry.getAttribute("position");
|
|
13525
|
-
if (precise === true && positionAttribute !== void 0 &&
|
|
13525
|
+
if (precise === true && positionAttribute !== void 0 && object2.isInstancedMesh !== true) {
|
|
13526
13526
|
for (let i4 = 0, l4 = positionAttribute.count; i4 < l4; i4++) {
|
|
13527
|
-
if (
|
|
13528
|
-
|
|
13527
|
+
if (object2.isMesh === true) {
|
|
13528
|
+
object2.getVertexPosition(i4, _vector$b);
|
|
13529
13529
|
} else {
|
|
13530
13530
|
_vector$b.fromBufferAttribute(positionAttribute, i4);
|
|
13531
13531
|
}
|
|
13532
|
-
_vector$b.applyMatrix4(
|
|
13532
|
+
_vector$b.applyMatrix4(object2.matrixWorld);
|
|
13533
13533
|
this.expandByPoint(_vector$b);
|
|
13534
13534
|
}
|
|
13535
13535
|
} else {
|
|
13536
|
-
if (
|
|
13537
|
-
if (
|
|
13538
|
-
|
|
13536
|
+
if (object2.boundingBox !== void 0) {
|
|
13537
|
+
if (object2.boundingBox === null) {
|
|
13538
|
+
object2.computeBoundingBox();
|
|
13539
13539
|
}
|
|
13540
|
-
_box$4.copy(
|
|
13540
|
+
_box$4.copy(object2.boundingBox);
|
|
13541
13541
|
} else {
|
|
13542
13542
|
if (geometry.boundingBox === null) {
|
|
13543
13543
|
geometry.computeBoundingBox();
|
|
13544
13544
|
}
|
|
13545
13545
|
_box$4.copy(geometry.boundingBox);
|
|
13546
13546
|
}
|
|
13547
|
-
_box$4.applyMatrix4(
|
|
13547
|
+
_box$4.applyMatrix4(object2.matrixWorld);
|
|
13548
13548
|
this.union(_box$4);
|
|
13549
13549
|
}
|
|
13550
13550
|
}
|
|
13551
|
-
const children =
|
|
13551
|
+
const children = object2.children;
|
|
13552
13552
|
for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
|
|
13553
13553
|
this.expandByObject(children[i4], precise);
|
|
13554
13554
|
}
|
|
@@ -17419,8 +17419,8 @@ var MineRender = (() => {
|
|
|
17419
17419
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
17420
17420
|
* @param {string} [colorSpace=NoColorSpace] - The color space.
|
|
17421
17421
|
*/
|
|
17422
|
-
constructor(data = null, width = 1, height = 1,
|
|
17423
|
-
super(null, mapping, wrapS, wrapT, magFilter, minFilter,
|
|
17422
|
+
constructor(data = null, width = 1, height = 1, format3, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace) {
|
|
17423
|
+
super(null, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace);
|
|
17424
17424
|
this.isDataTexture = true;
|
|
17425
17425
|
this.image = { data, width, height };
|
|
17426
17426
|
this.generateMipmaps = false;
|
|
@@ -17564,8 +17564,8 @@ var MineRender = (() => {
|
|
|
17564
17564
|
* @param {number} index - The instance index.
|
|
17565
17565
|
* @param {Mesh} object - The target object that is used to store the method's result.
|
|
17566
17566
|
*/
|
|
17567
|
-
getMorphAt(index,
|
|
17568
|
-
const objectInfluences =
|
|
17567
|
+
getMorphAt(index, object2) {
|
|
17568
|
+
const objectInfluences = object2.morphTargetInfluences;
|
|
17569
17569
|
const array = this.morphTexture.source.data.data;
|
|
17570
17570
|
const len = objectInfluences.length + 1;
|
|
17571
17571
|
const dataIndex = index * len + 1;
|
|
@@ -17633,8 +17633,8 @@ var MineRender = (() => {
|
|
|
17633
17633
|
* of a single instance.
|
|
17634
17634
|
* @return {InstancedMesh} A reference to this instanced mesh.
|
|
17635
17635
|
*/
|
|
17636
|
-
setMorphAt(index,
|
|
17637
|
-
const objectInfluences =
|
|
17636
|
+
setMorphAt(index, object2) {
|
|
17637
|
+
const objectInfluences = object2.morphTargetInfluences;
|
|
17638
17638
|
const len = objectInfluences.length + 1;
|
|
17639
17639
|
if (this.morphTexture === null) {
|
|
17640
17640
|
this.morphTexture = new DataTexture(new Float32Array(len * this.count), len, this.count, RedFormat, FloatType);
|
|
@@ -17757,14 +17757,14 @@ var MineRender = (() => {
|
|
|
17757
17757
|
* @param {Object3D} object - The 3D object to test.
|
|
17758
17758
|
* @return {boolean} Whether the 3D object's bounding sphere is intersecting this frustum or not.
|
|
17759
17759
|
*/
|
|
17760
|
-
intersectsObject(
|
|
17761
|
-
if (
|
|
17762
|
-
if (
|
|
17763
|
-
_sphere$3.copy(
|
|
17760
|
+
intersectsObject(object2) {
|
|
17761
|
+
if (object2.boundingSphere !== void 0) {
|
|
17762
|
+
if (object2.boundingSphere === null) object2.computeBoundingSphere();
|
|
17763
|
+
_sphere$3.copy(object2.boundingSphere).applyMatrix4(object2.matrixWorld);
|
|
17764
17764
|
} else {
|
|
17765
|
-
const geometry =
|
|
17765
|
+
const geometry = object2.geometry;
|
|
17766
17766
|
if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
|
|
17767
|
-
_sphere$3.copy(geometry.boundingSphere).applyMatrix4(
|
|
17767
|
+
_sphere$3.copy(geometry.boundingSphere).applyMatrix4(object2.matrixWorld);
|
|
17768
17768
|
}
|
|
17769
17769
|
return this.intersectsSphere(_sphere$3);
|
|
17770
17770
|
}
|
|
@@ -18079,8 +18079,8 @@ var MineRender = (() => {
|
|
|
18079
18079
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
18080
18080
|
* @param {string} [colorSpace=NoColorSpace] - The color space.
|
|
18081
18081
|
*/
|
|
18082
|
-
constructor(mipmaps, width, height,
|
|
18083
|
-
super(null, mapping, wrapS, wrapT, magFilter, minFilter,
|
|
18082
|
+
constructor(mipmaps, width, height, format3, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace) {
|
|
18083
|
+
super(null, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace);
|
|
18084
18084
|
this.isCompressedTexture = true;
|
|
18085
18085
|
this.image = { width, height };
|
|
18086
18086
|
this.mipmaps = mipmaps;
|
|
@@ -18103,8 +18103,8 @@ var MineRender = (() => {
|
|
|
18103
18103
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
18104
18104
|
* @param {string} [colorSpace=NoColorSpace] - The color space value.
|
|
18105
18105
|
*/
|
|
18106
|
-
constructor(images = [], mapping = CubeReflectionMapping, wrapS, wrapT, magFilter, minFilter,
|
|
18107
|
-
super(images, mapping, wrapS, wrapT, magFilter, minFilter,
|
|
18106
|
+
constructor(images = [], mapping = CubeReflectionMapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace) {
|
|
18107
|
+
super(images, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, colorSpace);
|
|
18108
18108
|
this.isCubeTexture = true;
|
|
18109
18109
|
this.flipY = false;
|
|
18110
18110
|
}
|
|
@@ -18134,8 +18134,8 @@ var MineRender = (() => {
|
|
|
18134
18134
|
* @param {number} [type=UnsignedByteType] - The texture type.
|
|
18135
18135
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
18136
18136
|
*/
|
|
18137
|
-
constructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter,
|
|
18138
|
-
super(canvas, mapping, wrapS, wrapT, magFilter, minFilter,
|
|
18137
|
+
constructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy) {
|
|
18138
|
+
super(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy);
|
|
18139
18139
|
this.isCanvasTexture = true;
|
|
18140
18140
|
this.needsUpdate = true;
|
|
18141
18141
|
}
|
|
@@ -18156,12 +18156,12 @@ var MineRender = (() => {
|
|
|
18156
18156
|
* @param {number} [format=DepthFormat] - The texture format.
|
|
18157
18157
|
* @param {number} [depth=1] - The depth of the texture.
|
|
18158
18158
|
*/
|
|
18159
|
-
constructor(width, height, type = UnsignedIntType, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy,
|
|
18160
|
-
if (
|
|
18159
|
+
constructor(width, height, type = UnsignedIntType, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format3 = DepthFormat, depth = 1) {
|
|
18160
|
+
if (format3 !== DepthFormat && format3 !== DepthStencilFormat) {
|
|
18161
18161
|
throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
|
|
18162
18162
|
}
|
|
18163
18163
|
const image = { width, height, depth };
|
|
18164
|
-
super(image, mapping, wrapS, wrapT, magFilter, minFilter,
|
|
18164
|
+
super(image, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy);
|
|
18165
18165
|
this.isDepthTexture = true;
|
|
18166
18166
|
this.flipY = false;
|
|
18167
18167
|
this.generateMipmaps = false;
|
|
@@ -18193,10 +18193,10 @@ var MineRender = (() => {
|
|
|
18193
18193
|
* @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
|
|
18194
18194
|
* @param {number} [format=DepthFormat] - The texture format.
|
|
18195
18195
|
*/
|
|
18196
|
-
constructor(size, type = UnsignedIntType, mapping = CubeReflectionMapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy,
|
|
18196
|
+
constructor(size, type = UnsignedIntType, mapping = CubeReflectionMapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format3 = DepthFormat) {
|
|
18197
18197
|
const image = { width: size, height: size, depth: 1 };
|
|
18198
18198
|
const images = [image, image, image, image, image, image];
|
|
18199
|
-
super(size, size, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy,
|
|
18199
|
+
super(size, size, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format3);
|
|
18200
18200
|
this.image = images;
|
|
18201
18201
|
this.isCubeDepthTexture = true;
|
|
18202
18202
|
this.isCubeTexture = true;
|
|
@@ -20926,8 +20926,8 @@ var MineRender = (() => {
|
|
|
20926
20926
|
* @param {Array<Raycaster~Intersection>} [intersects=[]] The target array that holds the result of the method.
|
|
20927
20927
|
* @return {Array<Raycaster~Intersection>} An array holding the intersection points.
|
|
20928
20928
|
*/
|
|
20929
|
-
intersectObject(
|
|
20930
|
-
intersect(
|
|
20929
|
+
intersectObject(object2, recursive = true, intersects = []) {
|
|
20930
|
+
intersect(object2, this, intersects, recursive);
|
|
20931
20931
|
intersects.sort(ascSort);
|
|
20932
20932
|
return intersects;
|
|
20933
20933
|
}
|
|
@@ -21836,21 +21836,21 @@ var MineRender = (() => {
|
|
|
21836
21836
|
const defaultState = createBindingState(null);
|
|
21837
21837
|
let currentState = defaultState;
|
|
21838
21838
|
let forceUpdate = false;
|
|
21839
|
-
function setup(
|
|
21839
|
+
function setup(object2, material, program, geometry, index) {
|
|
21840
21840
|
let updateBuffers = false;
|
|
21841
|
-
const state = getBindingState(
|
|
21841
|
+
const state = getBindingState(object2, geometry, program, material);
|
|
21842
21842
|
if (currentState !== state) {
|
|
21843
21843
|
currentState = state;
|
|
21844
21844
|
bindVertexArrayObject(currentState.object);
|
|
21845
21845
|
}
|
|
21846
|
-
updateBuffers = needsUpdate(
|
|
21847
|
-
if (updateBuffers) saveCache(
|
|
21846
|
+
updateBuffers = needsUpdate(object2, geometry, program, index);
|
|
21847
|
+
if (updateBuffers) saveCache(object2, geometry, program, index);
|
|
21848
21848
|
if (index !== null) {
|
|
21849
21849
|
attributes.update(index, gl.ELEMENT_ARRAY_BUFFER);
|
|
21850
21850
|
}
|
|
21851
21851
|
if (updateBuffers || forceUpdate) {
|
|
21852
21852
|
forceUpdate = false;
|
|
21853
|
-
setupVertexAttributes(
|
|
21853
|
+
setupVertexAttributes(object2, material, program, geometry);
|
|
21854
21854
|
if (index !== null) {
|
|
21855
21855
|
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index).buffer);
|
|
21856
21856
|
}
|
|
@@ -21865,14 +21865,14 @@ var MineRender = (() => {
|
|
|
21865
21865
|
function deleteVertexArrayObject(vao) {
|
|
21866
21866
|
return gl.deleteVertexArray(vao);
|
|
21867
21867
|
}
|
|
21868
|
-
function getBindingState(
|
|
21868
|
+
function getBindingState(object2, geometry, program, material) {
|
|
21869
21869
|
const wireframe = material.wireframe === true;
|
|
21870
21870
|
let objectMap = bindingStates[geometry.id];
|
|
21871
21871
|
if (objectMap === void 0) {
|
|
21872
21872
|
objectMap = {};
|
|
21873
21873
|
bindingStates[geometry.id] = objectMap;
|
|
21874
21874
|
}
|
|
21875
|
-
const objectId =
|
|
21875
|
+
const objectId = object2.isInstancedMesh === true ? object2.id : 0;
|
|
21876
21876
|
let programMap = objectMap[objectId];
|
|
21877
21877
|
if (programMap === void 0) {
|
|
21878
21878
|
programMap = {};
|
|
@@ -21912,7 +21912,7 @@ var MineRender = (() => {
|
|
|
21912
21912
|
index: null
|
|
21913
21913
|
};
|
|
21914
21914
|
}
|
|
21915
|
-
function needsUpdate(
|
|
21915
|
+
function needsUpdate(object2, geometry, program, index) {
|
|
21916
21916
|
const cachedAttributes = currentState.attributes;
|
|
21917
21917
|
const geometryAttributes = geometry.attributes;
|
|
21918
21918
|
let attributesNum = 0;
|
|
@@ -21923,8 +21923,8 @@ var MineRender = (() => {
|
|
|
21923
21923
|
const cachedAttribute = cachedAttributes[name2];
|
|
21924
21924
|
let geometryAttribute = geometryAttributes[name2];
|
|
21925
21925
|
if (geometryAttribute === void 0) {
|
|
21926
|
-
if (name2 === "instanceMatrix" &&
|
|
21927
|
-
if (name2 === "instanceColor" &&
|
|
21926
|
+
if (name2 === "instanceMatrix" && object2.instanceMatrix) geometryAttribute = object2.instanceMatrix;
|
|
21927
|
+
if (name2 === "instanceColor" && object2.instanceColor) geometryAttribute = object2.instanceColor;
|
|
21928
21928
|
}
|
|
21929
21929
|
if (cachedAttribute === void 0) return true;
|
|
21930
21930
|
if (cachedAttribute.attribute !== geometryAttribute) return true;
|
|
@@ -21936,7 +21936,7 @@ var MineRender = (() => {
|
|
|
21936
21936
|
if (currentState.index !== index) return true;
|
|
21937
21937
|
return false;
|
|
21938
21938
|
}
|
|
21939
|
-
function saveCache(
|
|
21939
|
+
function saveCache(object2, geometry, program, index) {
|
|
21940
21940
|
const cache = {};
|
|
21941
21941
|
const attributes2 = geometry.attributes;
|
|
21942
21942
|
let attributesNum = 0;
|
|
@@ -21946,8 +21946,8 @@ var MineRender = (() => {
|
|
|
21946
21946
|
if (programAttribute.location >= 0) {
|
|
21947
21947
|
let attribute = attributes2[name2];
|
|
21948
21948
|
if (attribute === void 0) {
|
|
21949
|
-
if (name2 === "instanceMatrix" &&
|
|
21950
|
-
if (name2 === "instanceColor" &&
|
|
21949
|
+
if (name2 === "instanceMatrix" && object2.instanceMatrix) attribute = object2.instanceMatrix;
|
|
21950
|
+
if (name2 === "instanceColor" && object2.instanceColor) attribute = object2.instanceColor;
|
|
21951
21951
|
}
|
|
21952
21952
|
const data = {};
|
|
21953
21953
|
data.attribute = attribute;
|
|
@@ -21995,14 +21995,14 @@ var MineRender = (() => {
|
|
|
21995
21995
|
}
|
|
21996
21996
|
}
|
|
21997
21997
|
}
|
|
21998
|
-
function vertexAttribPointer(index, size, type, normalized, stride, offset,
|
|
21999
|
-
if (
|
|
21998
|
+
function vertexAttribPointer(index, size, type, normalized, stride, offset, integer2) {
|
|
21999
|
+
if (integer2 === true) {
|
|
22000
22000
|
gl.vertexAttribIPointer(index, size, type, stride, offset);
|
|
22001
22001
|
} else {
|
|
22002
22002
|
gl.vertexAttribPointer(index, size, type, normalized, stride, offset);
|
|
22003
22003
|
}
|
|
22004
22004
|
}
|
|
22005
|
-
function setupVertexAttributes(
|
|
22005
|
+
function setupVertexAttributes(object2, material, program, geometry) {
|
|
22006
22006
|
initAttributes();
|
|
22007
22007
|
const geometryAttributes = geometry.attributes;
|
|
22008
22008
|
const programAttributes = program.getAttributes();
|
|
@@ -22012,8 +22012,8 @@ var MineRender = (() => {
|
|
|
22012
22012
|
if (programAttribute.location >= 0) {
|
|
22013
22013
|
let geometryAttribute = geometryAttributes[name2];
|
|
22014
22014
|
if (geometryAttribute === void 0) {
|
|
22015
|
-
if (name2 === "instanceMatrix" &&
|
|
22016
|
-
if (name2 === "instanceColor" &&
|
|
22015
|
+
if (name2 === "instanceMatrix" && object2.instanceMatrix) geometryAttribute = object2.instanceMatrix;
|
|
22016
|
+
if (name2 === "instanceColor" && object2.instanceColor) geometryAttribute = object2.instanceColor;
|
|
22017
22017
|
}
|
|
22018
22018
|
if (geometryAttribute !== void 0) {
|
|
22019
22019
|
const normalized = geometryAttribute.normalized;
|
|
@@ -22023,7 +22023,7 @@ var MineRender = (() => {
|
|
|
22023
22023
|
const buffer2 = attribute.buffer;
|
|
22024
22024
|
const type = attribute.type;
|
|
22025
22025
|
const bytesPerElement = attribute.bytesPerElement;
|
|
22026
|
-
const
|
|
22026
|
+
const integer2 = type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType;
|
|
22027
22027
|
if (geometryAttribute.isInterleavedBufferAttribute) {
|
|
22028
22028
|
const data = geometryAttribute.data;
|
|
22029
22029
|
const stride = data.stride;
|
|
@@ -22032,7 +22032,7 @@ var MineRender = (() => {
|
|
|
22032
22032
|
for (let i4 = 0; i4 < programAttribute.locationSize; i4++) {
|
|
22033
22033
|
enableAttributeAndDivisor(programAttribute.location + i4, data.meshPerAttribute);
|
|
22034
22034
|
}
|
|
22035
|
-
if (
|
|
22035
|
+
if (object2.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
|
|
22036
22036
|
geometry._maxInstanceCount = data.meshPerAttribute * data.count;
|
|
22037
22037
|
}
|
|
22038
22038
|
} else {
|
|
@@ -22049,7 +22049,7 @@ var MineRender = (() => {
|
|
|
22049
22049
|
normalized,
|
|
22050
22050
|
stride * bytesPerElement,
|
|
22051
22051
|
(offset + size / programAttribute.locationSize * i4) * bytesPerElement,
|
|
22052
|
-
|
|
22052
|
+
integer2
|
|
22053
22053
|
);
|
|
22054
22054
|
}
|
|
22055
22055
|
} else {
|
|
@@ -22057,7 +22057,7 @@ var MineRender = (() => {
|
|
|
22057
22057
|
for (let i4 = 0; i4 < programAttribute.locationSize; i4++) {
|
|
22058
22058
|
enableAttributeAndDivisor(programAttribute.location + i4, geometryAttribute.meshPerAttribute);
|
|
22059
22059
|
}
|
|
22060
|
-
if (
|
|
22060
|
+
if (object2.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
|
|
22061
22061
|
geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;
|
|
22062
22062
|
}
|
|
22063
22063
|
} else {
|
|
@@ -22074,7 +22074,7 @@ var MineRender = (() => {
|
|
|
22074
22074
|
normalized,
|
|
22075
22075
|
size * bytesPerElement,
|
|
22076
22076
|
size / programAttribute.locationSize * i4 * bytesPerElement,
|
|
22077
|
-
|
|
22077
|
+
integer2
|
|
22078
22078
|
);
|
|
22079
22079
|
}
|
|
22080
22080
|
}
|
|
@@ -22149,10 +22149,10 @@ var MineRender = (() => {
|
|
|
22149
22149
|
}
|
|
22150
22150
|
}
|
|
22151
22151
|
}
|
|
22152
|
-
function releaseStatesOfObject(
|
|
22152
|
+
function releaseStatesOfObject(object2) {
|
|
22153
22153
|
for (const geometryId in bindingStates) {
|
|
22154
22154
|
const objectMap = bindingStates[geometryId];
|
|
22155
|
-
const objectId =
|
|
22155
|
+
const objectId = object2.isInstancedMesh === true ? object2.id : 0;
|
|
22156
22156
|
const programMap = objectMap[objectId];
|
|
22157
22157
|
if (programMap === void 0) continue;
|
|
22158
22158
|
for (const programId in programMap) {
|
|
@@ -22940,7 +22940,7 @@ var MineRender = (() => {
|
|
|
22940
22940
|
}
|
|
22941
22941
|
info.memory.geometries--;
|
|
22942
22942
|
}
|
|
22943
|
-
function get(
|
|
22943
|
+
function get(object2, geometry) {
|
|
22944
22944
|
if (geometries[geometry.id] === true) return geometry;
|
|
22945
22945
|
geometry.addEventListener("dispose", onGeometryDispose);
|
|
22946
22946
|
geometries[geometry.id] = true;
|
|
@@ -23094,8 +23094,8 @@ var MineRender = (() => {
|
|
|
23094
23094
|
function WebGLMorphtargets(gl, capabilities, textures) {
|
|
23095
23095
|
const morphTextures = /* @__PURE__ */ new WeakMap();
|
|
23096
23096
|
const morph = new Vector4();
|
|
23097
|
-
function update(
|
|
23098
|
-
const objectInfluences =
|
|
23097
|
+
function update(object2, geometry, program) {
|
|
23098
|
+
const objectInfluences = object2.morphTargetInfluences;
|
|
23099
23099
|
const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
|
|
23100
23100
|
const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0;
|
|
23101
23101
|
let entry = morphTextures.get(geometry);
|
|
@@ -23165,8 +23165,8 @@ var MineRender = (() => {
|
|
|
23165
23165
|
morphTextures.set(geometry, entry);
|
|
23166
23166
|
geometry.addEventListener("dispose", disposeTexture);
|
|
23167
23167
|
}
|
|
23168
|
-
if (
|
|
23169
|
-
program.getUniforms().setValue(gl, "morphTexture",
|
|
23168
|
+
if (object2.isInstancedMesh === true && object2.morphTexture !== null) {
|
|
23169
|
+
program.getUniforms().setValue(gl, "morphTexture", object2.morphTexture, textures);
|
|
23170
23170
|
} else {
|
|
23171
23171
|
let morphInfluencesSum = 0;
|
|
23172
23172
|
for (let i4 = 0; i4 < objectInfluences.length; i4++) {
|
|
@@ -23185,28 +23185,28 @@ var MineRender = (() => {
|
|
|
23185
23185
|
}
|
|
23186
23186
|
function WebGLObjects(gl, geometries, attributes, bindingStates, info) {
|
|
23187
23187
|
let updateMap = /* @__PURE__ */ new WeakMap();
|
|
23188
|
-
function update(
|
|
23188
|
+
function update(object2) {
|
|
23189
23189
|
const frame = info.render.frame;
|
|
23190
|
-
const geometry =
|
|
23191
|
-
const buffergeometry = geometries.get(
|
|
23190
|
+
const geometry = object2.geometry;
|
|
23191
|
+
const buffergeometry = geometries.get(object2, geometry);
|
|
23192
23192
|
if (updateMap.get(buffergeometry) !== frame) {
|
|
23193
23193
|
geometries.update(buffergeometry);
|
|
23194
23194
|
updateMap.set(buffergeometry, frame);
|
|
23195
23195
|
}
|
|
23196
|
-
if (
|
|
23197
|
-
if (
|
|
23198
|
-
|
|
23196
|
+
if (object2.isInstancedMesh) {
|
|
23197
|
+
if (object2.hasEventListener("dispose", onInstancedMeshDispose) === false) {
|
|
23198
|
+
object2.addEventListener("dispose", onInstancedMeshDispose);
|
|
23199
23199
|
}
|
|
23200
|
-
if (updateMap.get(
|
|
23201
|
-
attributes.update(
|
|
23202
|
-
if (
|
|
23203
|
-
attributes.update(
|
|
23200
|
+
if (updateMap.get(object2) !== frame) {
|
|
23201
|
+
attributes.update(object2.instanceMatrix, gl.ARRAY_BUFFER);
|
|
23202
|
+
if (object2.instanceColor !== null) {
|
|
23203
|
+
attributes.update(object2.instanceColor, gl.ARRAY_BUFFER);
|
|
23204
23204
|
}
|
|
23205
|
-
updateMap.set(
|
|
23205
|
+
updateMap.set(object2, frame);
|
|
23206
23206
|
}
|
|
23207
23207
|
}
|
|
23208
|
-
if (
|
|
23209
|
-
const skeleton =
|
|
23208
|
+
if (object2.isSkinnedMesh) {
|
|
23209
|
+
const skeleton = object2.skeleton;
|
|
23210
23210
|
if (updateMap.get(skeleton) !== frame) {
|
|
23211
23211
|
skeleton.update();
|
|
23212
23212
|
updateMap.set(skeleton, frame);
|
|
@@ -24557,8 +24557,8 @@ var MineRender = (() => {
|
|
|
24557
24557
|
this.fragmentShader = glFragmentShader;
|
|
24558
24558
|
return this;
|
|
24559
24559
|
}
|
|
24560
|
-
function isPackedRGFormat(
|
|
24561
|
-
return
|
|
24560
|
+
function isPackedRGFormat(format3) {
|
|
24561
|
+
return format3 === RGFormat || format3 === RG11_EAC_Format || format3 === RED_GREEN_RGTC2_Format;
|
|
24562
24562
|
}
|
|
24563
24563
|
function WebGLPrograms(renderer, environments, extensions, capabilities, bindingStates, clipping) {
|
|
24564
24564
|
const _programLayers = new Layers();
|
|
@@ -24590,9 +24590,9 @@ var MineRender = (() => {
|
|
|
24590
24590
|
if (value === 0) return "uv";
|
|
24591
24591
|
return `uv${value}`;
|
|
24592
24592
|
}
|
|
24593
|
-
function getParameters(material, lights, shadows, scene,
|
|
24593
|
+
function getParameters(material, lights, shadows, scene, object2, lightProbeGrids) {
|
|
24594
24594
|
const fog = scene.fog;
|
|
24595
|
-
const geometry =
|
|
24595
|
+
const geometry = object2.geometry;
|
|
24596
24596
|
const environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
|
|
24597
24597
|
const usePMREM = material.isMeshStandardMaterial || material.isMeshLambertMaterial && !material.envMap || material.isMeshPhongMaterial && !material.envMap;
|
|
24598
24598
|
const envMap = environments.get(material.envMap || environment, usePMREM);
|
|
@@ -24627,8 +24627,8 @@ var MineRender = (() => {
|
|
|
24627
24627
|
}
|
|
24628
24628
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
24629
24629
|
const reversedDepthBuffer = renderer.state.buffers.depth.getReversed();
|
|
24630
|
-
const IS_INSTANCEDMESH =
|
|
24631
|
-
const IS_BATCHEDMESH =
|
|
24630
|
+
const IS_INSTANCEDMESH = object2.isInstancedMesh === true;
|
|
24631
|
+
const IS_BATCHEDMESH = object2.isBatchedMesh === true;
|
|
24632
24632
|
const HAS_MAP = !!material.map;
|
|
24633
24633
|
const HAS_MATCAP = !!material.matcap;
|
|
24634
24634
|
const HAS_ENVMAP = !!envMap;
|
|
@@ -24684,10 +24684,10 @@ var MineRender = (() => {
|
|
|
24684
24684
|
glslVersion: material.glslVersion,
|
|
24685
24685
|
precision,
|
|
24686
24686
|
batching: IS_BATCHEDMESH,
|
|
24687
|
-
batchingColor: IS_BATCHEDMESH &&
|
|
24687
|
+
batchingColor: IS_BATCHEDMESH && object2._colorsTexture !== null,
|
|
24688
24688
|
instancing: IS_INSTANCEDMESH,
|
|
24689
|
-
instancingColor: IS_INSTANCEDMESH &&
|
|
24690
|
-
instancingMorph: IS_INSTANCEDMESH &&
|
|
24689
|
+
instancingColor: IS_INSTANCEDMESH && object2.instanceColor !== null,
|
|
24690
|
+
instancingMorph: IS_INSTANCEDMESH && object2.morphTexture !== null,
|
|
24691
24691
|
outputColorSpace: currentRenderTarget === null ? renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : ColorManagement.workingColorSpace,
|
|
24692
24692
|
alphaToCoverage: !!material.alphaToCoverage,
|
|
24693
24693
|
map: HAS_MAP,
|
|
@@ -24761,7 +24761,7 @@ var MineRender = (() => {
|
|
|
24761
24761
|
vertexNormals: !!geometry.attributes.normal,
|
|
24762
24762
|
vertexColors: material.vertexColors,
|
|
24763
24763
|
vertexAlphas: material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4,
|
|
24764
|
-
pointsUvs:
|
|
24764
|
+
pointsUvs: object2.isPoints === true && !!geometry.attributes.uv && (HAS_MAP || HAS_ALPHAMAP),
|
|
24765
24765
|
fog: !!fog,
|
|
24766
24766
|
useFog: material.fog === true,
|
|
24767
24767
|
fogExp2: !!fog && fog.isFogExp2,
|
|
@@ -24769,7 +24769,7 @@ var MineRender = (() => {
|
|
|
24769
24769
|
sizeAttenuation: material.sizeAttenuation === true,
|
|
24770
24770
|
logarithmicDepthBuffer,
|
|
24771
24771
|
reversedDepthBuffer,
|
|
24772
|
-
skinning:
|
|
24772
|
+
skinning: object2.isSkinnedMesh === true,
|
|
24773
24773
|
hasPositionAttribute: geometry.attributes.position !== void 0,
|
|
24774
24774
|
morphTargets: geometry.morphAttributes.position !== void 0,
|
|
24775
24775
|
morphNormals: geometry.morphAttributes.normal !== void 0,
|
|
@@ -25044,22 +25044,22 @@ var MineRender = (() => {
|
|
|
25044
25044
|
}
|
|
25045
25045
|
function WebGLProperties() {
|
|
25046
25046
|
let properties = /* @__PURE__ */ new WeakMap();
|
|
25047
|
-
function has(
|
|
25048
|
-
return properties.has(
|
|
25047
|
+
function has(object2) {
|
|
25048
|
+
return properties.has(object2);
|
|
25049
25049
|
}
|
|
25050
|
-
function get(
|
|
25051
|
-
let map = properties.get(
|
|
25050
|
+
function get(object2) {
|
|
25051
|
+
let map = properties.get(object2);
|
|
25052
25052
|
if (map === void 0) {
|
|
25053
25053
|
map = {};
|
|
25054
|
-
properties.set(
|
|
25054
|
+
properties.set(object2, map);
|
|
25055
25055
|
}
|
|
25056
25056
|
return map;
|
|
25057
25057
|
}
|
|
25058
|
-
function remove(
|
|
25059
|
-
properties.delete(
|
|
25058
|
+
function remove(object2) {
|
|
25059
|
+
properties.delete(object2);
|
|
25060
25060
|
}
|
|
25061
|
-
function update(
|
|
25062
|
-
properties.get(
|
|
25061
|
+
function update(object2, key, value) {
|
|
25062
|
+
properties.get(object2)[key] = value;
|
|
25063
25063
|
}
|
|
25064
25064
|
function dispose() {
|
|
25065
25065
|
properties = /* @__PURE__ */ new WeakMap();
|
|
@@ -25110,44 +25110,44 @@ var MineRender = (() => {
|
|
|
25110
25110
|
transmissive.length = 0;
|
|
25111
25111
|
transparent.length = 0;
|
|
25112
25112
|
}
|
|
25113
|
-
function materialVariant(
|
|
25113
|
+
function materialVariant(object2) {
|
|
25114
25114
|
let variant = 0;
|
|
25115
|
-
if (
|
|
25116
|
-
if (
|
|
25115
|
+
if (object2.isInstancedMesh) variant += 2;
|
|
25116
|
+
if (object2.isSkinnedMesh) variant += 1;
|
|
25117
25117
|
return variant;
|
|
25118
25118
|
}
|
|
25119
|
-
function getNextRenderItem(
|
|
25119
|
+
function getNextRenderItem(object2, geometry, material, groupOrder, z4, group) {
|
|
25120
25120
|
let renderItem = renderItems[renderItemsIndex];
|
|
25121
25121
|
if (renderItem === void 0) {
|
|
25122
25122
|
renderItem = {
|
|
25123
|
-
id:
|
|
25124
|
-
object,
|
|
25123
|
+
id: object2.id,
|
|
25124
|
+
object: object2,
|
|
25125
25125
|
geometry,
|
|
25126
25126
|
material,
|
|
25127
|
-
materialVariant: materialVariant(
|
|
25127
|
+
materialVariant: materialVariant(object2),
|
|
25128
25128
|
groupOrder,
|
|
25129
|
-
renderOrder:
|
|
25129
|
+
renderOrder: object2.renderOrder,
|
|
25130
25130
|
z: z4,
|
|
25131
25131
|
group
|
|
25132
25132
|
};
|
|
25133
25133
|
renderItems[renderItemsIndex] = renderItem;
|
|
25134
25134
|
} else {
|
|
25135
|
-
renderItem.id =
|
|
25136
|
-
renderItem.object =
|
|
25135
|
+
renderItem.id = object2.id;
|
|
25136
|
+
renderItem.object = object2;
|
|
25137
25137
|
renderItem.geometry = geometry;
|
|
25138
25138
|
renderItem.material = material;
|
|
25139
|
-
renderItem.materialVariant = materialVariant(
|
|
25139
|
+
renderItem.materialVariant = materialVariant(object2);
|
|
25140
25140
|
renderItem.groupOrder = groupOrder;
|
|
25141
|
-
renderItem.renderOrder =
|
|
25141
|
+
renderItem.renderOrder = object2.renderOrder;
|
|
25142
25142
|
renderItem.z = z4;
|
|
25143
25143
|
renderItem.group = group;
|
|
25144
25144
|
}
|
|
25145
25145
|
renderItemsIndex++;
|
|
25146
25146
|
return renderItem;
|
|
25147
25147
|
}
|
|
25148
|
-
function push(
|
|
25148
|
+
function push(object2, geometry, material, groupOrder, z4, group, camera) {
|
|
25149
25149
|
if (camera.reversedDepth === true) z4 = -z4;
|
|
25150
|
-
const renderItem = getNextRenderItem(
|
|
25150
|
+
const renderItem = getNextRenderItem(object2, geometry, material, groupOrder, z4, group);
|
|
25151
25151
|
if (material.transmission > 0) {
|
|
25152
25152
|
transmissive.push(renderItem);
|
|
25153
25153
|
} else if (material.transparent === true) {
|
|
@@ -25156,8 +25156,8 @@ var MineRender = (() => {
|
|
|
25156
25156
|
opaque.push(renderItem);
|
|
25157
25157
|
}
|
|
25158
25158
|
}
|
|
25159
|
-
function unshift(
|
|
25160
|
-
const renderItem = getNextRenderItem(
|
|
25159
|
+
function unshift(object2, geometry, material, groupOrder, z4, group) {
|
|
25160
|
+
const renderItem = getNextRenderItem(object2, geometry, material, groupOrder, z4, group);
|
|
25161
25161
|
if (material.transmission > 0) {
|
|
25162
25162
|
transmissive.unshift(renderItem);
|
|
25163
25163
|
} else if (material.transparent === true) {
|
|
@@ -25760,12 +25760,12 @@ var MineRender = (() => {
|
|
|
25760
25760
|
_state.setScissorTest(false);
|
|
25761
25761
|
const typeChanged = _previousType !== this.type;
|
|
25762
25762
|
if (typeChanged) {
|
|
25763
|
-
scene.traverse(function(
|
|
25764
|
-
if (
|
|
25765
|
-
if (Array.isArray(
|
|
25766
|
-
|
|
25763
|
+
scene.traverse(function(object2) {
|
|
25764
|
+
if (object2.material) {
|
|
25765
|
+
if (Array.isArray(object2.material)) {
|
|
25766
|
+
object2.material.forEach((mat) => mat.needsUpdate = true);
|
|
25767
25767
|
} else {
|
|
25768
|
-
|
|
25768
|
+
object2.material.needsUpdate = true;
|
|
25769
25769
|
}
|
|
25770
25770
|
}
|
|
25771
25771
|
});
|
|
@@ -25929,9 +25929,9 @@ var MineRender = (() => {
|
|
|
25929
25929
|
renderer.clear();
|
|
25930
25930
|
renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null);
|
|
25931
25931
|
}
|
|
25932
|
-
function getDepthMaterial(
|
|
25932
|
+
function getDepthMaterial(object2, material, light, type) {
|
|
25933
25933
|
let result = null;
|
|
25934
|
-
const customMaterial = light.isPointLight === true ?
|
|
25934
|
+
const customMaterial = light.isPointLight === true ? object2.customDistanceMaterial : object2.customDepthMaterial;
|
|
25935
25935
|
if (customMaterial !== void 0) {
|
|
25936
25936
|
result = customMaterial;
|
|
25937
25937
|
} else {
|
|
@@ -25976,35 +25976,35 @@ var MineRender = (() => {
|
|
|
25976
25976
|
}
|
|
25977
25977
|
return result;
|
|
25978
25978
|
}
|
|
25979
|
-
function renderObject(
|
|
25980
|
-
if (
|
|
25981
|
-
const visible =
|
|
25982
|
-
if (visible && (
|
|
25983
|
-
if ((
|
|
25984
|
-
|
|
25985
|
-
const geometry = objects.update(
|
|
25986
|
-
const material =
|
|
25979
|
+
function renderObject(object2, camera, shadowCamera, light, type) {
|
|
25980
|
+
if (object2.visible === false) return;
|
|
25981
|
+
const visible = object2.layers.test(camera.layers);
|
|
25982
|
+
if (visible && (object2.isMesh || object2.isLine || object2.isPoints)) {
|
|
25983
|
+
if ((object2.castShadow || object2.receiveShadow && type === VSMShadowMap) && (!object2.frustumCulled || object2.intersectsFrustum(_frustum))) {
|
|
25984
|
+
object2.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object2.matrixWorld);
|
|
25985
|
+
const geometry = objects.update(object2);
|
|
25986
|
+
const material = object2.material;
|
|
25987
25987
|
if (Array.isArray(material)) {
|
|
25988
25988
|
const groups = geometry.groups;
|
|
25989
25989
|
for (let k4 = 0, kl = groups.length; k4 < kl; k4++) {
|
|
25990
25990
|
const group = groups[k4];
|
|
25991
25991
|
const groupMaterial = material[group.materialIndex];
|
|
25992
25992
|
if (groupMaterial && groupMaterial.visible) {
|
|
25993
|
-
const depthMaterial = getDepthMaterial(
|
|
25994
|
-
|
|
25995
|
-
renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial,
|
|
25996
|
-
|
|
25993
|
+
const depthMaterial = getDepthMaterial(object2, groupMaterial, light, type);
|
|
25994
|
+
object2.onBeforeShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, group);
|
|
25995
|
+
renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object2, group);
|
|
25996
|
+
object2.onAfterShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, group);
|
|
25997
25997
|
}
|
|
25998
25998
|
}
|
|
25999
25999
|
} else if (material.visible) {
|
|
26000
|
-
const depthMaterial = getDepthMaterial(
|
|
26001
|
-
|
|
26002
|
-
renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial,
|
|
26003
|
-
|
|
26000
|
+
const depthMaterial = getDepthMaterial(object2, material, light, type);
|
|
26001
|
+
object2.onBeforeShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, null);
|
|
26002
|
+
renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object2, null);
|
|
26003
|
+
object2.onAfterShadow(renderer, object2, camera, shadowCamera, geometry, depthMaterial, null);
|
|
26004
26004
|
}
|
|
26005
26005
|
}
|
|
26006
26006
|
}
|
|
26007
|
-
const children =
|
|
26007
|
+
const children = object2.children;
|
|
26008
26008
|
for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
|
|
26009
26009
|
renderObject(children[i4], camera, shadowCamera, light, type);
|
|
26010
26010
|
}
|
|
@@ -28060,12 +28060,12 @@ var MineRender = (() => {
|
|
|
28060
28060
|
}
|
|
28061
28061
|
function verifyColorSpace(texture, image) {
|
|
28062
28062
|
const colorSpace = texture.colorSpace;
|
|
28063
|
-
const
|
|
28063
|
+
const format3 = texture.format;
|
|
28064
28064
|
const type = texture.type;
|
|
28065
28065
|
if (texture.isCompressedTexture === true || texture.isVideoTexture === true) return image;
|
|
28066
28066
|
if (colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace) {
|
|
28067
28067
|
if (ColorManagement.getTransfer(colorSpace) === SRGBTransfer) {
|
|
28068
|
-
if (
|
|
28068
|
+
if (format3 !== RGBAFormat || type !== UnsignedByteType) {
|
|
28069
28069
|
warn("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.");
|
|
28070
28070
|
}
|
|
28071
28071
|
} else {
|
|
@@ -30096,8 +30096,8 @@ var MineRender = (() => {
|
|
|
30096
30096
|
const u4 = this.map[name2];
|
|
30097
30097
|
if (u4 !== void 0) u4.setValue(gl, value, textures);
|
|
30098
30098
|
}
|
|
30099
|
-
setOptional(gl,
|
|
30100
|
-
const v5 =
|
|
30099
|
+
setOptional(gl, object2, name2) {
|
|
30100
|
+
const v5 = object2[name2];
|
|
30101
30101
|
if (v5 !== void 0) this.setValue(gl, name2, v5);
|
|
30102
30102
|
}
|
|
30103
30103
|
static upload(gl, seq, values, textures) {
|
|
@@ -31798,10 +31798,10 @@ void main() {
|
|
|
31798
31798
|
}
|
|
31799
31799
|
}
|
|
31800
31800
|
}
|
|
31801
|
-
this.renderBufferDirect = function(camera, scene, geometry, material,
|
|
31801
|
+
this.renderBufferDirect = function(camera, scene, geometry, material, object2, group) {
|
|
31802
31802
|
if (scene === null) scene = _emptyScene;
|
|
31803
|
-
const frontFaceCW =
|
|
31804
|
-
const program = setProgram(camera, scene, geometry, material,
|
|
31803
|
+
const frontFaceCW = object2.isMesh && object2.matrixWorld.determinantAffine() < 0;
|
|
31804
|
+
const program = setProgram(camera, scene, geometry, material, object2);
|
|
31805
31805
|
state.setMaterial(material, frontFaceCW);
|
|
31806
31806
|
let index = geometry.index;
|
|
31807
31807
|
let rangeFactor = 1;
|
|
@@ -31827,7 +31827,7 @@ void main() {
|
|
|
31827
31827
|
}
|
|
31828
31828
|
const drawCount = drawEnd - drawStart;
|
|
31829
31829
|
if (drawCount < 0 || drawCount === Infinity) return;
|
|
31830
|
-
bindingStates.setup(
|
|
31830
|
+
bindingStates.setup(object2, material, program, geometry, index);
|
|
31831
31831
|
let attribute;
|
|
31832
31832
|
let renderer = bufferRenderer;
|
|
31833
31833
|
if (index !== null) {
|
|
@@ -31835,34 +31835,34 @@ void main() {
|
|
|
31835
31835
|
renderer = indexedBufferRenderer;
|
|
31836
31836
|
renderer.setIndex(attribute);
|
|
31837
31837
|
}
|
|
31838
|
-
if (
|
|
31838
|
+
if (object2.isMesh) {
|
|
31839
31839
|
if (material.wireframe === true) {
|
|
31840
31840
|
state.setLineWidth(material.wireframeLinewidth * getTargetPixelRatio());
|
|
31841
31841
|
renderer.setMode(_gl.LINES);
|
|
31842
31842
|
} else {
|
|
31843
31843
|
renderer.setMode(_gl.TRIANGLES);
|
|
31844
31844
|
}
|
|
31845
|
-
} else if (
|
|
31845
|
+
} else if (object2.isLine) {
|
|
31846
31846
|
let lineWidth = material.linewidth;
|
|
31847
31847
|
if (lineWidth === void 0) lineWidth = 1;
|
|
31848
31848
|
state.setLineWidth(lineWidth * getTargetPixelRatio());
|
|
31849
|
-
if (
|
|
31849
|
+
if (object2.isLineSegments) {
|
|
31850
31850
|
renderer.setMode(_gl.LINES);
|
|
31851
|
-
} else if (
|
|
31851
|
+
} else if (object2.isLineLoop) {
|
|
31852
31852
|
renderer.setMode(_gl.LINE_LOOP);
|
|
31853
31853
|
} else {
|
|
31854
31854
|
renderer.setMode(_gl.LINE_STRIP);
|
|
31855
31855
|
}
|
|
31856
|
-
} else if (
|
|
31856
|
+
} else if (object2.isPoints) {
|
|
31857
31857
|
renderer.setMode(_gl.POINTS);
|
|
31858
|
-
} else if (
|
|
31858
|
+
} else if (object2.isSprite) {
|
|
31859
31859
|
renderer.setMode(_gl.TRIANGLES);
|
|
31860
31860
|
}
|
|
31861
|
-
if (
|
|
31861
|
+
if (object2.isBatchedMesh) {
|
|
31862
31862
|
if (!extensions.get("WEBGL_multi_draw")) {
|
|
31863
|
-
const starts =
|
|
31864
|
-
const counts =
|
|
31865
|
-
const drawCount2 =
|
|
31863
|
+
const starts = object2._multiDrawStarts;
|
|
31864
|
+
const counts = object2._multiDrawCounts;
|
|
31865
|
+
const drawCount2 = object2._multiDrawCount;
|
|
31866
31866
|
const bytesPerElement = index ? attributes.get(index).bytesPerElement : 1;
|
|
31867
31867
|
const uniforms = properties.get(material).currentProgram.getUniforms();
|
|
31868
31868
|
for (let i4 = 0; i4 < drawCount2; i4++) {
|
|
@@ -31870,10 +31870,10 @@ void main() {
|
|
|
31870
31870
|
renderer.render(starts[i4] / bytesPerElement, counts[i4]);
|
|
31871
31871
|
}
|
|
31872
31872
|
} else {
|
|
31873
|
-
renderer.renderMultiDraw(
|
|
31873
|
+
renderer.renderMultiDraw(object2._multiDrawStarts, object2._multiDrawCounts, object2._multiDrawCount);
|
|
31874
31874
|
}
|
|
31875
|
-
} else if (
|
|
31876
|
-
renderer.renderInstances(drawStart, drawCount,
|
|
31875
|
+
} else if (object2.isInstancedMesh) {
|
|
31876
|
+
renderer.renderInstances(drawStart, drawCount, object2.count);
|
|
31877
31877
|
} else if (geometry.isInstancedBufferGeometry) {
|
|
31878
31878
|
const maxInstanceCount = geometry._maxInstanceCount !== void 0 ? geometry._maxInstanceCount : Infinity;
|
|
31879
31879
|
const instanceCount = Math.min(geometry.instanceCount, maxInstanceCount);
|
|
@@ -31882,19 +31882,19 @@ void main() {
|
|
|
31882
31882
|
renderer.render(drawStart, drawCount);
|
|
31883
31883
|
}
|
|
31884
31884
|
};
|
|
31885
|
-
function prepareMaterial(material, scene, camera,
|
|
31886
|
-
if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(
|
|
31885
|
+
function prepareMaterial(material, scene, camera, object2) {
|
|
31886
|
+
if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(object2, material);
|
|
31887
31887
|
if (_clippingEnabled === true) clipping.setState(material, camera, false);
|
|
31888
31888
|
if (material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false) {
|
|
31889
31889
|
material.side = BackSide;
|
|
31890
31890
|
material.needsUpdate = true;
|
|
31891
|
-
getProgram(material, scene,
|
|
31891
|
+
getProgram(material, scene, object2);
|
|
31892
31892
|
material.side = FrontSide;
|
|
31893
31893
|
material.needsUpdate = true;
|
|
31894
|
-
getProgram(material, scene,
|
|
31894
|
+
getProgram(material, scene, object2);
|
|
31895
31895
|
material.side = DoubleSide;
|
|
31896
31896
|
} else {
|
|
31897
|
-
getProgram(material, scene,
|
|
31897
|
+
getProgram(material, scene, object2);
|
|
31898
31898
|
}
|
|
31899
31899
|
}
|
|
31900
31900
|
this.compile = function(scene, camera, targetScene = null) {
|
|
@@ -31903,20 +31903,20 @@ void main() {
|
|
|
31903
31903
|
currentRenderState = renderStates.get(targetScene);
|
|
31904
31904
|
currentRenderState.init(camera);
|
|
31905
31905
|
renderStateStack.push(currentRenderState);
|
|
31906
|
-
targetScene.traverseVisible(function(
|
|
31907
|
-
if (
|
|
31908
|
-
currentRenderState.pushLight(
|
|
31909
|
-
if (
|
|
31910
|
-
currentRenderState.pushShadow(
|
|
31906
|
+
targetScene.traverseVisible(function(object2) {
|
|
31907
|
+
if (object2.isLight && object2.layers.test(camera.layers)) {
|
|
31908
|
+
currentRenderState.pushLight(object2);
|
|
31909
|
+
if (object2.castShadow) {
|
|
31910
|
+
currentRenderState.pushShadow(object2);
|
|
31911
31911
|
}
|
|
31912
31912
|
}
|
|
31913
31913
|
});
|
|
31914
31914
|
if (scene !== targetScene) {
|
|
31915
|
-
scene.traverseVisible(function(
|
|
31916
|
-
if (
|
|
31917
|
-
currentRenderState.pushLight(
|
|
31918
|
-
if (
|
|
31919
|
-
currentRenderState.pushShadow(
|
|
31915
|
+
scene.traverseVisible(function(object2) {
|
|
31916
|
+
if (object2.isLight && object2.layers.test(camera.layers)) {
|
|
31917
|
+
currentRenderState.pushLight(object2);
|
|
31918
|
+
if (object2.castShadow) {
|
|
31919
|
+
currentRenderState.pushShadow(object2);
|
|
31920
31920
|
}
|
|
31921
31921
|
}
|
|
31922
31922
|
});
|
|
@@ -31928,20 +31928,20 @@ void main() {
|
|
|
31928
31928
|
if (_clippingEnabled === true) clipping.setGlobalState(this.clippingPlanes, camera);
|
|
31929
31929
|
if (_nodesHandler !== null) shadowMap.render(currentRenderState.state.shadowsArray, targetScene, camera);
|
|
31930
31930
|
const materials2 = /* @__PURE__ */ new Set();
|
|
31931
|
-
scene.traverse(function(
|
|
31932
|
-
if (!(
|
|
31931
|
+
scene.traverse(function(object2) {
|
|
31932
|
+
if (!(object2.isMesh || object2.isPoints || object2.isLine || object2.isSprite)) {
|
|
31933
31933
|
return;
|
|
31934
31934
|
}
|
|
31935
|
-
const material =
|
|
31935
|
+
const material = object2.material;
|
|
31936
31936
|
if (material) {
|
|
31937
31937
|
if (Array.isArray(material)) {
|
|
31938
31938
|
for (let i4 = 0; i4 < material.length; i4++) {
|
|
31939
31939
|
const material2 = material[i4];
|
|
31940
|
-
prepareMaterial(material2, targetScene, camera,
|
|
31940
|
+
prepareMaterial(material2, targetScene, camera, object2);
|
|
31941
31941
|
materials2.add(material2);
|
|
31942
31942
|
}
|
|
31943
31943
|
} else {
|
|
31944
|
-
prepareMaterial(material, targetScene, camera,
|
|
31944
|
+
prepareMaterial(material, targetScene, camera, object2);
|
|
31945
31945
|
materials2.add(material);
|
|
31946
31946
|
}
|
|
31947
31947
|
}
|
|
@@ -32098,45 +32098,45 @@ void main() {
|
|
|
32098
32098
|
_nodesHandler.renderEnd();
|
|
32099
32099
|
}
|
|
32100
32100
|
};
|
|
32101
|
-
function projectObject(
|
|
32102
|
-
if (
|
|
32103
|
-
const visible =
|
|
32101
|
+
function projectObject(object2, camera, groupOrder, sortObjects) {
|
|
32102
|
+
if (object2.visible === false) return;
|
|
32103
|
+
const visible = object2.layers.test(camera.layers);
|
|
32104
32104
|
if (visible) {
|
|
32105
|
-
if (
|
|
32106
|
-
groupOrder =
|
|
32107
|
-
} else if (
|
|
32108
|
-
if (
|
|
32109
|
-
} else if (
|
|
32110
|
-
currentRenderState.pushLightProbeGrid(
|
|
32111
|
-
} else if (
|
|
32112
|
-
currentRenderState.pushLight(
|
|
32113
|
-
if (
|
|
32114
|
-
currentRenderState.pushShadow(
|
|
32105
|
+
if (object2.isGroup) {
|
|
32106
|
+
groupOrder = object2.renderOrder;
|
|
32107
|
+
} else if (object2.isLOD) {
|
|
32108
|
+
if (object2.autoUpdate === true) object2.update(camera);
|
|
32109
|
+
} else if (object2.isLightProbeGrid) {
|
|
32110
|
+
currentRenderState.pushLightProbeGrid(object2);
|
|
32111
|
+
} else if (object2.isLight) {
|
|
32112
|
+
currentRenderState.pushLight(object2);
|
|
32113
|
+
if (object2.castShadow) {
|
|
32114
|
+
currentRenderState.pushShadow(object2);
|
|
32115
32115
|
}
|
|
32116
|
-
} else if (
|
|
32117
|
-
if (!
|
|
32116
|
+
} else if (object2.isSprite) {
|
|
32117
|
+
if (!object2.frustumCulled || object2.intersectsFrustum(_frustum)) {
|
|
32118
32118
|
if (sortObjects) {
|
|
32119
|
-
_vector4.setFromMatrixPosition(
|
|
32119
|
+
_vector4.setFromMatrixPosition(object2.matrixWorld).applyMatrix4(_projScreenMatrix2);
|
|
32120
32120
|
}
|
|
32121
|
-
const geometry = objects.update(
|
|
32122
|
-
const material =
|
|
32121
|
+
const geometry = objects.update(object2);
|
|
32122
|
+
const material = object2.material;
|
|
32123
32123
|
if (material.visible) {
|
|
32124
|
-
currentRenderList.push(
|
|
32124
|
+
currentRenderList.push(object2, geometry, material, groupOrder, _vector4.z, null, camera);
|
|
32125
32125
|
}
|
|
32126
32126
|
}
|
|
32127
|
-
} else if (
|
|
32128
|
-
if (!
|
|
32129
|
-
const geometry = objects.update(
|
|
32130
|
-
const material =
|
|
32127
|
+
} else if (object2.isMesh || object2.isLine || object2.isPoints) {
|
|
32128
|
+
if (!object2.frustumCulled || object2.intersectsFrustum(_frustum)) {
|
|
32129
|
+
const geometry = objects.update(object2);
|
|
32130
|
+
const material = object2.material;
|
|
32131
32131
|
if (sortObjects) {
|
|
32132
|
-
if (
|
|
32133
|
-
if (
|
|
32134
|
-
_vector4.copy(
|
|
32132
|
+
if (object2.boundingSphere !== void 0) {
|
|
32133
|
+
if (object2.boundingSphere === null) object2.computeBoundingSphere();
|
|
32134
|
+
_vector4.copy(object2.boundingSphere.center);
|
|
32135
32135
|
} else {
|
|
32136
32136
|
if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
|
|
32137
32137
|
_vector4.copy(geometry.boundingSphere.center);
|
|
32138
32138
|
}
|
|
32139
|
-
_vector4.applyMatrix4(
|
|
32139
|
+
_vector4.applyMatrix4(object2.matrixWorld).applyMatrix4(_projScreenMatrix2);
|
|
32140
32140
|
}
|
|
32141
32141
|
if (Array.isArray(material)) {
|
|
32142
32142
|
const groups = geometry.groups;
|
|
@@ -32144,16 +32144,16 @@ void main() {
|
|
|
32144
32144
|
const group = groups[i4];
|
|
32145
32145
|
const groupMaterial = material[group.materialIndex];
|
|
32146
32146
|
if (groupMaterial && groupMaterial.visible) {
|
|
32147
|
-
currentRenderList.push(
|
|
32147
|
+
currentRenderList.push(object2, geometry, groupMaterial, groupOrder, _vector4.z, group, camera);
|
|
32148
32148
|
}
|
|
32149
32149
|
}
|
|
32150
32150
|
} else if (material.visible) {
|
|
32151
|
-
currentRenderList.push(
|
|
32151
|
+
currentRenderList.push(object2, geometry, material, groupOrder, _vector4.z, null, camera);
|
|
32152
32152
|
}
|
|
32153
32153
|
}
|
|
32154
32154
|
}
|
|
32155
32155
|
}
|
|
32156
|
-
const children =
|
|
32156
|
+
const children = object2.children;
|
|
32157
32157
|
for (let i4 = 0, l4 = children.length; i4 < l4; i4++) {
|
|
32158
32158
|
projectObject(children[i4], camera, groupOrder, sortObjects);
|
|
32159
32159
|
}
|
|
@@ -32217,12 +32217,12 @@ void main() {
|
|
|
32217
32217
|
let renderTargetNeedsUpdate = false;
|
|
32218
32218
|
for (let i4 = 0, l4 = transmissiveObjects.length; i4 < l4; i4++) {
|
|
32219
32219
|
const renderItem = transmissiveObjects[i4];
|
|
32220
|
-
const { object, geometry, material, group } = renderItem;
|
|
32221
|
-
if (material.side === DoubleSide &&
|
|
32220
|
+
const { object: object2, geometry, material, group } = renderItem;
|
|
32221
|
+
if (material.side === DoubleSide && object2.layers.test(camera.layers)) {
|
|
32222
32222
|
const currentSide = material.side;
|
|
32223
32223
|
material.side = BackSide;
|
|
32224
32224
|
material.needsUpdate = true;
|
|
32225
|
-
renderObject(
|
|
32225
|
+
renderObject(object2, scene, camera, geometry, material, group);
|
|
32226
32226
|
material.side = currentSide;
|
|
32227
32227
|
material.needsUpdate = true;
|
|
32228
32228
|
renderTargetNeedsUpdate = true;
|
|
@@ -32242,42 +32242,42 @@ void main() {
|
|
|
32242
32242
|
const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
|
|
32243
32243
|
for (let i4 = 0, l4 = renderList.length; i4 < l4; i4++) {
|
|
32244
32244
|
const renderItem = renderList[i4];
|
|
32245
|
-
const { object, geometry, group } = renderItem;
|
|
32245
|
+
const { object: object2, geometry, group } = renderItem;
|
|
32246
32246
|
let material = renderItem.material;
|
|
32247
32247
|
if (material.allowOverride === true && overrideMaterial !== null) {
|
|
32248
32248
|
material = overrideMaterial;
|
|
32249
32249
|
}
|
|
32250
|
-
if (
|
|
32251
|
-
renderObject(
|
|
32250
|
+
if (object2.layers.test(camera.layers)) {
|
|
32251
|
+
renderObject(object2, scene, camera, geometry, material, group);
|
|
32252
32252
|
}
|
|
32253
32253
|
}
|
|
32254
32254
|
}
|
|
32255
|
-
function renderObject(
|
|
32256
|
-
if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(
|
|
32257
|
-
|
|
32258
|
-
|
|
32259
|
-
|
|
32260
|
-
material.onBeforeRender(_this, scene, camera, geometry,
|
|
32255
|
+
function renderObject(object2, scene, camera, geometry, material, group) {
|
|
32256
|
+
if (_nodesHandler !== null && material.isNodeMaterial) _nodesHandler.setObject(object2, material);
|
|
32257
|
+
object2.onBeforeRender(_this, scene, camera, geometry, material, group);
|
|
32258
|
+
object2.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, object2.matrixWorld);
|
|
32259
|
+
object2.normalMatrix.getNormalMatrix(object2.modelViewMatrix);
|
|
32260
|
+
material.onBeforeRender(_this, scene, camera, geometry, object2, group);
|
|
32261
32261
|
if (material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false) {
|
|
32262
32262
|
material.side = BackSide;
|
|
32263
32263
|
material.needsUpdate = true;
|
|
32264
|
-
_this.renderBufferDirect(camera, scene, geometry, material,
|
|
32264
|
+
_this.renderBufferDirect(camera, scene, geometry, material, object2, group);
|
|
32265
32265
|
material.side = FrontSide;
|
|
32266
32266
|
material.needsUpdate = true;
|
|
32267
|
-
_this.renderBufferDirect(camera, scene, geometry, material,
|
|
32267
|
+
_this.renderBufferDirect(camera, scene, geometry, material, object2, group);
|
|
32268
32268
|
material.side = DoubleSide;
|
|
32269
32269
|
} else {
|
|
32270
|
-
_this.renderBufferDirect(camera, scene, geometry, material,
|
|
32270
|
+
_this.renderBufferDirect(camera, scene, geometry, material, object2, group);
|
|
32271
32271
|
}
|
|
32272
|
-
|
|
32272
|
+
object2.onAfterRender(_this, scene, camera, geometry, material, group);
|
|
32273
32273
|
}
|
|
32274
|
-
function getProgram(material, scene,
|
|
32274
|
+
function getProgram(material, scene, object2) {
|
|
32275
32275
|
if (scene.isScene !== true) scene = _emptyScene;
|
|
32276
32276
|
const materialProperties = properties.get(material);
|
|
32277
32277
|
const lights = currentRenderState.state.lights;
|
|
32278
32278
|
const shadowsArray = currentRenderState.state.shadowsArray;
|
|
32279
32279
|
const lightsStateVersion = lights.state.version;
|
|
32280
|
-
const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene,
|
|
32280
|
+
const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object2, currentRenderState.state.lightProbeGridArray);
|
|
32281
32281
|
const programCacheKey = programCache.getProgramCacheKey(parameters2);
|
|
32282
32282
|
let programs = materialProperties.programs;
|
|
32283
32283
|
materialProperties.environment = material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial ? scene.environment : null;
|
|
@@ -32299,7 +32299,7 @@ void main() {
|
|
|
32299
32299
|
} else {
|
|
32300
32300
|
parameters2.uniforms = programCache.getUniforms(material);
|
|
32301
32301
|
if (_nodesHandler !== null && material.isNodeMaterial) {
|
|
32302
|
-
_nodesHandler.build(material,
|
|
32302
|
+
_nodesHandler.build(material, object2, parameters2);
|
|
32303
32303
|
}
|
|
32304
32304
|
material.onBeforeCompile(parameters2, _this);
|
|
32305
32305
|
program = programCache.acquireProgram(parameters2, programCacheKey);
|
|
@@ -32366,19 +32366,19 @@ void main() {
|
|
|
32366
32366
|
materialProperties.vertexTangents = parameters2.vertexTangents;
|
|
32367
32367
|
materialProperties.toneMapping = parameters2.toneMapping;
|
|
32368
32368
|
}
|
|
32369
|
-
function findLightProbeGrid(volumes,
|
|
32369
|
+
function findLightProbeGrid(volumes, object2) {
|
|
32370
32370
|
if (volumes.length === 0) return null;
|
|
32371
32371
|
if (volumes.length === 1) {
|
|
32372
32372
|
return volumes[0].texture !== null ? volumes[0] : null;
|
|
32373
32373
|
}
|
|
32374
|
-
objectPosition.setFromMatrixPosition(
|
|
32374
|
+
objectPosition.setFromMatrixPosition(object2.matrixWorld);
|
|
32375
32375
|
for (let i4 = 0, l4 = volumes.length; i4 < l4; i4++) {
|
|
32376
32376
|
const v5 = volumes[i4];
|
|
32377
32377
|
if (v5.texture !== null && v5.boundingBox.containsPoint(objectPosition)) return v5;
|
|
32378
32378
|
}
|
|
32379
32379
|
return null;
|
|
32380
32380
|
}
|
|
32381
|
-
function setProgram(camera, scene, geometry, material,
|
|
32381
|
+
function setProgram(camera, scene, geometry, material, object2) {
|
|
32382
32382
|
if (scene.isScene !== true) scene = _emptyScene;
|
|
32383
32383
|
textures.resetTextureUnits();
|
|
32384
32384
|
const fog = scene.fog;
|
|
@@ -32413,29 +32413,29 @@ void main() {
|
|
|
32413
32413
|
needsProgramChange = true;
|
|
32414
32414
|
} else if (materialProperties.outputColorSpace !== colorSpace) {
|
|
32415
32415
|
needsProgramChange = true;
|
|
32416
|
-
} else if (
|
|
32416
|
+
} else if (object2.isBatchedMesh && materialProperties.batching === false) {
|
|
32417
32417
|
needsProgramChange = true;
|
|
32418
|
-
} else if (!
|
|
32418
|
+
} else if (!object2.isBatchedMesh && materialProperties.batching === true) {
|
|
32419
32419
|
needsProgramChange = true;
|
|
32420
|
-
} else if (
|
|
32420
|
+
} else if (object2.isBatchedMesh && materialProperties.batchingColor === true && object2._colorsTexture === null) {
|
|
32421
32421
|
needsProgramChange = true;
|
|
32422
|
-
} else if (
|
|
32422
|
+
} else if (object2.isBatchedMesh && materialProperties.batchingColor === false && object2._colorsTexture !== null) {
|
|
32423
32423
|
needsProgramChange = true;
|
|
32424
|
-
} else if (
|
|
32424
|
+
} else if (object2.isInstancedMesh && materialProperties.instancing === false) {
|
|
32425
32425
|
needsProgramChange = true;
|
|
32426
|
-
} else if (!
|
|
32426
|
+
} else if (!object2.isInstancedMesh && materialProperties.instancing === true) {
|
|
32427
32427
|
needsProgramChange = true;
|
|
32428
|
-
} else if (
|
|
32428
|
+
} else if (object2.isSkinnedMesh && materialProperties.skinning === false) {
|
|
32429
32429
|
needsProgramChange = true;
|
|
32430
|
-
} else if (!
|
|
32430
|
+
} else if (!object2.isSkinnedMesh && materialProperties.skinning === true) {
|
|
32431
32431
|
needsProgramChange = true;
|
|
32432
|
-
} else if (
|
|
32432
|
+
} else if (object2.isInstancedMesh && materialProperties.instancingColor === true && object2.instanceColor === null) {
|
|
32433
32433
|
needsProgramChange = true;
|
|
32434
|
-
} else if (
|
|
32434
|
+
} else if (object2.isInstancedMesh && materialProperties.instancingColor === false && object2.instanceColor !== null) {
|
|
32435
32435
|
needsProgramChange = true;
|
|
32436
|
-
} else if (
|
|
32436
|
+
} else if (object2.isInstancedMesh && materialProperties.instancingMorph === true && object2.morphTexture === null) {
|
|
32437
32437
|
needsProgramChange = true;
|
|
32438
|
-
} else if (
|
|
32438
|
+
} else if (object2.isInstancedMesh && materialProperties.instancingMorph === false && object2.morphTexture !== null) {
|
|
32439
32439
|
needsProgramChange = true;
|
|
32440
32440
|
} else if (materialProperties.envMap !== envMap) {
|
|
32441
32441
|
needsProgramChange = true;
|
|
@@ -32466,7 +32466,7 @@ void main() {
|
|
|
32466
32466
|
}
|
|
32467
32467
|
let program = materialProperties.currentProgram;
|
|
32468
32468
|
if (needsProgramChange === true) {
|
|
32469
|
-
program = getProgram(material, scene,
|
|
32469
|
+
program = getProgram(material, scene, object2);
|
|
32470
32470
|
if (_nodesHandler && material.isNodeMaterial) {
|
|
32471
32471
|
_nodesHandler.onUpdateProgram(material, program, materialProperties);
|
|
32472
32472
|
}
|
|
@@ -32485,7 +32485,7 @@ void main() {
|
|
|
32485
32485
|
refreshMaterial = true;
|
|
32486
32486
|
}
|
|
32487
32487
|
if (materialProperties.needsLights) {
|
|
32488
|
-
const objectVolume = findLightProbeGrid(currentRenderState.state.lightProbeGridArray,
|
|
32488
|
+
const objectVolume = findLightProbeGrid(currentRenderState.state.lightProbeGridArray, object2);
|
|
32489
32489
|
if (materialProperties.lightProbeGrid !== objectVolume) {
|
|
32490
32490
|
materialProperties.lightProbeGrid = objectVolume;
|
|
32491
32491
|
refreshMaterial = true;
|
|
@@ -32533,32 +32533,32 @@ void main() {
|
|
|
32533
32533
|
p_uniforms.setValue(_gl, "pointShadowMap", lights.state.pointShadowMap, textures);
|
|
32534
32534
|
}
|
|
32535
32535
|
}
|
|
32536
|
-
if (
|
|
32537
|
-
p_uniforms.setOptional(_gl,
|
|
32538
|
-
p_uniforms.setOptional(_gl,
|
|
32539
|
-
const skeleton =
|
|
32536
|
+
if (object2.isSkinnedMesh) {
|
|
32537
|
+
p_uniforms.setOptional(_gl, object2, "bindMatrix");
|
|
32538
|
+
p_uniforms.setOptional(_gl, object2, "bindMatrixInverse");
|
|
32539
|
+
const skeleton = object2.skeleton;
|
|
32540
32540
|
if (skeleton) {
|
|
32541
32541
|
if (skeleton.boneTexture === null) skeleton.computeBoneTexture();
|
|
32542
32542
|
p_uniforms.setValue(_gl, "boneTexture", skeleton.boneTexture, textures);
|
|
32543
32543
|
}
|
|
32544
32544
|
}
|
|
32545
|
-
if (
|
|
32546
|
-
p_uniforms.setOptional(_gl,
|
|
32547
|
-
p_uniforms.setValue(_gl, "batchingTexture",
|
|
32548
|
-
p_uniforms.setOptional(_gl,
|
|
32549
|
-
p_uniforms.setValue(_gl, "batchingIdTexture",
|
|
32550
|
-
p_uniforms.setOptional(_gl,
|
|
32551
|
-
if (
|
|
32552
|
-
p_uniforms.setValue(_gl, "batchingColorTexture",
|
|
32545
|
+
if (object2.isBatchedMesh) {
|
|
32546
|
+
p_uniforms.setOptional(_gl, object2, "batchingTexture");
|
|
32547
|
+
p_uniforms.setValue(_gl, "batchingTexture", object2._matricesTexture, textures);
|
|
32548
|
+
p_uniforms.setOptional(_gl, object2, "batchingIdTexture");
|
|
32549
|
+
p_uniforms.setValue(_gl, "batchingIdTexture", object2._indirectTexture, textures);
|
|
32550
|
+
p_uniforms.setOptional(_gl, object2, "batchingColorTexture");
|
|
32551
|
+
if (object2._colorsTexture !== null) {
|
|
32552
|
+
p_uniforms.setValue(_gl, "batchingColorTexture", object2._colorsTexture, textures);
|
|
32553
32553
|
}
|
|
32554
32554
|
}
|
|
32555
32555
|
const morphAttributes = geometry.morphAttributes;
|
|
32556
32556
|
if (morphAttributes.position !== void 0 || morphAttributes.normal !== void 0 || morphAttributes.color !== void 0) {
|
|
32557
|
-
morphtargets.update(
|
|
32557
|
+
morphtargets.update(object2, geometry, program);
|
|
32558
32558
|
}
|
|
32559
|
-
if (refreshMaterial || materialProperties.receiveShadow !==
|
|
32560
|
-
materialProperties.receiveShadow =
|
|
32561
|
-
p_uniforms.setValue(_gl, "receiveShadow",
|
|
32559
|
+
if (refreshMaterial || materialProperties.receiveShadow !== object2.receiveShadow) {
|
|
32560
|
+
materialProperties.receiveShadow = object2.receiveShadow;
|
|
32561
|
+
p_uniforms.setValue(_gl, "receiveShadow", object2.receiveShadow);
|
|
32562
32562
|
}
|
|
32563
32563
|
if ((material.isMeshStandardMaterial || material.isMeshLambertMaterial || material.isMeshPhongMaterial) && material.envMap === null && scene.environment !== null) {
|
|
32564
32564
|
m_uniforms.envMapIntensity.value = scene.environmentIntensity;
|
|
@@ -32589,11 +32589,11 @@ void main() {
|
|
|
32589
32589
|
material.uniformsNeedUpdate = false;
|
|
32590
32590
|
}
|
|
32591
32591
|
if (material.isSpriteMaterial) {
|
|
32592
|
-
p_uniforms.setValue(_gl, "center",
|
|
32592
|
+
p_uniforms.setValue(_gl, "center", object2.center);
|
|
32593
32593
|
}
|
|
32594
|
-
p_uniforms.setValue(_gl, "modelViewMatrix",
|
|
32595
|
-
p_uniforms.setValue(_gl, "normalMatrix",
|
|
32596
|
-
p_uniforms.setValue(_gl, "modelMatrix",
|
|
32594
|
+
p_uniforms.setValue(_gl, "modelViewMatrix", object2.modelViewMatrix);
|
|
32595
|
+
p_uniforms.setValue(_gl, "normalMatrix", object2.normalMatrix);
|
|
32596
|
+
p_uniforms.setValue(_gl, "modelMatrix", object2.matrixWorld);
|
|
32597
32597
|
if (material.uniformsGroups !== void 0) {
|
|
32598
32598
|
const groups = material.uniformsGroups;
|
|
32599
32599
|
for (let i4 = 0, l4 = groups.length; i4 < l4; i4++) {
|
|
@@ -36694,9 +36694,9 @@ void main() {
|
|
|
36694
36694
|
*
|
|
36695
36695
|
* var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
|
|
36696
36696
|
*/
|
|
36697
|
-
_parse: function(ciphertext,
|
|
36697
|
+
_parse: function(ciphertext, format3) {
|
|
36698
36698
|
if (typeof ciphertext == "string") {
|
|
36699
|
-
return
|
|
36699
|
+
return format3.parse(ciphertext, this);
|
|
36700
36700
|
} else {
|
|
36701
36701
|
return ciphertext;
|
|
36702
36702
|
}
|
|
@@ -42301,7 +42301,7 @@ void main() {
|
|
|
42301
42301
|
static createTexture() {
|
|
42302
42302
|
return new Texture();
|
|
42303
42303
|
}
|
|
42304
|
-
static loadInBackground(src,
|
|
42304
|
+
static loadInBackground(src, format3 = RGBAFormat, rotation = 0) {
|
|
42305
42305
|
const texture = this.createTexture();
|
|
42306
42306
|
texture.colorSpace = SRGBColorSpace;
|
|
42307
42307
|
const image = ImageLoader2.loadElement(src, () => {
|
|
@@ -42311,11 +42311,11 @@ void main() {
|
|
|
42311
42311
|
console.warn("Failed to load texture", src, error2);
|
|
42312
42312
|
});
|
|
42313
42313
|
texture.image = image;
|
|
42314
|
-
texture.format =
|
|
42314
|
+
texture.format = format3;
|
|
42315
42315
|
texture.rotation = rotation;
|
|
42316
42316
|
return Textures.initTextureProps(texture);
|
|
42317
42317
|
}
|
|
42318
|
-
static load(src,
|
|
42318
|
+
static load(src, format3 = RGBAFormat, rotation = 0) {
|
|
42319
42319
|
const texture = new Texture();
|
|
42320
42320
|
texture.colorSpace = SRGBColorSpace;
|
|
42321
42321
|
ImageLoader2.getData(src).then((image) => {
|
|
@@ -42325,7 +42325,7 @@ void main() {
|
|
|
42325
42325
|
this.failedTextures.add(texture);
|
|
42326
42326
|
console.warn("Failed to load texture", src, error2);
|
|
42327
42327
|
});
|
|
42328
|
-
texture.format =
|
|
42328
|
+
texture.format = format3;
|
|
42329
42329
|
texture.rotation = rotation;
|
|
42330
42330
|
return Textures.initTextureProps(texture);
|
|
42331
42331
|
}
|
|
@@ -43294,6 +43294,10 @@ void main() {
|
|
|
43294
43294
|
AssetSource = class {
|
|
43295
43295
|
constructor() {
|
|
43296
43296
|
}
|
|
43297
|
+
/** Whether this source prevents lower-priority sources from supplying the key. Its own assets remain available. */
|
|
43298
|
+
blocks(key) {
|
|
43299
|
+
return false;
|
|
43300
|
+
}
|
|
43297
43301
|
/**
|
|
43298
43302
|
* Identifies this source's content across sessions for persistent caching. Sources that
|
|
43299
43303
|
* cannot tell whether their content changed (an unnamed archive, for example) return
|
|
@@ -45328,7 +45332,7 @@ void main() {
|
|
|
45328
45332
|
Buffer2.isBuffer = function isBuffer2(b4) {
|
|
45329
45333
|
return b4 != null && b4._isBuffer === true && b4 !== Buffer2.prototype;
|
|
45330
45334
|
};
|
|
45331
|
-
Buffer2.compare = function
|
|
45335
|
+
Buffer2.compare = function compare2(a4, b4) {
|
|
45332
45336
|
if (isInstance(a4, Uint8Array)) a4 = Buffer2.from(a4, a4.offset, a4.byteLength);
|
|
45333
45337
|
if (isInstance(b4, Uint8Array)) b4 = Buffer2.from(b4, b4.offset, b4.byteLength);
|
|
45334
45338
|
if (!Buffer2.isBuffer(a4) || !Buffer2.isBuffer(b4)) {
|
|
@@ -45550,7 +45554,7 @@ void main() {
|
|
|
45550
45554
|
if (customInspectSymbol) {
|
|
45551
45555
|
Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
|
|
45552
45556
|
}
|
|
45553
|
-
Buffer2.prototype.compare = function
|
|
45557
|
+
Buffer2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) {
|
|
45554
45558
|
if (isInstance(target, Uint8Array)) {
|
|
45555
45559
|
target = Buffer2.from(target, target.offset, target.byteLength);
|
|
45556
45560
|
}
|
|
@@ -46691,12 +46695,12 @@ void main() {
|
|
|
46691
46695
|
function dew$d() {
|
|
46692
46696
|
if (_dewExec$d) return exports$d;
|
|
46693
46697
|
_dewExec$d = true;
|
|
46694
|
-
function ownKeys(
|
|
46695
|
-
var keys = Object.keys(
|
|
46698
|
+
function ownKeys(object2, enumerableOnly) {
|
|
46699
|
+
var keys = Object.keys(object2);
|
|
46696
46700
|
if (Object.getOwnPropertySymbols) {
|
|
46697
|
-
var symbols = Object.getOwnPropertySymbols(
|
|
46701
|
+
var symbols = Object.getOwnPropertySymbols(object2);
|
|
46698
46702
|
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
46699
|
-
return Object.getOwnPropertyDescriptor(
|
|
46703
|
+
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
46700
46704
|
});
|
|
46701
46705
|
keys.push.apply(keys, symbols);
|
|
46702
46706
|
}
|
|
@@ -47262,15 +47266,15 @@ void main() {
|
|
|
47262
47266
|
if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
|
|
47263
47267
|
realHasInstance = Function.prototype[Symbol.hasInstance];
|
|
47264
47268
|
Object.defineProperty(Writable, Symbol.hasInstance, {
|
|
47265
|
-
value: function value(
|
|
47266
|
-
if (realHasInstance.call(this,
|
|
47269
|
+
value: function value(object2) {
|
|
47270
|
+
if (realHasInstance.call(this, object2)) return true;
|
|
47267
47271
|
if (this !== Writable) return false;
|
|
47268
|
-
return
|
|
47272
|
+
return object2 && object2._writableState instanceof WritableState;
|
|
47269
47273
|
}
|
|
47270
47274
|
});
|
|
47271
47275
|
} else {
|
|
47272
|
-
realHasInstance = function realHasInstance2(
|
|
47273
|
-
return
|
|
47276
|
+
realHasInstance = function realHasInstance2(object2) {
|
|
47277
|
+
return object2 instanceof this;
|
|
47274
47278
|
};
|
|
47275
47279
|
}
|
|
47276
47280
|
function Writable(options) {
|
|
@@ -55765,8 +55769,8 @@ void main() {
|
|
|
55765
55769
|
return false;
|
|
55766
55770
|
}
|
|
55767
55771
|
function baseProperty(key) {
|
|
55768
|
-
return function(
|
|
55769
|
-
return
|
|
55772
|
+
return function(object2) {
|
|
55773
|
+
return object2 == null ? void 0 : object2[key];
|
|
55770
55774
|
};
|
|
55771
55775
|
}
|
|
55772
55776
|
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
|
|
@@ -55787,8 +55791,8 @@ void main() {
|
|
|
55787
55791
|
return func(value);
|
|
55788
55792
|
};
|
|
55789
55793
|
}
|
|
55790
|
-
function getValue(
|
|
55791
|
-
return
|
|
55794
|
+
function getValue(object2, key) {
|
|
55795
|
+
return object2 == null ? void 0 : object2[key];
|
|
55792
55796
|
}
|
|
55793
55797
|
function isHostObject(value) {
|
|
55794
55798
|
var result = false;
|
|
@@ -56036,22 +56040,22 @@ void main() {
|
|
|
56036
56040
|
}
|
|
56037
56041
|
var baseEach = createBaseEach(baseForOwn);
|
|
56038
56042
|
var baseFor = createBaseFor();
|
|
56039
|
-
function baseForOwn(
|
|
56040
|
-
return
|
|
56043
|
+
function baseForOwn(object2, iteratee) {
|
|
56044
|
+
return object2 && baseFor(object2, iteratee, keys);
|
|
56041
56045
|
}
|
|
56042
|
-
function baseGet(
|
|
56043
|
-
path = isKey(path,
|
|
56046
|
+
function baseGet(object2, path) {
|
|
56047
|
+
path = isKey(path, object2) ? [path] : castPath(path);
|
|
56044
56048
|
var index = 0, length = path.length;
|
|
56045
|
-
while (
|
|
56046
|
-
|
|
56049
|
+
while (object2 != null && index < length) {
|
|
56050
|
+
object2 = object2[toKey(path[index++])];
|
|
56047
56051
|
}
|
|
56048
|
-
return index && index == length ?
|
|
56052
|
+
return index && index == length ? object2 : void 0;
|
|
56049
56053
|
}
|
|
56050
56054
|
function baseGetTag(value) {
|
|
56051
56055
|
return objectToString.call(value);
|
|
56052
56056
|
}
|
|
56053
|
-
function baseHasIn(
|
|
56054
|
-
return
|
|
56057
|
+
function baseHasIn(object2, key) {
|
|
56058
|
+
return object2 != null && key in Object(object2);
|
|
56055
56059
|
}
|
|
56056
56060
|
function baseIsEqual(value, other, customizer, bitmask, stack) {
|
|
56057
56061
|
if (value === other) {
|
|
@@ -56062,25 +56066,25 @@ void main() {
|
|
|
56062
56066
|
}
|
|
56063
56067
|
return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
|
|
56064
56068
|
}
|
|
56065
|
-
function baseIsEqualDeep(
|
|
56066
|
-
var objIsArr = isArray2(
|
|
56069
|
+
function baseIsEqualDeep(object2, other, equalFunc, customizer, bitmask, stack) {
|
|
56070
|
+
var objIsArr = isArray2(object2), othIsArr = isArray2(other), objTag = arrayTag, othTag = arrayTag;
|
|
56067
56071
|
if (!objIsArr) {
|
|
56068
|
-
objTag = getTag(
|
|
56072
|
+
objTag = getTag(object2);
|
|
56069
56073
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
56070
56074
|
}
|
|
56071
56075
|
if (!othIsArr) {
|
|
56072
56076
|
othTag = getTag(other);
|
|
56073
56077
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
56074
56078
|
}
|
|
56075
|
-
var objIsObj = objTag == objectTag && !isHostObject(
|
|
56079
|
+
var objIsObj = objTag == objectTag && !isHostObject(object2), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
|
|
56076
56080
|
if (isSameTag && !objIsObj) {
|
|
56077
56081
|
stack || (stack = new Stack());
|
|
56078
|
-
return objIsArr || isTypedArray2(
|
|
56082
|
+
return objIsArr || isTypedArray2(object2) ? equalArrays(object2, other, equalFunc, customizer, bitmask, stack) : equalByTag(object2, other, objTag, equalFunc, customizer, bitmask, stack);
|
|
56079
56083
|
}
|
|
56080
56084
|
if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
|
|
56081
|
-
var objIsWrapped = objIsObj && hasOwnProperty.call(
|
|
56085
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
56082
56086
|
if (objIsWrapped || othIsWrapped) {
|
|
56083
|
-
var objUnwrapped = objIsWrapped ?
|
|
56087
|
+
var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
56084
56088
|
stack || (stack = new Stack());
|
|
56085
56089
|
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
|
|
56086
56090
|
}
|
|
@@ -56089,31 +56093,31 @@ void main() {
|
|
|
56089
56093
|
return false;
|
|
56090
56094
|
}
|
|
56091
56095
|
stack || (stack = new Stack());
|
|
56092
|
-
return equalObjects(
|
|
56096
|
+
return equalObjects(object2, other, equalFunc, customizer, bitmask, stack);
|
|
56093
56097
|
}
|
|
56094
|
-
function baseIsMatch(
|
|
56098
|
+
function baseIsMatch(object2, source, matchData, customizer) {
|
|
56095
56099
|
var index = matchData.length, length = index, noCustomizer = !customizer;
|
|
56096
|
-
if (
|
|
56100
|
+
if (object2 == null) {
|
|
56097
56101
|
return !length;
|
|
56098
56102
|
}
|
|
56099
|
-
|
|
56103
|
+
object2 = Object(object2);
|
|
56100
56104
|
while (index--) {
|
|
56101
56105
|
var data = matchData[index];
|
|
56102
|
-
if (noCustomizer && data[2] ? data[1] !==
|
|
56106
|
+
if (noCustomizer && data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) {
|
|
56103
56107
|
return false;
|
|
56104
56108
|
}
|
|
56105
56109
|
}
|
|
56106
56110
|
while (++index < length) {
|
|
56107
56111
|
data = matchData[index];
|
|
56108
|
-
var key = data[0], objValue =
|
|
56112
|
+
var key = data[0], objValue = object2[key], srcValue = data[1];
|
|
56109
56113
|
if (noCustomizer && data[2]) {
|
|
56110
|
-
if (objValue === void 0 && !(key in
|
|
56114
|
+
if (objValue === void 0 && !(key in object2)) {
|
|
56111
56115
|
return false;
|
|
56112
56116
|
}
|
|
56113
56117
|
} else {
|
|
56114
56118
|
var stack = new Stack();
|
|
56115
56119
|
if (customizer) {
|
|
56116
|
-
var result = customizer(objValue, srcValue, key,
|
|
56120
|
+
var result = customizer(objValue, srcValue, key, object2, source, stack);
|
|
56117
56121
|
}
|
|
56118
56122
|
if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
|
|
56119
56123
|
return false;
|
|
@@ -56126,8 +56130,8 @@ void main() {
|
|
|
56126
56130
|
if (!isObject2(value) || isMasked(value)) {
|
|
56127
56131
|
return false;
|
|
56128
56132
|
}
|
|
56129
|
-
var
|
|
56130
|
-
return
|
|
56133
|
+
var pattern2 = isFunction2(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
|
56134
|
+
return pattern2.test(toSource(value));
|
|
56131
56135
|
}
|
|
56132
56136
|
function baseIsTypedArray(value) {
|
|
56133
56137
|
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
|
|
@@ -56144,13 +56148,13 @@ void main() {
|
|
|
56144
56148
|
}
|
|
56145
56149
|
return property(value);
|
|
56146
56150
|
}
|
|
56147
|
-
function baseKeys(
|
|
56148
|
-
if (!isPrototype(
|
|
56149
|
-
return nativeKeys(
|
|
56151
|
+
function baseKeys(object2) {
|
|
56152
|
+
if (!isPrototype(object2)) {
|
|
56153
|
+
return nativeKeys(object2);
|
|
56150
56154
|
}
|
|
56151
56155
|
var result = [];
|
|
56152
|
-
for (var key in Object(
|
|
56153
|
-
if (hasOwnProperty.call(
|
|
56156
|
+
for (var key in Object(object2)) {
|
|
56157
|
+
if (hasOwnProperty.call(object2, key) && key != "constructor") {
|
|
56154
56158
|
result.push(key);
|
|
56155
56159
|
}
|
|
56156
56160
|
}
|
|
@@ -56161,22 +56165,22 @@ void main() {
|
|
|
56161
56165
|
if (matchData.length == 1 && matchData[0][2]) {
|
|
56162
56166
|
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
56163
56167
|
}
|
|
56164
|
-
return function(
|
|
56165
|
-
return
|
|
56168
|
+
return function(object2) {
|
|
56169
|
+
return object2 === source || baseIsMatch(object2, source, matchData);
|
|
56166
56170
|
};
|
|
56167
56171
|
}
|
|
56168
56172
|
function baseMatchesProperty(path, srcValue) {
|
|
56169
56173
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
56170
56174
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
56171
56175
|
}
|
|
56172
|
-
return function(
|
|
56173
|
-
var objValue = get(
|
|
56174
|
-
return objValue === void 0 && objValue === srcValue ? hasIn(
|
|
56176
|
+
return function(object2) {
|
|
56177
|
+
var objValue = get(object2, path);
|
|
56178
|
+
return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
|
|
56175
56179
|
};
|
|
56176
56180
|
}
|
|
56177
56181
|
function basePropertyDeep(path) {
|
|
56178
|
-
return function(
|
|
56179
|
-
return baseGet(
|
|
56182
|
+
return function(object2) {
|
|
56183
|
+
return baseGet(object2, path);
|
|
56180
56184
|
};
|
|
56181
56185
|
}
|
|
56182
56186
|
function baseToString(value) {
|
|
@@ -56210,15 +56214,15 @@ void main() {
|
|
|
56210
56214
|
};
|
|
56211
56215
|
}
|
|
56212
56216
|
function createBaseFor(fromRight) {
|
|
56213
|
-
return function(
|
|
56214
|
-
var index = -1, iterable = Object(
|
|
56217
|
+
return function(object2, iteratee, keysFunc) {
|
|
56218
|
+
var index = -1, iterable = Object(object2), props = keysFunc(object2), length = props.length;
|
|
56215
56219
|
while (length--) {
|
|
56216
56220
|
var key = props[fromRight ? length : ++index];
|
|
56217
56221
|
if (iteratee(iterable[key], key, iterable) === false) {
|
|
56218
56222
|
break;
|
|
56219
56223
|
}
|
|
56220
56224
|
}
|
|
56221
|
-
return
|
|
56225
|
+
return object2;
|
|
56222
56226
|
};
|
|
56223
56227
|
}
|
|
56224
56228
|
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
|
|
@@ -56263,54 +56267,54 @@ void main() {
|
|
|
56263
56267
|
stack["delete"](other);
|
|
56264
56268
|
return result;
|
|
56265
56269
|
}
|
|
56266
|
-
function equalByTag(
|
|
56270
|
+
function equalByTag(object2, other, tag, equalFunc, customizer, bitmask, stack) {
|
|
56267
56271
|
switch (tag) {
|
|
56268
56272
|
case dataViewTag:
|
|
56269
|
-
if (
|
|
56273
|
+
if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
|
|
56270
56274
|
return false;
|
|
56271
56275
|
}
|
|
56272
|
-
|
|
56276
|
+
object2 = object2.buffer;
|
|
56273
56277
|
other = other.buffer;
|
|
56274
56278
|
case arrayBufferTag:
|
|
56275
|
-
if (
|
|
56279
|
+
if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) {
|
|
56276
56280
|
return false;
|
|
56277
56281
|
}
|
|
56278
56282
|
return true;
|
|
56279
56283
|
case boolTag:
|
|
56280
56284
|
case dateTag:
|
|
56281
56285
|
case numberTag:
|
|
56282
|
-
return eq(+
|
|
56286
|
+
return eq(+object2, +other);
|
|
56283
56287
|
case errorTag:
|
|
56284
|
-
return
|
|
56288
|
+
return object2.name == other.name && object2.message == other.message;
|
|
56285
56289
|
case regexpTag:
|
|
56286
56290
|
case stringTag:
|
|
56287
|
-
return
|
|
56291
|
+
return object2 == other + "";
|
|
56288
56292
|
case mapTag:
|
|
56289
56293
|
var convert = mapToArray;
|
|
56290
56294
|
case setTag:
|
|
56291
56295
|
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
|
56292
56296
|
convert || (convert = setToArray);
|
|
56293
|
-
if (
|
|
56297
|
+
if (object2.size != other.size && !isPartial) {
|
|
56294
56298
|
return false;
|
|
56295
56299
|
}
|
|
56296
|
-
var stacked = stack.get(
|
|
56300
|
+
var stacked = stack.get(object2);
|
|
56297
56301
|
if (stacked) {
|
|
56298
56302
|
return stacked == other;
|
|
56299
56303
|
}
|
|
56300
56304
|
bitmask |= UNORDERED_COMPARE_FLAG;
|
|
56301
|
-
stack.set(
|
|
56302
|
-
var result = equalArrays(convert(
|
|
56303
|
-
stack["delete"](
|
|
56305
|
+
stack.set(object2, other);
|
|
56306
|
+
var result = equalArrays(convert(object2), convert(other), equalFunc, customizer, bitmask, stack);
|
|
56307
|
+
stack["delete"](object2);
|
|
56304
56308
|
return result;
|
|
56305
56309
|
case symbolTag:
|
|
56306
56310
|
if (symbolValueOf) {
|
|
56307
|
-
return symbolValueOf.call(
|
|
56311
|
+
return symbolValueOf.call(object2) == symbolValueOf.call(other);
|
|
56308
56312
|
}
|
|
56309
56313
|
}
|
|
56310
56314
|
return false;
|
|
56311
56315
|
}
|
|
56312
|
-
function equalObjects(
|
|
56313
|
-
var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(
|
|
56316
|
+
function equalObjects(object2, other, equalFunc, customizer, bitmask, stack) {
|
|
56317
|
+
var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object2), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
|
|
56314
56318
|
if (objLength != othLength && !isPartial) {
|
|
56315
56319
|
return false;
|
|
56316
56320
|
}
|
|
@@ -56321,19 +56325,19 @@ void main() {
|
|
|
56321
56325
|
return false;
|
|
56322
56326
|
}
|
|
56323
56327
|
}
|
|
56324
|
-
var stacked = stack.get(
|
|
56328
|
+
var stacked = stack.get(object2);
|
|
56325
56329
|
if (stacked && stack.get(other)) {
|
|
56326
56330
|
return stacked == other;
|
|
56327
56331
|
}
|
|
56328
56332
|
var result = true;
|
|
56329
|
-
stack.set(
|
|
56330
|
-
stack.set(other,
|
|
56333
|
+
stack.set(object2, other);
|
|
56334
|
+
stack.set(other, object2);
|
|
56331
56335
|
var skipCtor = isPartial;
|
|
56332
56336
|
while (++index < objLength) {
|
|
56333
56337
|
key = objProps[index];
|
|
56334
|
-
var objValue =
|
|
56338
|
+
var objValue = object2[key], othValue = other[key];
|
|
56335
56339
|
if (customizer) {
|
|
56336
|
-
var compared = isPartial ? customizer(othValue, objValue, key, other,
|
|
56340
|
+
var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack);
|
|
56337
56341
|
}
|
|
56338
56342
|
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
|
|
56339
56343
|
result = false;
|
|
@@ -56342,12 +56346,12 @@ void main() {
|
|
|
56342
56346
|
skipCtor || (skipCtor = key == "constructor");
|
|
56343
56347
|
}
|
|
56344
56348
|
if (result && !skipCtor) {
|
|
56345
|
-
var objCtor =
|
|
56346
|
-
if (objCtor != othCtor && ("constructor" in
|
|
56349
|
+
var objCtor = object2.constructor, othCtor = other.constructor;
|
|
56350
|
+
if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
56347
56351
|
result = false;
|
|
56348
56352
|
}
|
|
56349
56353
|
}
|
|
56350
|
-
stack["delete"](
|
|
56354
|
+
stack["delete"](object2);
|
|
56351
56355
|
stack["delete"](other);
|
|
56352
56356
|
return result;
|
|
56353
56357
|
}
|
|
@@ -56355,16 +56359,16 @@ void main() {
|
|
|
56355
56359
|
var data = map.__data__;
|
|
56356
56360
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
56357
56361
|
}
|
|
56358
|
-
function getMatchData(
|
|
56359
|
-
var result = keys(
|
|
56362
|
+
function getMatchData(object2) {
|
|
56363
|
+
var result = keys(object2), length = result.length;
|
|
56360
56364
|
while (length--) {
|
|
56361
|
-
var key = result[length], value =
|
|
56365
|
+
var key = result[length], value = object2[key];
|
|
56362
56366
|
result[length] = [key, value, isStrictComparable(value)];
|
|
56363
56367
|
}
|
|
56364
56368
|
return result;
|
|
56365
56369
|
}
|
|
56366
|
-
function getNative(
|
|
56367
|
-
var value = getValue(
|
|
56370
|
+
function getNative(object2, key) {
|
|
56371
|
+
var value = getValue(object2, key);
|
|
56368
56372
|
return baseIsNative(value) ? value : void 0;
|
|
56369
56373
|
}
|
|
56370
56374
|
var getTag = baseGetTag;
|
|
@@ -56388,27 +56392,27 @@ void main() {
|
|
|
56388
56392
|
return result;
|
|
56389
56393
|
};
|
|
56390
56394
|
}
|
|
56391
|
-
function hasPath(
|
|
56392
|
-
path = isKey(path,
|
|
56395
|
+
function hasPath(object2, path, hasFunc) {
|
|
56396
|
+
path = isKey(path, object2) ? [path] : castPath(path);
|
|
56393
56397
|
var result, index = -1, length = path.length;
|
|
56394
56398
|
while (++index < length) {
|
|
56395
56399
|
var key = toKey(path[index]);
|
|
56396
|
-
if (!(result =
|
|
56400
|
+
if (!(result = object2 != null && hasFunc(object2, key))) {
|
|
56397
56401
|
break;
|
|
56398
56402
|
}
|
|
56399
|
-
|
|
56403
|
+
object2 = object2[key];
|
|
56400
56404
|
}
|
|
56401
56405
|
if (result) {
|
|
56402
56406
|
return result;
|
|
56403
56407
|
}
|
|
56404
|
-
var length =
|
|
56405
|
-
return !!length && isLength(length) && isIndex(key, length) && (isArray2(
|
|
56408
|
+
var length = object2 ? object2.length : 0;
|
|
56409
|
+
return !!length && isLength(length) && isIndex(key, length) && (isArray2(object2) || isArguments(object2));
|
|
56406
56410
|
}
|
|
56407
56411
|
function isIndex(value, length) {
|
|
56408
56412
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
56409
56413
|
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
56410
56414
|
}
|
|
56411
|
-
function isKey(value,
|
|
56415
|
+
function isKey(value, object2) {
|
|
56412
56416
|
if (isArray2(value)) {
|
|
56413
56417
|
return false;
|
|
56414
56418
|
}
|
|
@@ -56416,7 +56420,7 @@ void main() {
|
|
|
56416
56420
|
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol2(value)) {
|
|
56417
56421
|
return true;
|
|
56418
56422
|
}
|
|
56419
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
56423
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value in Object(object2);
|
|
56420
56424
|
}
|
|
56421
56425
|
function isKeyable(value) {
|
|
56422
56426
|
var type = typeof value;
|
|
@@ -56433,11 +56437,11 @@ void main() {
|
|
|
56433
56437
|
return value === value && !isObject2(value);
|
|
56434
56438
|
}
|
|
56435
56439
|
function matchesStrictComparable(key, srcValue) {
|
|
56436
|
-
return function(
|
|
56437
|
-
if (
|
|
56440
|
+
return function(object2) {
|
|
56441
|
+
if (object2 == null) {
|
|
56438
56442
|
return false;
|
|
56439
56443
|
}
|
|
56440
|
-
return
|
|
56444
|
+
return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2));
|
|
56441
56445
|
};
|
|
56442
56446
|
}
|
|
56443
56447
|
var stringToPath = memoize(function(string) {
|
|
@@ -56526,15 +56530,15 @@ void main() {
|
|
|
56526
56530
|
function toString(value) {
|
|
56527
56531
|
return value == null ? "" : baseToString(value);
|
|
56528
56532
|
}
|
|
56529
|
-
function get(
|
|
56530
|
-
var result =
|
|
56533
|
+
function get(object2, path, defaultValue) {
|
|
56534
|
+
var result = object2 == null ? void 0 : baseGet(object2, path);
|
|
56531
56535
|
return result === void 0 ? defaultValue : result;
|
|
56532
56536
|
}
|
|
56533
|
-
function hasIn(
|
|
56534
|
-
return
|
|
56537
|
+
function hasIn(object2, path) {
|
|
56538
|
+
return object2 != null && hasPath(object2, path, baseHasIn);
|
|
56535
56539
|
}
|
|
56536
|
-
function keys(
|
|
56537
|
-
return isArrayLike(
|
|
56540
|
+
function keys(object2) {
|
|
56541
|
+
return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2);
|
|
56538
56542
|
}
|
|
56539
56543
|
function identity(value) {
|
|
56540
56544
|
return value;
|
|
@@ -62833,9 +62837,9 @@ void main() {
|
|
|
62833
62837
|
}
|
|
62834
62838
|
return text.slice(0, -separator.length);
|
|
62835
62839
|
}
|
|
62836
|
-
function addFormat(name2,
|
|
62837
|
-
if (typeof
|
|
62838
|
-
this._formats[name2] =
|
|
62840
|
+
function addFormat(name2, format3) {
|
|
62841
|
+
if (typeof format3 == "string") format3 = new RegExp(format3);
|
|
62842
|
+
this._formats[name2] = format3;
|
|
62839
62843
|
return this;
|
|
62840
62844
|
}
|
|
62841
62845
|
function addDefaultMetaSchema(self2) {
|
|
@@ -62858,8 +62862,8 @@ void main() {
|
|
|
62858
62862
|
}
|
|
62859
62863
|
function addInitialFormats(self2) {
|
|
62860
62864
|
for (var name2 in self2._opts.formats) {
|
|
62861
|
-
var
|
|
62862
|
-
self2.addFormat(name2,
|
|
62865
|
+
var format3 = self2._opts.formats[name2];
|
|
62866
|
+
self2.addFormat(name2, format3);
|
|
62863
62867
|
}
|
|
62864
62868
|
}
|
|
62865
62869
|
function addInitialKeywords(self2) {
|
|
@@ -63926,13 +63930,13 @@ void main() {
|
|
|
63926
63930
|
}
|
|
63927
63931
|
}
|
|
63928
63932
|
};
|
|
63929
|
-
var forEachObject = function forEachObject2(
|
|
63930
|
-
for (var k4 in
|
|
63931
|
-
if (hasOwnProperty.call(
|
|
63933
|
+
var forEachObject = function forEachObject2(object2, iterator, receiver) {
|
|
63934
|
+
for (var k4 in object2) {
|
|
63935
|
+
if (hasOwnProperty.call(object2, k4)) {
|
|
63932
63936
|
if (receiver == null) {
|
|
63933
|
-
iterator(
|
|
63937
|
+
iterator(object2[k4], k4, object2);
|
|
63934
63938
|
} else {
|
|
63935
|
-
iterator.call(receiver,
|
|
63939
|
+
iterator.call(receiver, object2[k4], k4, object2);
|
|
63936
63940
|
}
|
|
63937
63941
|
}
|
|
63938
63942
|
}
|
|
@@ -65785,36 +65789,36 @@ void main() {
|
|
|
65785
65789
|
return false;
|
|
65786
65790
|
}
|
|
65787
65791
|
};
|
|
65788
|
-
keysShim = function keys(
|
|
65789
|
-
var isObject2 =
|
|
65790
|
-
var isFunction2 = toStr.call(
|
|
65791
|
-
var isArguments = isArgs(
|
|
65792
|
-
var isString2 = isObject2 && toStr.call(
|
|
65792
|
+
keysShim = function keys(object2) {
|
|
65793
|
+
var isObject2 = object2 !== null && typeof object2 === "object";
|
|
65794
|
+
var isFunction2 = toStr.call(object2) === "[object Function]";
|
|
65795
|
+
var isArguments = isArgs(object2);
|
|
65796
|
+
var isString2 = isObject2 && toStr.call(object2) === "[object String]";
|
|
65793
65797
|
var theKeys = [];
|
|
65794
65798
|
if (!isObject2 && !isFunction2 && !isArguments) {
|
|
65795
65799
|
throw new TypeError("Object.keys called on a non-object");
|
|
65796
65800
|
}
|
|
65797
65801
|
var skipProto = hasProtoEnumBug && isFunction2;
|
|
65798
|
-
if (isString2 &&
|
|
65799
|
-
for (var i4 = 0; i4 <
|
|
65802
|
+
if (isString2 && object2.length > 0 && !has.call(object2, 0)) {
|
|
65803
|
+
for (var i4 = 0; i4 < object2.length; ++i4) {
|
|
65800
65804
|
theKeys.push(String(i4));
|
|
65801
65805
|
}
|
|
65802
65806
|
}
|
|
65803
|
-
if (isArguments &&
|
|
65804
|
-
for (var j4 = 0; j4 <
|
|
65807
|
+
if (isArguments && object2.length > 0) {
|
|
65808
|
+
for (var j4 = 0; j4 < object2.length; ++j4) {
|
|
65805
65809
|
theKeys.push(String(j4));
|
|
65806
65810
|
}
|
|
65807
65811
|
} else {
|
|
65808
|
-
for (var name2 in
|
|
65809
|
-
if (!(skipProto && name2 === "prototype") && has.call(
|
|
65812
|
+
for (var name2 in object2) {
|
|
65813
|
+
if (!(skipProto && name2 === "prototype") && has.call(object2, name2)) {
|
|
65810
65814
|
theKeys.push(String(name2));
|
|
65811
65815
|
}
|
|
65812
65816
|
}
|
|
65813
65817
|
}
|
|
65814
65818
|
if (hasDontEnumBug) {
|
|
65815
|
-
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(
|
|
65819
|
+
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object2);
|
|
65816
65820
|
for (var k4 = 0; k4 < dontEnums.length; ++k4) {
|
|
65817
|
-
if (!(skipConstructor && dontEnums[k4] === "constructor") && has.call(
|
|
65821
|
+
if (!(skipConstructor && dontEnums[k4] === "constructor") && has.call(object2, dontEnums[k4])) {
|
|
65818
65822
|
theKeys.push(dontEnums[k4]);
|
|
65819
65823
|
}
|
|
65820
65824
|
}
|
|
@@ -65842,11 +65846,11 @@ void main() {
|
|
|
65842
65846
|
return args && args.length === arguments.length;
|
|
65843
65847
|
}(1, 2);
|
|
65844
65848
|
if (!keysWorksWithArguments) {
|
|
65845
|
-
Object.keys = function keys(
|
|
65846
|
-
if (isArgs(
|
|
65847
|
-
return originalKeys(slice.call(
|
|
65849
|
+
Object.keys = function keys(object2) {
|
|
65850
|
+
if (isArgs(object2)) {
|
|
65851
|
+
return originalKeys(slice.call(object2));
|
|
65848
65852
|
}
|
|
65849
|
-
return originalKeys(
|
|
65853
|
+
return originalKeys(object2);
|
|
65850
65854
|
};
|
|
65851
65855
|
}
|
|
65852
65856
|
} else {
|
|
@@ -65990,10 +65994,10 @@ void main() {
|
|
|
65990
65994
|
return typeof fn === "function" && toStr.call(fn) === "[object Function]";
|
|
65991
65995
|
};
|
|
65992
65996
|
var supportsDescriptors = dew$33()();
|
|
65993
|
-
var defineProperty = function(
|
|
65994
|
-
if (name2 in
|
|
65997
|
+
var defineProperty = function(object2, name2, value, predicate) {
|
|
65998
|
+
if (name2 in object2) {
|
|
65995
65999
|
if (predicate === true) {
|
|
65996
|
-
if (
|
|
66000
|
+
if (object2[name2] === value) {
|
|
65997
66001
|
return;
|
|
65998
66002
|
}
|
|
65999
66003
|
} else if (!isFunction2(predicate) || !predicate()) {
|
|
@@ -66001,19 +66005,19 @@ void main() {
|
|
|
66001
66005
|
}
|
|
66002
66006
|
}
|
|
66003
66007
|
if (supportsDescriptors) {
|
|
66004
|
-
defineDataProperty(
|
|
66008
|
+
defineDataProperty(object2, name2, value, true);
|
|
66005
66009
|
} else {
|
|
66006
|
-
defineDataProperty(
|
|
66010
|
+
defineDataProperty(object2, name2, value);
|
|
66007
66011
|
}
|
|
66008
66012
|
};
|
|
66009
|
-
var defineProperties = function(
|
|
66013
|
+
var defineProperties = function(object2, map) {
|
|
66010
66014
|
var predicates = arguments.length > 2 ? arguments[2] : {};
|
|
66011
66015
|
var props = keys(map);
|
|
66012
66016
|
if (hasSymbols) {
|
|
66013
66017
|
props = concat2.call(props, Object.getOwnPropertySymbols(map));
|
|
66014
66018
|
}
|
|
66015
66019
|
for (var i4 = 0; i4 < props.length; i4 += 1) {
|
|
66016
|
-
defineProperty(
|
|
66020
|
+
defineProperty(object2, props[i4], map[props[i4]], predicates[props[i4]]);
|
|
66017
66021
|
}
|
|
66018
66022
|
};
|
|
66019
66023
|
defineProperties.supportsDescriptors = !!supportsDescriptors;
|
|
@@ -66200,7 +66204,7 @@ void main() {
|
|
|
66200
66204
|
function getOwnNonIndexProperties(value) {
|
|
66201
66205
|
return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));
|
|
66202
66206
|
}
|
|
66203
|
-
function
|
|
66207
|
+
function compare2(a4, b4) {
|
|
66204
66208
|
if (a4 === b4) {
|
|
66205
66209
|
return 0;
|
|
66206
66210
|
}
|
|
@@ -66245,10 +66249,10 @@ void main() {
|
|
|
66245
66249
|
if (a4.byteLength !== b4.byteLength) {
|
|
66246
66250
|
return false;
|
|
66247
66251
|
}
|
|
66248
|
-
return
|
|
66252
|
+
return compare2(new Uint8Array(a4.buffer, a4.byteOffset, a4.byteLength), new Uint8Array(b4.buffer, b4.byteOffset, b4.byteLength)) === 0;
|
|
66249
66253
|
}
|
|
66250
66254
|
function areEqualArrayBuffers(buf1, buf2) {
|
|
66251
|
-
return buf1.byteLength === buf2.byteLength &&
|
|
66255
|
+
return buf1.byteLength === buf2.byteLength && compare2(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;
|
|
66252
66256
|
}
|
|
66253
66257
|
function isEqualBoxedPrimitive(val1, val2) {
|
|
66254
66258
|
if (isNumberObject(val1)) {
|
|
@@ -69360,8 +69364,8 @@ void main() {
|
|
|
69360
69364
|
init_buffer2();
|
|
69361
69365
|
init_process2();
|
|
69362
69366
|
module2.exports = {
|
|
69363
|
-
format(
|
|
69364
|
-
return
|
|
69367
|
+
format(format3, ...args) {
|
|
69368
|
+
return format3.replace(/%([sdifj])/g, function(...[_unused, type]) {
|
|
69365
69369
|
const replacement = args.shift();
|
|
69366
69370
|
if (type === "f") {
|
|
69367
69371
|
return replacement.toFixed(6);
|
|
@@ -69413,7 +69417,7 @@ void main() {
|
|
|
69413
69417
|
init_dirname();
|
|
69414
69418
|
init_buffer2();
|
|
69415
69419
|
init_process2();
|
|
69416
|
-
var { format:
|
|
69420
|
+
var { format: format3, inspect: inspect2 } = require_inspect();
|
|
69417
69421
|
var { AggregateError: CustomAggregateError } = require_primordials();
|
|
69418
69422
|
var AggregateError2 = globalThis.AggregateError || CustomAggregateError;
|
|
69419
69423
|
var kIsNodeError = Symbol("kIsNodeError");
|
|
@@ -69463,7 +69467,7 @@ void main() {
|
|
|
69463
69467
|
if (args.length === 0) {
|
|
69464
69468
|
return msg;
|
|
69465
69469
|
}
|
|
69466
|
-
return
|
|
69470
|
+
return format3(msg, ...args);
|
|
69467
69471
|
}
|
|
69468
69472
|
function E4(code2, message, Base) {
|
|
69469
69473
|
if (!Base) {
|
|
@@ -69752,7 +69756,7 @@ void main() {
|
|
|
69752
69756
|
init_buffer2();
|
|
69753
69757
|
init_process2();
|
|
69754
69758
|
var bufferModule = (init_buffer(), __toCommonJS(buffer_exports));
|
|
69755
|
-
var { format:
|
|
69759
|
+
var { format: format3, inspect: inspect2 } = require_inspect();
|
|
69756
69760
|
var {
|
|
69757
69761
|
codes: { ERR_INVALID_ARG_TYPE }
|
|
69758
69762
|
} = require_errors();
|
|
@@ -69817,7 +69821,7 @@ void main() {
|
|
|
69817
69821
|
return function() {
|
|
69818
69822
|
};
|
|
69819
69823
|
},
|
|
69820
|
-
format:
|
|
69824
|
+
format: format3,
|
|
69821
69825
|
inspect: inspect2,
|
|
69822
69826
|
types: {
|
|
69823
69827
|
isAsyncFunction(fn) {
|
|
@@ -72877,10 +72881,10 @@ void main() {
|
|
|
72877
72881
|
}
|
|
72878
72882
|
ObjectDefineProperty(Writable, SymbolHasInstance, {
|
|
72879
72883
|
__proto__: null,
|
|
72880
|
-
value: function(
|
|
72881
|
-
if (FunctionPrototypeSymbolHasInstance(this,
|
|
72884
|
+
value: function(object2) {
|
|
72885
|
+
if (FunctionPrototypeSymbolHasInstance(this, object2)) return true;
|
|
72882
72886
|
if (this !== Writable) return false;
|
|
72883
|
-
return
|
|
72887
|
+
return object2 && object2._writableState instanceof WritableState;
|
|
72884
72888
|
}
|
|
72885
72889
|
});
|
|
72886
72890
|
Writable.prototype.pipe = function() {
|
|
@@ -75328,13 +75332,13 @@ void main() {
|
|
|
75328
75332
|
module2.exports = {
|
|
75329
75333
|
Read: {
|
|
75330
75334
|
switch: ["parametrizable", (compiler, struct) => {
|
|
75331
|
-
let
|
|
75335
|
+
let compare2 = struct.compareTo ? struct.compareTo : struct.compareToValue;
|
|
75332
75336
|
const args = [];
|
|
75333
|
-
if (
|
|
75337
|
+
if (compare2.startsWith("$")) args.push(compare2);
|
|
75334
75338
|
else if (struct.compareTo) {
|
|
75335
|
-
|
|
75339
|
+
compare2 = compiler.getField(compare2, true);
|
|
75336
75340
|
}
|
|
75337
|
-
let code2 = `switch (${
|
|
75341
|
+
let code2 = `switch (${compare2}) {
|
|
75338
75342
|
`;
|
|
75339
75343
|
for (const key in struct.fields) {
|
|
75340
75344
|
let val = key;
|
|
@@ -75358,13 +75362,13 @@ void main() {
|
|
|
75358
75362
|
},
|
|
75359
75363
|
Write: {
|
|
75360
75364
|
switch: ["parametrizable", (compiler, struct) => {
|
|
75361
|
-
let
|
|
75365
|
+
let compare2 = struct.compareTo ? struct.compareTo : struct.compareToValue;
|
|
75362
75366
|
const args = [];
|
|
75363
|
-
if (
|
|
75367
|
+
if (compare2.startsWith("$")) args.push(compare2);
|
|
75364
75368
|
else if (struct.compareTo) {
|
|
75365
|
-
|
|
75369
|
+
compare2 = compiler.getField(compare2, true);
|
|
75366
75370
|
}
|
|
75367
|
-
let code2 = `switch (${
|
|
75371
|
+
let code2 = `switch (${compare2}) {
|
|
75368
75372
|
`;
|
|
75369
75373
|
for (const key in struct.fields) {
|
|
75370
75374
|
let val = key;
|
|
@@ -75389,13 +75393,13 @@ void main() {
|
|
|
75389
75393
|
},
|
|
75390
75394
|
SizeOf: {
|
|
75391
75395
|
switch: ["parametrizable", (compiler, struct) => {
|
|
75392
|
-
let
|
|
75396
|
+
let compare2 = struct.compareTo ? struct.compareTo : struct.compareToValue;
|
|
75393
75397
|
const args = [];
|
|
75394
|
-
if (
|
|
75398
|
+
if (compare2.startsWith("$")) args.push(compare2);
|
|
75395
75399
|
else if (struct.compareTo) {
|
|
75396
|
-
|
|
75400
|
+
compare2 = compiler.getField(compare2, true);
|
|
75397
75401
|
}
|
|
75398
|
-
let code2 = `switch (${
|
|
75402
|
+
let code2 = `switch (${compare2}) {
|
|
75399
75403
|
`;
|
|
75400
75404
|
for (const key in struct.fields) {
|
|
75401
75405
|
let val = key;
|
|
@@ -76950,18 +76954,18 @@ return ${compiler2.callType("value", tagType)}
|
|
|
76950
76954
|
parsed.type = type;
|
|
76951
76955
|
return parsed;
|
|
76952
76956
|
}
|
|
76953
|
-
async function parse(data,
|
|
76957
|
+
async function parse(data, format3, callback) {
|
|
76954
76958
|
let fmt = null;
|
|
76955
|
-
if (typeof
|
|
76956
|
-
callback =
|
|
76957
|
-
} else if (
|
|
76959
|
+
if (typeof format3 === "function") {
|
|
76960
|
+
callback = format3;
|
|
76961
|
+
} else if (format3 === true || format3 === "little") {
|
|
76958
76962
|
fmt = "little";
|
|
76959
|
-
} else if (
|
|
76963
|
+
} else if (format3 === "big") {
|
|
76960
76964
|
fmt = "big";
|
|
76961
|
-
} else if (
|
|
76965
|
+
} else if (format3 === "littleVarint") {
|
|
76962
76966
|
fmt = "littleVarint";
|
|
76963
|
-
} else if (
|
|
76964
|
-
throw new Error("Unrecognized format: " +
|
|
76967
|
+
} else if (format3) {
|
|
76968
|
+
throw new Error("Unrecognized format: " + format3);
|
|
76965
76969
|
}
|
|
76966
76970
|
data.startOffset = data.startOffset || 0;
|
|
76967
76971
|
if (!fmt && !data.startOffset) {
|
|
@@ -77137,10 +77141,10 @@ return ${compiler2.callType("value", tagType)}
|
|
|
77137
77141
|
init_process2();
|
|
77138
77142
|
init_buffer();
|
|
77139
77143
|
NBTHelper = class {
|
|
77140
|
-
static async fromBuffer(data,
|
|
77144
|
+
static async fromBuffer(data, format3) {
|
|
77141
77145
|
const buffer2 = Buffer.from(data instanceof Uint8Array ? data : new Uint8Array(data));
|
|
77142
77146
|
const prismarineNbt = await Promise.resolve().then(() => __toESM(require_nbt2()));
|
|
77143
|
-
const { parsed, type, metadata } = await prismarineNbt.parse(buffer2,
|
|
77147
|
+
const { parsed, type, metadata } = await prismarineNbt.parse(buffer2, format3);
|
|
77144
77148
|
return Object.assign(parsed, {
|
|
77145
77149
|
format: type,
|
|
77146
77150
|
metadata,
|
|
@@ -84995,10 +84999,10 @@ return ${compiler2.callType("value", tagType)}
|
|
|
84995
84999
|
});
|
|
84996
85000
|
return passwordVerification;
|
|
84997
85001
|
}
|
|
84998
|
-
async function importKey(
|
|
85002
|
+
async function importKey(format3, password, algorithm, extractable, keyUsages) {
|
|
84999
85003
|
if (IMPORT_KEY_SUPPORTED) {
|
|
85000
85004
|
try {
|
|
85001
|
-
return await subtle.importKey(
|
|
85005
|
+
return await subtle.importKey(format3, password, algorithm, extractable, keyUsages);
|
|
85002
85006
|
} catch (_4) {
|
|
85003
85007
|
IMPORT_KEY_SUPPORTED = false;
|
|
85004
85008
|
return misc.importKey(password);
|
|
@@ -87004,6 +87008,168 @@ return ${compiler2.callType("value", tagType)}
|
|
|
87004
87008
|
}
|
|
87005
87009
|
});
|
|
87006
87010
|
|
|
87011
|
+
// src/assets/source/archive/PackMetadata.ts
|
|
87012
|
+
function object(value, field) {
|
|
87013
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
87014
|
+
throw new Error(`Invalid ${field}: expected an object`);
|
|
87015
|
+
}
|
|
87016
|
+
return value;
|
|
87017
|
+
}
|
|
87018
|
+
function integer(value, field) {
|
|
87019
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {
|
|
87020
|
+
throw new Error(`Invalid ${field}: expected a nonnegative integer`);
|
|
87021
|
+
}
|
|
87022
|
+
return value;
|
|
87023
|
+
}
|
|
87024
|
+
function format2(value, field, upper = false) {
|
|
87025
|
+
const parts = Array.isArray(value) ? value : [value];
|
|
87026
|
+
if (parts.length < 1 || parts.length > 2) {
|
|
87027
|
+
throw new Error(`Invalid ${field}: expected a major version or [major, minor]`);
|
|
87028
|
+
}
|
|
87029
|
+
return [integer(parts[0], field), parts.length === 2 ? integer(parts[1], field) : upper ? Infinity : 0];
|
|
87030
|
+
}
|
|
87031
|
+
function compare(a4, b4) {
|
|
87032
|
+
return a4[0] === b4[0] ? a4[1] - b4[1] : a4[0] - b4[0];
|
|
87033
|
+
}
|
|
87034
|
+
function overlay(value, field) {
|
|
87035
|
+
const entry = object(value, field);
|
|
87036
|
+
const directory = entry.directory;
|
|
87037
|
+
if (typeof directory !== "string" || !directory || /[^-_a-zA-Z0-9.]/.test(directory) || directory === "." || directory === "..") {
|
|
87038
|
+
throw new Error(`Invalid ${field}.directory: expected a directory name without path separators`);
|
|
87039
|
+
}
|
|
87040
|
+
let min, max2;
|
|
87041
|
+
if ("min_format" in entry || "max_format" in entry) {
|
|
87042
|
+
min = format2(entry.min_format, `${field}.min_format`);
|
|
87043
|
+
max2 = format2(entry.max_format, `${field}.max_format`, true);
|
|
87044
|
+
} else {
|
|
87045
|
+
const range = entry.formats;
|
|
87046
|
+
let lower, upper;
|
|
87047
|
+
if (typeof range === "number") {
|
|
87048
|
+
lower = upper = range;
|
|
87049
|
+
} else if (Array.isArray(range)) {
|
|
87050
|
+
if (range.length !== 2) throw new Error(`Invalid ${field}.formats: expected [min, max]`);
|
|
87051
|
+
[lower, upper] = range;
|
|
87052
|
+
} else {
|
|
87053
|
+
const bounds = object(range, `${field}.formats`);
|
|
87054
|
+
lower = bounds.min_inclusive;
|
|
87055
|
+
upper = bounds.max_inclusive;
|
|
87056
|
+
}
|
|
87057
|
+
min = [integer(lower, `${field}.formats.min_inclusive`), 0];
|
|
87058
|
+
max2 = [integer(upper, `${field}.formats.max_inclusive`), Infinity];
|
|
87059
|
+
}
|
|
87060
|
+
if (compare(min, max2) > 0) throw new Error(`Invalid ${field}: minimum format exceeds maximum format`);
|
|
87061
|
+
return { directory, min, max: max2 };
|
|
87062
|
+
}
|
|
87063
|
+
function pattern(value, field) {
|
|
87064
|
+
if (value === void 0) return void 0;
|
|
87065
|
+
if (typeof value !== "string") throw new Error(`Invalid ${field}: expected a regular expression string`);
|
|
87066
|
+
try {
|
|
87067
|
+
return new RegExp(value);
|
|
87068
|
+
} catch (cause) {
|
|
87069
|
+
throw new Error(`Invalid ${field}: ${String(cause)}`);
|
|
87070
|
+
}
|
|
87071
|
+
}
|
|
87072
|
+
var PackMetadata;
|
|
87073
|
+
var init_PackMetadata = __esm({
|
|
87074
|
+
"src/assets/source/archive/PackMetadata.ts"() {
|
|
87075
|
+
init_dirname();
|
|
87076
|
+
init_buffer2();
|
|
87077
|
+
init_process2();
|
|
87078
|
+
PackMetadata = class _PackMetadata {
|
|
87079
|
+
constructor(overlays, filters) {
|
|
87080
|
+
this.overlays = overlays;
|
|
87081
|
+
this.filters = filters;
|
|
87082
|
+
this.hasOverlays = overlays.length > 0;
|
|
87083
|
+
}
|
|
87084
|
+
static parse(value) {
|
|
87085
|
+
const metadata = object(value, "pack.mcmeta");
|
|
87086
|
+
let overlays = [];
|
|
87087
|
+
if ("overlays" in metadata) {
|
|
87088
|
+
const entries = object(metadata.overlays, "overlays").entries;
|
|
87089
|
+
if (!Array.isArray(entries)) throw new Error("Invalid overlays.entries: expected an array");
|
|
87090
|
+
overlays = entries.map((entry, index) => overlay(entry, `overlays.entries[${index}]`));
|
|
87091
|
+
}
|
|
87092
|
+
let filters = [];
|
|
87093
|
+
if ("filter" in metadata) {
|
|
87094
|
+
const entries = object(metadata.filter, "filter").block;
|
|
87095
|
+
if (!Array.isArray(entries)) throw new Error("Invalid filter.block: expected an array");
|
|
87096
|
+
filters = entries.map((value2, index) => {
|
|
87097
|
+
const field = `filter.block[${index}]`;
|
|
87098
|
+
const entry = object(value2, field);
|
|
87099
|
+
return { namespace: pattern(entry.namespace, `${field}.namespace`), path: pattern(entry.path, `${field}.path`) };
|
|
87100
|
+
});
|
|
87101
|
+
}
|
|
87102
|
+
return new _PackMetadata(overlays, filters);
|
|
87103
|
+
}
|
|
87104
|
+
/** Returns applicable directories in lookup order, with the last declared overlay first. */
|
|
87105
|
+
overlayDirectories(target) {
|
|
87106
|
+
const selected = format2(target, "target format");
|
|
87107
|
+
return this.overlays.filter((entry) => compare(selected, entry.min) >= 0 && compare(selected, entry.max) <= 0).map((entry) => entry.directory).reverse();
|
|
87108
|
+
}
|
|
87109
|
+
blocks(namespace, path) {
|
|
87110
|
+
return this.filters.some((entry) => entry.namespace?.test(namespace) ?? true) && this.filters.some((entry) => entry.path?.test(path) ?? true);
|
|
87111
|
+
}
|
|
87112
|
+
};
|
|
87113
|
+
}
|
|
87114
|
+
});
|
|
87115
|
+
|
|
87116
|
+
// src/assets/source/archive/PackFormats.ts
|
|
87117
|
+
var PackFormats;
|
|
87118
|
+
var init_PackFormats = __esm({
|
|
87119
|
+
"src/assets/source/archive/PackFormats.ts"() {
|
|
87120
|
+
init_dirname();
|
|
87121
|
+
init_buffer2();
|
|
87122
|
+
init_process2();
|
|
87123
|
+
init_Requests();
|
|
87124
|
+
PackFormats = class {
|
|
87125
|
+
/** Resolves pack formats from Mojang's client metadata hosted on assets.mcasset.cloud. */
|
|
87126
|
+
static async get(version2, type) {
|
|
87127
|
+
let pending = this.versions.get(version2);
|
|
87128
|
+
if (!pending || pending.expires <= Date.now()) {
|
|
87129
|
+
pending = {
|
|
87130
|
+
formats: this.load(version2),
|
|
87131
|
+
expires: ["latest", "release", "snapshot"].includes(version2) ? Date.now() + 3e5 : Infinity
|
|
87132
|
+
};
|
|
87133
|
+
this.versions.set(version2, pending);
|
|
87134
|
+
}
|
|
87135
|
+
try {
|
|
87136
|
+
return (await pending.formats)[type];
|
|
87137
|
+
} catch (cause) {
|
|
87138
|
+
if (this.versions.get(version2) === pending) this.versions.delete(version2);
|
|
87139
|
+
const option = type === "assets" ? "resourcePackFormat" : "dataPackFormat";
|
|
87140
|
+
const reason = cause instanceof Error ? cause.message : String(cause);
|
|
87141
|
+
throw new Error(`Could not resolve the pack format for Minecraft ${version2}. Set ArchiveAssetSource ${option} explicitly. ${reason}`);
|
|
87142
|
+
}
|
|
87143
|
+
}
|
|
87144
|
+
static async load(version2) {
|
|
87145
|
+
const response = await Requests.genericRequest({
|
|
87146
|
+
url: `https://assets.mcasset.cloud/${encodeURIComponent(version2)}/game-version.json`,
|
|
87147
|
+
responseType: "json"
|
|
87148
|
+
});
|
|
87149
|
+
const data = response.data;
|
|
87150
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
87151
|
+
throw new Error("Expected version metadata to be an object");
|
|
87152
|
+
}
|
|
87153
|
+
const packs = data.pack_version;
|
|
87154
|
+
if (typeof packs !== "number" && (!packs || typeof packs !== "object" || Array.isArray(packs))) {
|
|
87155
|
+
throw new Error("Expected pack_version to be a number or an object");
|
|
87156
|
+
}
|
|
87157
|
+
const format3 = (type) => {
|
|
87158
|
+
const modern = typeof packs === "object" && ["resource_major", "resource_minor", "data_major", "data_minor"].some((key) => key in packs);
|
|
87159
|
+
const major = typeof packs === "number" ? packs : packs[modern ? `${type}_major` : type];
|
|
87160
|
+
const minor = modern ? packs[`${type}_minor`] : 0;
|
|
87161
|
+
if (typeof major !== "number" || !Number.isSafeInteger(major) || major < 0 || typeof minor !== "number" || !Number.isSafeInteger(minor) || minor < 0) {
|
|
87162
|
+
throw new Error(`Invalid ${type} pack format in version metadata`);
|
|
87163
|
+
}
|
|
87164
|
+
return Object.freeze([major, minor]);
|
|
87165
|
+
};
|
|
87166
|
+
return { assets: format3("resource"), data: format3("data") };
|
|
87167
|
+
}
|
|
87168
|
+
};
|
|
87169
|
+
PackFormats.versions = /* @__PURE__ */ new Map();
|
|
87170
|
+
}
|
|
87171
|
+
});
|
|
87172
|
+
|
|
87007
87173
|
// src/assets/source/archive/ArchiveAssetSource.ts
|
|
87008
87174
|
var ArchiveAssetSource;
|
|
87009
87175
|
var init_ArchiveAssetSource = __esm({
|
|
@@ -87015,35 +87181,77 @@ return ${compiler2.callType("value", tagType)}
|
|
|
87015
87181
|
init_request();
|
|
87016
87182
|
init_HostedAssetSource();
|
|
87017
87183
|
init_BrowserArchiveProxy();
|
|
87184
|
+
init_AssetLoader();
|
|
87185
|
+
init_PackMetadata();
|
|
87186
|
+
init_PackFormats();
|
|
87018
87187
|
ArchiveAssetSource = class _ArchiveAssetSource extends AssetSource {
|
|
87019
|
-
constructor(archiveProxy) {
|
|
87188
|
+
constructor(archiveProxy, options = {}) {
|
|
87020
87189
|
super();
|
|
87021
|
-
console.log(archiveProxy);
|
|
87022
87190
|
this._archiveProxy = archiveProxy;
|
|
87191
|
+
const copyFormat = (format3) => typeof format3 === "object" ? [format3[0], format3[1]] : format3;
|
|
87192
|
+
this.options = {
|
|
87193
|
+
resourcePackFormat: copyFormat(options.resourcePackFormat),
|
|
87194
|
+
dataPackFormat: copyFormat(options.dataPackFormat)
|
|
87195
|
+
};
|
|
87023
87196
|
}
|
|
87024
|
-
static blob(blob) {
|
|
87025
|
-
return new _ArchiveAssetSource(new BrowserArchiveProxy(blob));
|
|
87197
|
+
static blob(blob, options) {
|
|
87198
|
+
return new _ArchiveAssetSource(new BrowserArchiveProxy(blob), options);
|
|
87026
87199
|
}
|
|
87027
87200
|
get cacheId() {
|
|
87028
87201
|
const id = this._archiveProxy.id;
|
|
87029
|
-
|
|
87202
|
+
const formats = [this.options.resourcePackFormat ?? AssetLoader.version, this.options.dataPackFormat ?? AssetLoader.version];
|
|
87203
|
+
return id === void 0 ? void 0 : `archive-metadata:1:${id}:${JSON.stringify(formats)}`;
|
|
87030
87204
|
}
|
|
87031
87205
|
async getEntries() {
|
|
87032
|
-
return this._archiveProxy.getEntries()
|
|
87206
|
+
return this.entries ?? (this.entries = this._archiveProxy.getEntries().catch((error2) => {
|
|
87207
|
+
this.entries = void 0;
|
|
87208
|
+
throw error2;
|
|
87209
|
+
}));
|
|
87033
87210
|
}
|
|
87034
87211
|
async getEntry(path) {
|
|
87035
87212
|
const entries = await this.getEntries();
|
|
87036
87213
|
return entries.find((e6) => e6.filename === path);
|
|
87037
87214
|
}
|
|
87215
|
+
async getMetadata(key) {
|
|
87216
|
+
try {
|
|
87217
|
+
return await (this.metadata ?? (this.metadata = this.getEntry("pack.mcmeta").then(async (entry) => PackMetadata.parse(entry ? JSON.parse(await (await entry.getData()).text()) : {})).catch((error2) => {
|
|
87218
|
+
this.metadata = void 0;
|
|
87219
|
+
throw error2;
|
|
87220
|
+
})));
|
|
87221
|
+
} catch (cause) {
|
|
87222
|
+
throw new AssetLoadError(this, key, "pack.mcmeta", cause);
|
|
87223
|
+
}
|
|
87224
|
+
}
|
|
87225
|
+
async blocks(key) {
|
|
87226
|
+
if (key.rootType !== "assets" && key.rootType !== "data") return false;
|
|
87227
|
+
const metadata = await this.getMetadata(key);
|
|
87228
|
+
const path = `${key.assetType !== void 0 ? key.assetType + "/" : ""}${key.getFullPath()}${key.extension}`;
|
|
87229
|
+
return metadata.blocks(key.namespace, path);
|
|
87230
|
+
}
|
|
87038
87231
|
async get(key, parser) {
|
|
87039
87232
|
const responseParser = HostedAssetSource.PARSER_MAP.get(parser);
|
|
87040
87233
|
return this.load(key, responseParser);
|
|
87041
87234
|
}
|
|
87042
87235
|
async load(key, parser) {
|
|
87043
87236
|
const path = `${this.assetBasePath(key)}${key.type !== void 0 ? key.type + "/" : ""}${key.path}${key.extension}`;
|
|
87237
|
+
const version2 = AssetLoader.version;
|
|
87238
|
+
let selectedPath = path;
|
|
87044
87239
|
let url;
|
|
87045
87240
|
try {
|
|
87046
|
-
|
|
87241
|
+
let directories = [];
|
|
87242
|
+
if (key.rootType === "assets" || key.rootType === "data") {
|
|
87243
|
+
const metadata = await this.getMetadata(key);
|
|
87244
|
+
if (metadata.hasOverlays) {
|
|
87245
|
+
const format3 = (key.rootType === "assets" ? this.options.resourcePackFormat : this.options.dataPackFormat) ?? await PackFormats.get(version2, key.rootType);
|
|
87246
|
+
directories = metadata.overlayDirectories(format3);
|
|
87247
|
+
}
|
|
87248
|
+
}
|
|
87249
|
+
let entry;
|
|
87250
|
+
for (const directory of [...directories, ""]) {
|
|
87251
|
+
selectedPath = directory ? `${directory}/${path}` : path;
|
|
87252
|
+
entry = await this.getEntry(selectedPath);
|
|
87253
|
+
if (entry) break;
|
|
87254
|
+
}
|
|
87047
87255
|
if (!entry) {
|
|
87048
87256
|
return void 0;
|
|
87049
87257
|
}
|
|
@@ -87056,7 +87264,8 @@ return ${compiler2.callType("value", tagType)}
|
|
|
87056
87264
|
}
|
|
87057
87265
|
return await parser.parse(response);
|
|
87058
87266
|
} catch (cause) {
|
|
87059
|
-
|
|
87267
|
+
if (cause instanceof AssetLoadError) throw cause;
|
|
87268
|
+
throw new AssetLoadError(this, key, selectedPath, cause);
|
|
87060
87269
|
} finally {
|
|
87061
87270
|
if (url !== void 0) {
|
|
87062
87271
|
URL.revokeObjectURL(url);
|
|
@@ -87098,6 +87307,8 @@ return ${compiler2.callType("value", tagType)}
|
|
|
87098
87307
|
init_ArchiveEntry();
|
|
87099
87308
|
init_ArchiveProxy();
|
|
87100
87309
|
init_BrowserArchiveProxy();
|
|
87310
|
+
init_PackFormats();
|
|
87311
|
+
init_PackMetadata();
|
|
87101
87312
|
}
|
|
87102
87313
|
});
|
|
87103
87314
|
|
|
@@ -87186,13 +87397,14 @@ ${key}` : key;
|
|
|
87186
87397
|
return void 0;
|
|
87187
87398
|
}
|
|
87188
87399
|
static async getAll(key, parser) {
|
|
87189
|
-
|
|
87190
|
-
|
|
87191
|
-
|
|
87400
|
+
const sources = [...this._SOURCES];
|
|
87401
|
+
const results = [];
|
|
87402
|
+
for (const { source } of sources) {
|
|
87403
|
+
const asset = await source.get(key, parser);
|
|
87404
|
+
if (asset != void 0) results.push(asset);
|
|
87405
|
+
if (await source.blocks(key)) break;
|
|
87192
87406
|
}
|
|
87193
|
-
return
|
|
87194
|
-
return results.filter((r5) => r5 != void 0);
|
|
87195
|
-
});
|
|
87407
|
+
return results;
|
|
87196
87408
|
}
|
|
87197
87409
|
/** Returns the first defined result in source-priority order, without merging assets. */
|
|
87198
87410
|
static async get(key, parser) {
|
|
@@ -87213,13 +87425,17 @@ ${key}` : key;
|
|
|
87213
87425
|
/** Tries each path within a source before considering lower-priority sources. */
|
|
87214
87426
|
static async getFirst(keys, parser) {
|
|
87215
87427
|
const sources = [...this._SOURCES];
|
|
87428
|
+
let remaining = [...keys];
|
|
87216
87429
|
for (const source of sources) {
|
|
87217
|
-
for (const key of
|
|
87430
|
+
for (const key of remaining) {
|
|
87218
87431
|
const result = await source.source.get(key, parser);
|
|
87219
87432
|
if (result !== void 0) {
|
|
87220
87433
|
return { key, asset: result };
|
|
87221
87434
|
}
|
|
87222
87435
|
}
|
|
87436
|
+
const blocked = await Promise.all(remaining.map((key) => source.source.blocks(key)));
|
|
87437
|
+
remaining = remaining.filter((_4, index) => !blocked[index]);
|
|
87438
|
+
if (!remaining.length) break;
|
|
87223
87439
|
}
|
|
87224
87440
|
return void 0;
|
|
87225
87441
|
}
|
|
@@ -88359,27 +88575,27 @@ ${key}` : key;
|
|
|
88359
88575
|
for (const layer of layers) {
|
|
88360
88576
|
const objects = [];
|
|
88361
88577
|
if (poses) {
|
|
88362
|
-
layer.traverse((
|
|
88363
|
-
if (poses.has(
|
|
88578
|
+
layer.traverse((object2) => {
|
|
88579
|
+
if (poses.has(object2)) objects.push(object2);
|
|
88364
88580
|
});
|
|
88365
88581
|
} else {
|
|
88366
88582
|
for (const bone of Object.keys(animation.bones)) {
|
|
88367
|
-
const
|
|
88368
|
-
if (
|
|
88583
|
+
const object2 = layer.getObjectByName(`group:${bone}`);
|
|
88584
|
+
if (object2) objects.push(object2);
|
|
88369
88585
|
}
|
|
88370
88586
|
}
|
|
88371
|
-
for (const
|
|
88372
|
-
const bone =
|
|
88373
|
-
const pose = poses?.get(
|
|
88587
|
+
for (const object2 of objects) {
|
|
88588
|
+
const bone = object2.name.slice("group:".length);
|
|
88589
|
+
const pose = poses?.get(object2);
|
|
88374
88590
|
this.parts.push({
|
|
88375
88591
|
bone,
|
|
88376
|
-
object,
|
|
88377
|
-
position:
|
|
88378
|
-
rotation:
|
|
88379
|
-
scale:
|
|
88380
|
-
basePosition: pose ? new Vector3(...pose.offset) :
|
|
88381
|
-
baseRotation: pose ? new Euler(...pose.rotation, "ZYX") :
|
|
88382
|
-
baseScale: pose ? new Vector3(...pose.scale ?? [1, 1, 1]) :
|
|
88592
|
+
object: object2,
|
|
88593
|
+
position: object2.position.clone(),
|
|
88594
|
+
rotation: object2.rotation.clone(),
|
|
88595
|
+
scale: object2.scale.clone(),
|
|
88596
|
+
basePosition: pose ? new Vector3(...pose.offset) : object2.position.clone(),
|
|
88597
|
+
baseRotation: pose ? new Euler(...pose.rotation, "ZYX") : object2.rotation.clone(),
|
|
88598
|
+
baseScale: pose ? new Vector3(...pose.scale ?? [1, 1, 1]) : object2.scale.clone()
|
|
88383
88599
|
});
|
|
88384
88600
|
}
|
|
88385
88601
|
}
|
|
@@ -88904,15 +89120,15 @@ ${key}` : key;
|
|
|
88904
89120
|
}
|
|
88905
89121
|
}
|
|
88906
89122
|
//</editor-fold>
|
|
88907
|
-
toggleObjectVisibility(
|
|
88908
|
-
if (
|
|
89123
|
+
toggleObjectVisibility(object2, visible) {
|
|
89124
|
+
if (object2) {
|
|
88909
89125
|
if (typeof visible !== "undefined") {
|
|
88910
|
-
|
|
89126
|
+
object2.visible = visible;
|
|
88911
89127
|
} else {
|
|
88912
|
-
|
|
89128
|
+
object2.visible = !object2.visible;
|
|
88913
89129
|
}
|
|
88914
89130
|
this.notifyDirty();
|
|
88915
|
-
return
|
|
89131
|
+
return object2.visible;
|
|
88916
89132
|
}
|
|
88917
89133
|
this.notifyDirty();
|
|
88918
89134
|
return false;
|
|
@@ -89210,8 +89426,8 @@ ${key}` : key;
|
|
|
89210
89426
|
this.scrollMaterials.push({ material: mat, offset: mat.map.offset, speed: scroll });
|
|
89211
89427
|
}
|
|
89212
89428
|
}
|
|
89213
|
-
this.getLayerGroup(name2)?.traverse((
|
|
89214
|
-
if (isMesh(
|
|
89429
|
+
this.getLayerGroup(name2)?.traverse((object2) => {
|
|
89430
|
+
if (isMesh(object2)) object2.material = mat;
|
|
89215
89431
|
});
|
|
89216
89432
|
}));
|
|
89217
89433
|
if (!this.children.length) {
|
|
@@ -89541,8 +89757,8 @@ ${key}` : key;
|
|
|
89541
89757
|
return geometry;
|
|
89542
89758
|
}
|
|
89543
89759
|
}
|
|
89544
|
-
function computeMorphedAttributes(
|
|
89545
|
-
if (
|
|
89760
|
+
function computeMorphedAttributes(object2) {
|
|
89761
|
+
if (object2.geometry.isBufferGeometry !== true) {
|
|
89546
89762
|
console.error("THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry.");
|
|
89547
89763
|
return null;
|
|
89548
89764
|
}
|
|
@@ -89555,11 +89771,11 @@ ${key}` : key;
|
|
|
89555
89771
|
const _morphA2 = new Vector3();
|
|
89556
89772
|
const _morphB = new Vector3();
|
|
89557
89773
|
const _morphC = new Vector3();
|
|
89558
|
-
function _calculateMorphedAttributeData(
|
|
89774
|
+
function _calculateMorphedAttributeData(object3, material2, attribute, morphAttribute, morphTargetsRelative2, a5, b5, c5, modifiedAttributeArray) {
|
|
89559
89775
|
_vA2.fromBufferAttribute(attribute, a5);
|
|
89560
89776
|
_vB2.fromBufferAttribute(attribute, b5);
|
|
89561
89777
|
_vC2.fromBufferAttribute(attribute, c5);
|
|
89562
|
-
const morphInfluences =
|
|
89778
|
+
const morphInfluences = object3.morphTargetInfluences;
|
|
89563
89779
|
if (material2.morphTargets && morphAttribute && morphInfluences) {
|
|
89564
89780
|
_morphA2.set(0, 0, 0);
|
|
89565
89781
|
_morphB.set(0, 0, 0);
|
|
@@ -89585,10 +89801,10 @@ ${key}` : key;
|
|
|
89585
89801
|
_vB2.add(_morphB);
|
|
89586
89802
|
_vC2.add(_morphC);
|
|
89587
89803
|
}
|
|
89588
|
-
if (
|
|
89589
|
-
|
|
89590
|
-
|
|
89591
|
-
|
|
89804
|
+
if (object3.isSkinnedMesh) {
|
|
89805
|
+
object3.boneTransform(a5, _vA2);
|
|
89806
|
+
object3.boneTransform(b5, _vB2);
|
|
89807
|
+
object3.boneTransform(c5, _vC2);
|
|
89592
89808
|
}
|
|
89593
89809
|
modifiedAttributeArray[a5 * 3 + 0] = _vA2.x;
|
|
89594
89810
|
modifiedAttributeArray[a5 * 3 + 1] = _vA2.y;
|
|
@@ -89600,8 +89816,8 @@ ${key}` : key;
|
|
|
89600
89816
|
modifiedAttributeArray[c5 * 3 + 1] = _vC2.y;
|
|
89601
89817
|
modifiedAttributeArray[c5 * 3 + 2] = _vC2.z;
|
|
89602
89818
|
}
|
|
89603
|
-
const geometry =
|
|
89604
|
-
const material =
|
|
89819
|
+
const geometry = object2.geometry;
|
|
89820
|
+
const material = object2.material;
|
|
89605
89821
|
let a4, b4, c4;
|
|
89606
89822
|
const index = geometry.index;
|
|
89607
89823
|
const positionAttribute = geometry.attributes.position;
|
|
@@ -89628,7 +89844,7 @@ ${key}` : key;
|
|
|
89628
89844
|
b4 = index.getX(j4 + 1);
|
|
89629
89845
|
c4 = index.getX(j4 + 2);
|
|
89630
89846
|
_calculateMorphedAttributeData(
|
|
89631
|
-
|
|
89847
|
+
object2,
|
|
89632
89848
|
groupMaterial,
|
|
89633
89849
|
positionAttribute,
|
|
89634
89850
|
morphPosition,
|
|
@@ -89639,7 +89855,7 @@ ${key}` : key;
|
|
|
89639
89855
|
modifiedPosition
|
|
89640
89856
|
);
|
|
89641
89857
|
_calculateMorphedAttributeData(
|
|
89642
|
-
|
|
89858
|
+
object2,
|
|
89643
89859
|
groupMaterial,
|
|
89644
89860
|
normalAttribute,
|
|
89645
89861
|
morphNormal,
|
|
@@ -89659,7 +89875,7 @@ ${key}` : key;
|
|
|
89659
89875
|
b4 = index.getX(i4 + 1);
|
|
89660
89876
|
c4 = index.getX(i4 + 2);
|
|
89661
89877
|
_calculateMorphedAttributeData(
|
|
89662
|
-
|
|
89878
|
+
object2,
|
|
89663
89879
|
material,
|
|
89664
89880
|
positionAttribute,
|
|
89665
89881
|
morphPosition,
|
|
@@ -89670,7 +89886,7 @@ ${key}` : key;
|
|
|
89670
89886
|
modifiedPosition
|
|
89671
89887
|
);
|
|
89672
89888
|
_calculateMorphedAttributeData(
|
|
89673
|
-
|
|
89889
|
+
object2,
|
|
89674
89890
|
material,
|
|
89675
89891
|
normalAttribute,
|
|
89676
89892
|
morphNormal,
|
|
@@ -89694,7 +89910,7 @@ ${key}` : key;
|
|
|
89694
89910
|
b4 = j4 + 1;
|
|
89695
89911
|
c4 = j4 + 2;
|
|
89696
89912
|
_calculateMorphedAttributeData(
|
|
89697
|
-
|
|
89913
|
+
object2,
|
|
89698
89914
|
groupMaterial,
|
|
89699
89915
|
positionAttribute,
|
|
89700
89916
|
morphPosition,
|
|
@@ -89705,7 +89921,7 @@ ${key}` : key;
|
|
|
89705
89921
|
modifiedPosition
|
|
89706
89922
|
);
|
|
89707
89923
|
_calculateMorphedAttributeData(
|
|
89708
|
-
|
|
89924
|
+
object2,
|
|
89709
89925
|
groupMaterial,
|
|
89710
89926
|
normalAttribute,
|
|
89711
89927
|
morphNormal,
|
|
@@ -89725,7 +89941,7 @@ ${key}` : key;
|
|
|
89725
89941
|
b4 = i4 + 1;
|
|
89726
89942
|
c4 = i4 + 2;
|
|
89727
89943
|
_calculateMorphedAttributeData(
|
|
89728
|
-
|
|
89944
|
+
object2,
|
|
89729
89945
|
material,
|
|
89730
89946
|
positionAttribute,
|
|
89731
89947
|
morphPosition,
|
|
@@ -89736,7 +89952,7 @@ ${key}` : key;
|
|
|
89736
89952
|
modifiedPosition
|
|
89737
89953
|
);
|
|
89738
89954
|
_calculateMorphedAttributeData(
|
|
89739
|
-
|
|
89955
|
+
object2,
|
|
89740
89956
|
material,
|
|
89741
89957
|
normalAttribute,
|
|
89742
89958
|
morphNormal,
|
|
@@ -90067,13 +90283,13 @@ ${shader.fragmentShader}`.replace(
|
|
|
90067
90283
|
transform.multiply(new Matrix4().makeTranslation(-8, -8, -8));
|
|
90068
90284
|
try {
|
|
90069
90285
|
for (const part of parts) {
|
|
90070
|
-
const
|
|
90071
|
-
|
|
90072
|
-
|
|
90073
|
-
|
|
90074
|
-
this.add(
|
|
90075
|
-
await
|
|
90076
|
-
|
|
90286
|
+
const object2 = new EntityObject(part.model, { flip: false, wireframe: this.options.wireframe });
|
|
90287
|
+
object2.matrix.copy(transform).multiply(part.transform);
|
|
90288
|
+
object2.matrixWorldNeedsUpdate = true;
|
|
90289
|
+
object2.matrixAutoUpdate = false;
|
|
90290
|
+
this.add(object2);
|
|
90291
|
+
await object2.init();
|
|
90292
|
+
object2.iterateAllMeshes((mesh) => {
|
|
90077
90293
|
const source = mesh.material;
|
|
90078
90294
|
let material = this.specialMaterials.get(source);
|
|
90079
90295
|
if (!material) {
|
|
@@ -90084,7 +90300,7 @@ ${shader.fragmentShader}`.replace(
|
|
|
90084
90300
|
mesh.material = material;
|
|
90085
90301
|
});
|
|
90086
90302
|
for (const [name2, rotation] of Object.entries(part.rotations)) {
|
|
90087
|
-
|
|
90303
|
+
object2.getGroupByName(name2)?.rotation.set(...rotation, "ZYX");
|
|
90088
90304
|
}
|
|
90089
90305
|
}
|
|
90090
90306
|
} catch (error2) {
|
|
@@ -93379,6 +93595,8 @@ ${shader.fragmentShader}`.replace(
|
|
|
93379
93595
|
Models: () => Models,
|
|
93380
93596
|
NBTHelper: () => NBTHelper,
|
|
93381
93597
|
OrbitControls: () => OrbitControls,
|
|
93598
|
+
PackFormats: () => PackFormats,
|
|
93599
|
+
PackMetadata: () => PackMetadata,
|
|
93382
93600
|
PersistentCache: () => PersistentCache,
|
|
93383
93601
|
Renderer: () => Renderer,
|
|
93384
93602
|
RequestError: () => RequestError,
|
|
@@ -94027,7 +94245,7 @@ ${shader.fragmentShader}`.replace(
|
|
|
94027
94245
|
* @param {Object3D} object - The 3D object to export.
|
|
94028
94246
|
* @return {string} The exported OBJ.
|
|
94029
94247
|
*/
|
|
94030
|
-
parse(
|
|
94248
|
+
parse(object2) {
|
|
94031
94249
|
let output = "";
|
|
94032
94250
|
let indexVertex = 0;
|
|
94033
94251
|
let indexVertexUvs = 0;
|
|
@@ -94146,7 +94364,7 @@ ${shader.fragmentShader}`.replace(
|
|
|
94146
94364
|
}
|
|
94147
94365
|
indexVertex += nbVertex;
|
|
94148
94366
|
}
|
|
94149
|
-
|
|
94367
|
+
object2.traverse(function(child) {
|
|
94150
94368
|
if (child.isMesh === true) {
|
|
94151
94369
|
parseMesh(child);
|
|
94152
94370
|
}
|
|
@@ -94177,9 +94395,9 @@ ${shader.fragmentShader}`.replace(
|
|
|
94177
94395
|
* @param {PLYExporter~Options} options - The export options.
|
|
94178
94396
|
* @return {?(string|ArrayBuffer)} The exported PLY.
|
|
94179
94397
|
*/
|
|
94180
|
-
parse(
|
|
94398
|
+
parse(object2, onDone, options = {}) {
|
|
94181
94399
|
function traverseMeshes(cb) {
|
|
94182
|
-
|
|
94400
|
+
object2.traverse(function(child) {
|
|
94183
94401
|
if (child.isMesh === true || child.isPoints) {
|
|
94184
94402
|
const mesh = child;
|
|
94185
94403
|
const geometry = mesh.geometry;
|
|
@@ -94212,7 +94430,7 @@ ${shader.fragmentShader}`.replace(
|
|
|
94212
94430
|
for (const name2 of customAttributeNames) customTypes[name2] = "float";
|
|
94213
94431
|
let vertexCount = 0;
|
|
94214
94432
|
let faceCount = 0;
|
|
94215
|
-
|
|
94433
|
+
object2.traverse(function(child) {
|
|
94216
94434
|
if (child.isMesh === true) {
|
|
94217
94435
|
const mesh = child;
|
|
94218
94436
|
const geometry = mesh.geometry;
|
|
@@ -95003,12 +95221,12 @@ property list uchar int vertex_index
|
|
|
95003
95221
|
* @param {THREE.Object3D|THREE.Material|THREE.BufferGeometry|THREE.AnimationClip} object
|
|
95004
95222
|
* @param {Object} objectDef
|
|
95005
95223
|
*/
|
|
95006
|
-
serializeUserData(
|
|
95007
|
-
if (Object.keys(
|
|
95224
|
+
serializeUserData(object2, objectDef) {
|
|
95225
|
+
if (Object.keys(object2.userData).length === 0) return;
|
|
95008
95226
|
const options = this.options;
|
|
95009
95227
|
const extensionsUsed = this.extensionsUsed;
|
|
95010
95228
|
try {
|
|
95011
|
-
const json = JSON.parse(JSON.stringify(
|
|
95229
|
+
const json = JSON.parse(JSON.stringify(object2.userData));
|
|
95012
95230
|
if (options.includeCustomExtensions && json.gltfExtensions) {
|
|
95013
95231
|
if (objectDef.extensions === void 0) objectDef.extensions = {};
|
|
95014
95232
|
for (const extensionName in json.gltfExtensions) {
|
|
@@ -95019,7 +95237,7 @@ property list uchar int vertex_index
|
|
|
95019
95237
|
}
|
|
95020
95238
|
if (Object.keys(json).length > 0) objectDef.extras = json;
|
|
95021
95239
|
} catch (error2) {
|
|
95022
|
-
console.warn("THREE.GLTFExporter: userData of '" +
|
|
95240
|
+
console.warn("THREE.GLTFExporter: userData of '" + object2.name + "' won't be serialized because of JSON.stringify error - " + error2.message);
|
|
95023
95241
|
}
|
|
95024
95242
|
}
|
|
95025
95243
|
/**
|
|
@@ -95392,7 +95610,7 @@ property list uchar int vertex_index
|
|
|
95392
95610
|
* @param {string} mimeType export format
|
|
95393
95611
|
* @return {number} Index of the processed texture in the "images" array
|
|
95394
95612
|
*/
|
|
95395
|
-
processImage(image,
|
|
95613
|
+
processImage(image, format3, flipY, mimeType = "image/png") {
|
|
95396
95614
|
if (image !== null) {
|
|
95397
95615
|
const writer = this;
|
|
95398
95616
|
const cache = writer.cache;
|
|
@@ -95416,8 +95634,8 @@ property list uchar int vertex_index
|
|
|
95416
95634
|
ctx2.scale(1, -1);
|
|
95417
95635
|
}
|
|
95418
95636
|
if (image.data !== void 0) {
|
|
95419
|
-
if (
|
|
95420
|
-
console.error("GLTFExporter: Only RGBAFormat is supported.",
|
|
95637
|
+
if (format3 !== RGBAFormat) {
|
|
95638
|
+
console.error("GLTFExporter: Only RGBAFormat is supported.", format3);
|
|
95421
95639
|
}
|
|
95422
95640
|
if (image.width > options.maxTextureSize || image.height > options.maxTextureSize) {
|
|
95423
95641
|
console.warn("GLTFExporter: Image size is bigger than maxTextureSize", image);
|
|
@@ -95945,13 +96163,13 @@ property list uchar int vertex_index
|
|
|
95945
96163
|
* @param {THREE.Object3D} object
|
|
95946
96164
|
* @return {?number}
|
|
95947
96165
|
*/
|
|
95948
|
-
processSkin(
|
|
96166
|
+
processSkin(object2) {
|
|
95949
96167
|
const json = this.json;
|
|
95950
96168
|
const nodeMap = this.nodeMap;
|
|
95951
|
-
const node = json.nodes[nodeMap.get(
|
|
95952
|
-
const skeleton =
|
|
96169
|
+
const node = json.nodes[nodeMap.get(object2)];
|
|
96170
|
+
const skeleton = object2.skeleton;
|
|
95953
96171
|
if (skeleton === void 0) return null;
|
|
95954
|
-
const rootJoint =
|
|
96172
|
+
const rootJoint = object2.skeleton.bones[0];
|
|
95955
96173
|
if (rootJoint === void 0) return null;
|
|
95956
96174
|
const joints = [];
|
|
95957
96175
|
const inverseBindMatrices = new Float32Array(skeleton.bones.length * 16);
|
|
@@ -95959,7 +96177,7 @@ property list uchar int vertex_index
|
|
|
95959
96177
|
for (let i4 = 0; i4 < skeleton.bones.length; ++i4) {
|
|
95960
96178
|
joints.push(nodeMap.get(skeleton.bones[i4]));
|
|
95961
96179
|
temporaryBoneInverse.copy(skeleton.boneInverses[i4]);
|
|
95962
|
-
temporaryBoneInverse.multiply(
|
|
96180
|
+
temporaryBoneInverse.multiply(object2.bindMatrix).toArray(inverseBindMatrices, i4 * 16);
|
|
95963
96181
|
}
|
|
95964
96182
|
if (json.skins === void 0) json.skins = [];
|
|
95965
96183
|
json.skins.push({
|
|
@@ -95975,19 +96193,19 @@ property list uchar int vertex_index
|
|
|
95975
96193
|
* @param {THREE.Object3D} object Object3D to processNodeAsync
|
|
95976
96194
|
* @return {Promise<number>} Index of the node in the nodes list
|
|
95977
96195
|
*/
|
|
95978
|
-
async processNodeAsync(
|
|
96196
|
+
async processNodeAsync(object2) {
|
|
95979
96197
|
const json = this.json;
|
|
95980
96198
|
const options = this.options;
|
|
95981
96199
|
const nodeMap = this.nodeMap;
|
|
95982
96200
|
if (!json.nodes) json.nodes = [];
|
|
95983
|
-
if (
|
|
95984
|
-
return await this._processNodeWithPivotAsync(
|
|
96201
|
+
if (object2.pivot !== null) {
|
|
96202
|
+
return await this._processNodeWithPivotAsync(object2);
|
|
95985
96203
|
}
|
|
95986
96204
|
const nodeDef = {};
|
|
95987
96205
|
if (options.trs) {
|
|
95988
|
-
const rotation =
|
|
95989
|
-
const position =
|
|
95990
|
-
const scale =
|
|
96206
|
+
const rotation = object2.quaternion.toArray();
|
|
96207
|
+
const position = object2.position.toArray();
|
|
96208
|
+
const scale = object2.scale.toArray();
|
|
95991
96209
|
if (!equalArray(rotation, [0, 0, 0, 1])) {
|
|
95992
96210
|
nodeDef.rotation = rotation;
|
|
95993
96211
|
}
|
|
@@ -95998,28 +96216,28 @@ property list uchar int vertex_index
|
|
|
95998
96216
|
nodeDef.scale = scale;
|
|
95999
96217
|
}
|
|
96000
96218
|
} else {
|
|
96001
|
-
if (
|
|
96002
|
-
|
|
96219
|
+
if (object2.matrixAutoUpdate) {
|
|
96220
|
+
object2.updateMatrix();
|
|
96003
96221
|
}
|
|
96004
|
-
if (isIdentityMatrix(
|
|
96005
|
-
nodeDef.matrix =
|
|
96222
|
+
if (isIdentityMatrix(object2.matrix) === false) {
|
|
96223
|
+
nodeDef.matrix = object2.matrix.elements;
|
|
96006
96224
|
}
|
|
96007
96225
|
}
|
|
96008
|
-
if (
|
|
96009
|
-
this.serializeUserData(
|
|
96010
|
-
if (
|
|
96011
|
-
const meshIndex = await this.processMeshAsync(
|
|
96226
|
+
if (object2.name !== "") nodeDef.name = String(object2.name);
|
|
96227
|
+
this.serializeUserData(object2, nodeDef);
|
|
96228
|
+
if (object2.isMesh || object2.isLine || object2.isPoints) {
|
|
96229
|
+
const meshIndex = await this.processMeshAsync(object2);
|
|
96012
96230
|
if (meshIndex !== null) nodeDef.mesh = meshIndex;
|
|
96013
|
-
} else if (
|
|
96014
|
-
nodeDef.camera = this.processCamera(
|
|
96231
|
+
} else if (object2.isCamera) {
|
|
96232
|
+
nodeDef.camera = this.processCamera(object2);
|
|
96015
96233
|
}
|
|
96016
|
-
if (
|
|
96234
|
+
if (object2.isSkinnedMesh) this.skins.push(object2);
|
|
96017
96235
|
const nodeIndex = json.nodes.push(nodeDef) - 1;
|
|
96018
|
-
nodeMap.set(
|
|
96019
|
-
if (
|
|
96236
|
+
nodeMap.set(object2, nodeIndex);
|
|
96237
|
+
if (object2.children.length > 0) {
|
|
96020
96238
|
const children = [];
|
|
96021
|
-
for (let i4 = 0, l4 =
|
|
96022
|
-
const child =
|
|
96239
|
+
for (let i4 = 0, l4 = object2.children.length; i4 < l4; i4++) {
|
|
96240
|
+
const child = object2.children[i4];
|
|
96023
96241
|
if (child.visible || options.onlyVisible === false) {
|
|
96024
96242
|
const childNodeIndex = await this.processNodeAsync(child);
|
|
96025
96243
|
if (childNodeIndex !== null) children.push(childNodeIndex);
|
|
@@ -96028,7 +96246,7 @@ property list uchar int vertex_index
|
|
|
96028
96246
|
if (children.length > 0) nodeDef.children = children;
|
|
96029
96247
|
}
|
|
96030
96248
|
await this._invokeAllAsync(function(ext) {
|
|
96031
|
-
ext.writeNode && ext.writeNode(
|
|
96249
|
+
ext.writeNode && ext.writeNode(object2, nodeDef);
|
|
96032
96250
|
});
|
|
96033
96251
|
return nodeIndex;
|
|
96034
96252
|
}
|
|
@@ -96037,19 +96255,19 @@ property list uchar int vertex_index
|
|
|
96037
96255
|
* @param {THREE.Object3D} object Object3D with pivot
|
|
96038
96256
|
* @return {Promise<number>} Index of the container node
|
|
96039
96257
|
*/
|
|
96040
|
-
async _processNodeWithPivotAsync(
|
|
96258
|
+
async _processNodeWithPivotAsync(object2) {
|
|
96041
96259
|
const json = this.json;
|
|
96042
96260
|
const options = this.options;
|
|
96043
96261
|
const nodeMap = this.nodeMap;
|
|
96044
|
-
const pivot =
|
|
96262
|
+
const pivot = object2.pivot;
|
|
96045
96263
|
const containerDef = {};
|
|
96046
|
-
const rotation =
|
|
96264
|
+
const rotation = object2.quaternion.toArray();
|
|
96047
96265
|
const position = [
|
|
96048
|
-
|
|
96049
|
-
|
|
96050
|
-
|
|
96266
|
+
object2.position.x + pivot.x,
|
|
96267
|
+
object2.position.y + pivot.y,
|
|
96268
|
+
object2.position.z + pivot.z
|
|
96051
96269
|
];
|
|
96052
|
-
const scale =
|
|
96270
|
+
const scale = object2.scale.toArray();
|
|
96053
96271
|
if (!equalArray(rotation, [0, 0, 0, 1])) {
|
|
96054
96272
|
containerDef.rotation = rotation;
|
|
96055
96273
|
}
|
|
@@ -96060,28 +96278,28 @@ property list uchar int vertex_index
|
|
|
96060
96278
|
containerDef.scale = scale;
|
|
96061
96279
|
}
|
|
96062
96280
|
containerDef.extras = { pivot: pivot.toArray() };
|
|
96063
|
-
if (
|
|
96064
|
-
this.serializeUserData(
|
|
96281
|
+
if (object2.name !== "") containerDef.name = String(object2.name);
|
|
96282
|
+
this.serializeUserData(object2, containerDef);
|
|
96065
96283
|
const containerIndex = json.nodes.push(containerDef) - 1;
|
|
96066
|
-
nodeMap.set(
|
|
96284
|
+
nodeMap.set(object2, containerIndex);
|
|
96067
96285
|
const childDef = {};
|
|
96068
96286
|
const childPosition = [-pivot.x, -pivot.y, -pivot.z];
|
|
96069
96287
|
if (!equalArray(childPosition, [0, 0, 0])) {
|
|
96070
96288
|
childDef.translation = childPosition;
|
|
96071
96289
|
}
|
|
96072
|
-
if (
|
|
96073
|
-
const meshIndex = await this.processMeshAsync(
|
|
96290
|
+
if (object2.isMesh || object2.isLine || object2.isPoints) {
|
|
96291
|
+
const meshIndex = await this.processMeshAsync(object2);
|
|
96074
96292
|
if (meshIndex !== null) childDef.mesh = meshIndex;
|
|
96075
|
-
} else if (
|
|
96076
|
-
childDef.camera = this.processCamera(
|
|
96293
|
+
} else if (object2.isCamera) {
|
|
96294
|
+
childDef.camera = this.processCamera(object2);
|
|
96077
96295
|
}
|
|
96078
|
-
if (
|
|
96296
|
+
if (object2.isSkinnedMesh) this.skins.push(object2);
|
|
96079
96297
|
const childIndex = json.nodes.push(childDef) - 1;
|
|
96080
96298
|
const containerChildren = [childIndex];
|
|
96081
|
-
if (
|
|
96299
|
+
if (object2.children.length > 0) {
|
|
96082
96300
|
const grandchildren = [];
|
|
96083
|
-
for (let i4 = 0, l4 =
|
|
96084
|
-
const child =
|
|
96301
|
+
for (let i4 = 0, l4 = object2.children.length; i4 < l4; i4++) {
|
|
96302
|
+
const child = object2.children[i4];
|
|
96085
96303
|
if (child.visible || options.onlyVisible === false) {
|
|
96086
96304
|
const childNodeIndex = await this.processNodeAsync(child);
|
|
96087
96305
|
if (childNodeIndex !== null) grandchildren.push(childNodeIndex);
|
|
@@ -96091,7 +96309,7 @@ property list uchar int vertex_index
|
|
|
96091
96309
|
}
|
|
96092
96310
|
containerDef.children = containerChildren;
|
|
96093
96311
|
await this._invokeAllAsync(function(ext) {
|
|
96094
|
-
ext.writeNode && ext.writeNode(
|
|
96312
|
+
ext.writeNode && ext.writeNode(object2, containerDef);
|
|
96095
96313
|
});
|
|
96096
96314
|
return containerIndex;
|
|
96097
96315
|
}
|
|
@@ -96534,10 +96752,10 @@ property list uchar int vertex_index
|
|
|
96534
96752
|
this.writer = writer;
|
|
96535
96753
|
this.name = "EXT_mesh_gpu_instancing";
|
|
96536
96754
|
}
|
|
96537
|
-
writeNode(
|
|
96538
|
-
if (!
|
|
96755
|
+
writeNode(object2, nodeDef) {
|
|
96756
|
+
if (!object2.isInstancedMesh) return;
|
|
96539
96757
|
const writer = this.writer;
|
|
96540
|
-
const mesh =
|
|
96758
|
+
const mesh = object2;
|
|
96541
96759
|
const translationAttr = new Float32Array(mesh.count * 3);
|
|
96542
96760
|
const rotationAttr = new Float32Array(mesh.count * 4);
|
|
96543
96761
|
const scaleAttr = new Float32Array(mesh.count * 3);
|
|
@@ -96727,8 +96945,8 @@ property list uchar int vertex_index
|
|
|
96727
96945
|
}
|
|
96728
96946
|
}
|
|
96729
96947
|
};
|
|
96730
|
-
function localMatrix(
|
|
96731
|
-
return
|
|
96948
|
+
function localMatrix(object2) {
|
|
96949
|
+
return object2.matrixAutoUpdate ? new Matrix4().compose(object2.position, object2.quaternion, object2.scale) : object2.matrix.clone();
|
|
96732
96950
|
}
|
|
96733
96951
|
function createSnapshot(root, gltf, bakeColors = false) {
|
|
96734
96952
|
const scene = new Scene();
|
|
@@ -96832,10 +97050,10 @@ property list uchar int vertex_index
|
|
|
96832
97050
|
scene.add(copy);
|
|
96833
97051
|
}
|
|
96834
97052
|
};
|
|
96835
|
-
const visit = (
|
|
96836
|
-
if (!
|
|
96837
|
-
const world = parentWorld.clone().multiply(localMatrix(
|
|
96838
|
-
const mesh =
|
|
97053
|
+
const visit = (object2, parentWorld) => {
|
|
97054
|
+
if (!object2.visible) return;
|
|
97055
|
+
const world = parentWorld.clone().multiply(localMatrix(object2));
|
|
97056
|
+
const mesh = object2;
|
|
96839
97057
|
if (mesh.isMesh) {
|
|
96840
97058
|
const instanced = mesh;
|
|
96841
97059
|
if (instanced.isInstancedMesh) {
|
|
@@ -96849,7 +97067,7 @@ property list uchar int vertex_index
|
|
|
96849
97067
|
addMesh(mesh, world);
|
|
96850
97068
|
}
|
|
96851
97069
|
}
|
|
96852
|
-
for (const child of
|
|
97070
|
+
for (const child of object2.children) visit(child, world);
|
|
96853
97071
|
};
|
|
96854
97072
|
try {
|
|
96855
97073
|
const ancestors = [];
|
|
@@ -97092,11 +97310,11 @@ property list uchar int vertex_index
|
|
|
97092
97310
|
switch (recipe.type) {
|
|
97093
97311
|
case "minecraft:crafting_shaped":
|
|
97094
97312
|
case "crafting_shaped": {
|
|
97095
|
-
const
|
|
97096
|
-
if (!
|
|
97313
|
+
const pattern2 = recipe.pattern;
|
|
97314
|
+
if (!pattern2.length || pattern2.length > 3 || !pattern2[0].length || pattern2[0].length > 3 || pattern2.some((row) => row.length !== pattern2[0].length)) {
|
|
97097
97315
|
throw new Error("Crafting patterns must be rectangular, with 1\u20133 rows and columns");
|
|
97098
97316
|
}
|
|
97099
|
-
const cells =
|
|
97317
|
+
const cells = pattern2.flatMap((row, y5) => row.split("").map((symbol, x4) => ({ symbol, x: x4, y: y5 }))).filter((cell) => cell.symbol !== " ");
|
|
97100
97318
|
if (!cells.length) throw new Error("Crafting patterns must contain an ingredient");
|
|
97101
97319
|
const minX = Math.min(...cells.map((cell) => cell.x)), maxX = Math.max(...cells.map((cell) => cell.x));
|
|
97102
97320
|
const minY = Math.min(...cells.map((cell) => cell.y)), maxY = Math.max(...cells.map((cell) => cell.y));
|
|
@@ -97532,29 +97750,29 @@ property list uchar int vertex_index
|
|
|
97532
97750
|
this.objectControlsContainer.innerHTML = "";
|
|
97533
97751
|
this.addControls(targetObject, targetIntersection, instance);
|
|
97534
97752
|
}
|
|
97535
|
-
addControls(
|
|
97753
|
+
addControls(object2, intersection, instance) {
|
|
97536
97754
|
const container = document.createElement("div");
|
|
97537
97755
|
container.append(this.separator("Select Parent/Child"));
|
|
97538
|
-
if (
|
|
97539
|
-
container.append(this.buttonControl("Select Parent " +
|
|
97540
|
-
this.selectObject(
|
|
97756
|
+
if (object2.parent) {
|
|
97757
|
+
container.append(this.buttonControl("Select Parent " + object2.parent.constructor.name + " " + object2.parent.name, "P", () => {
|
|
97758
|
+
this.selectObject(object2.parent, intersection, instance);
|
|
97541
97759
|
}));
|
|
97542
97760
|
}
|
|
97543
|
-
if (
|
|
97761
|
+
if (object2.children.length > 0) {
|
|
97544
97762
|
let i4 = 1;
|
|
97545
|
-
for (let child of
|
|
97763
|
+
for (let child of object2.children) {
|
|
97546
97764
|
container.append(this.buttonControl("Select Child " + child.constructor.name + " " + child.name, "C" + i4++, () => {
|
|
97547
97765
|
this.selectObject(child, intersection, instance);
|
|
97548
97766
|
}));
|
|
97549
97767
|
}
|
|
97550
97768
|
}
|
|
97551
97769
|
container.append(this.separator());
|
|
97552
|
-
const selectedInstance = instance && (
|
|
97770
|
+
const selectedInstance = instance && (object2 === instance.instanceable || object2 === intersection?.object) ? instance : void 0;
|
|
97553
97771
|
if (!selectedInstance) {
|
|
97554
|
-
container.append(this.toggleControl("Visibility", "V",
|
|
97772
|
+
container.append(this.toggleControl("Visibility", "V", object2.visible, (v5) => object2.visible = v5));
|
|
97555
97773
|
}
|
|
97556
97774
|
container.append(this.separator("Mesh"));
|
|
97557
|
-
this.addObjectControls(
|
|
97775
|
+
this.addObjectControls(object2, intersection, container, selectedInstance);
|
|
97558
97776
|
container.append(this.separator());
|
|
97559
97777
|
this.objectControlsContainer.append(container);
|
|
97560
97778
|
}
|
|
@@ -98185,8 +98403,8 @@ property list uchar int vertex_index
|
|
|
98185
98403
|
return false;
|
|
98186
98404
|
}
|
|
98187
98405
|
return this._models.some((model) => {
|
|
98188
|
-
const
|
|
98189
|
-
return
|
|
98406
|
+
const object2 = isInstanceReference(model) ? model.instanceable : model;
|
|
98407
|
+
return object2.isOpaqueFullCube && this.getModelCullMask(model, 63) === 63;
|
|
98190
98408
|
});
|
|
98191
98409
|
}
|
|
98192
98410
|
getModelMatrix(model) {
|
|
@@ -98195,8 +98413,8 @@ property list uchar int vertex_index
|
|
|
98195
98413
|
return model.matrix.clone();
|
|
98196
98414
|
}
|
|
98197
98415
|
getModelCullMask(model, worldMask) {
|
|
98198
|
-
const
|
|
98199
|
-
if (
|
|
98416
|
+
const object2 = isInstanceReference(model) ? model.instanceable : model;
|
|
98417
|
+
if (object2.options.displayPosition) return 0;
|
|
98200
98418
|
const position = new Vector3();
|
|
98201
98419
|
const rotation = new Quaternion();
|
|
98202
98420
|
const scale = new Vector3();
|
|
@@ -98213,14 +98431,14 @@ property list uchar int vertex_index
|
|
|
98213
98431
|
replacements.push(model);
|
|
98214
98432
|
continue;
|
|
98215
98433
|
}
|
|
98216
|
-
const
|
|
98434
|
+
const object2 = isInstanceReference(model) ? model.instanceable : model;
|
|
98217
98435
|
const cullMask = this.getModelCullMask(model, worldMask);
|
|
98218
|
-
if (cullMask === (
|
|
98436
|
+
if (cullMask === (object2.options.cullMask ?? 0)) {
|
|
98219
98437
|
replacements.push(model);
|
|
98220
98438
|
continue;
|
|
98221
98439
|
}
|
|
98222
98440
|
const matrix = this.getModelMatrix(model);
|
|
98223
|
-
const replacement = await this.scene.addModel(
|
|
98441
|
+
const replacement = await this.scene.addModel(object2.originalModel, { ...object2.options, cullMask });
|
|
98224
98442
|
replacements.push(replacement);
|
|
98225
98443
|
if (isInstanceReference(replacement)) {
|
|
98226
98444
|
replacement.setMatrix(matrix);
|
|
@@ -98228,8 +98446,8 @@ property list uchar int vertex_index
|
|
|
98228
98446
|
replacement.matrix.copy(matrix);
|
|
98229
98447
|
replacement.matrixWorldNeedsUpdate = true;
|
|
98230
98448
|
matrix.decompose(replacement.position, replacement.quaternion, replacement.scale);
|
|
98231
|
-
replacement.matrixAutoUpdate =
|
|
98232
|
-
replacement.visible =
|
|
98449
|
+
replacement.matrixAutoUpdate = object2.matrixAutoUpdate;
|
|
98450
|
+
replacement.visible = object2.visible;
|
|
98233
98451
|
}
|
|
98234
98452
|
}
|
|
98235
98453
|
} catch (error2) {
|
|
@@ -100167,9 +100385,9 @@ property list uchar int vertex_index
|
|
|
100167
100385
|
* Parses a legacy schematic using custom mappings before the bundled defaults.
|
|
100168
100386
|
* Keys are `id:metadata`; values are block states such as `minecraft:oak_log[axis=x]`.
|
|
100169
100387
|
*/
|
|
100170
|
-
static async parse(nbt, customMappings = {}) {
|
|
100388
|
+
static async parse(nbt, customMappings = {}, options = {}) {
|
|
100171
100389
|
const tags = nbt.value;
|
|
100172
|
-
if (tags.Materials?.type !== "string" || tags.Materials.value !== "Alpha") {
|
|
100390
|
+
if (!options.lenient && (tags.Materials?.type !== "string" || tags.Materials.value !== "Alpha")) {
|
|
100173
100391
|
throw new MineRenderError("Schematic Materials must be Alpha");
|
|
100174
100392
|
}
|
|
100175
100393
|
const size = ["Width", "Height", "Length"].map((name2) => {
|
|
@@ -100210,8 +100428,16 @@ property list uchar int vertex_index
|
|
|
100210
100428
|
const id = high << 8 | ids.value[index] & 255;
|
|
100211
100429
|
const metadata = data.value[index] & 255;
|
|
100212
100430
|
const key = `${id}:${metadata}`;
|
|
100213
|
-
|
|
100214
|
-
if (!mapped
|
|
100431
|
+
let mapped = customMappings[key] ?? mapping[key];
|
|
100432
|
+
if (!mapped && options.lenient) {
|
|
100433
|
+
mapped = customMappings[`${id}:0`] ?? mapping[`${id}:0`];
|
|
100434
|
+
}
|
|
100435
|
+
if (!mapped) {
|
|
100436
|
+
if (options.lenient) {
|
|
100437
|
+
continue;
|
|
100438
|
+
}
|
|
100439
|
+
throw new MineRenderError(`Unsupported legacy block ${id}:${metadata} at schematic index ${index}`);
|
|
100440
|
+
}
|
|
100215
100441
|
const [type, state] = mapped.split("[");
|
|
100216
100442
|
if (type === "minecraft:air") continue;
|
|
100217
100443
|
const properties = {};
|
|
@@ -101404,53 +101630,53 @@ property list uchar int vertex_index
|
|
|
101404
101630
|
this.options = (0, import_ts_deepmerge8.default)({}, _MineRenderScene.DEFAULT_OPTIONS, options ?? {});
|
|
101405
101631
|
}
|
|
101406
101632
|
add(...objects) {
|
|
101407
|
-
for (const
|
|
101633
|
+
for (const object2 of objects) {
|
|
101408
101634
|
this.dirty = true;
|
|
101409
101635
|
try {
|
|
101410
|
-
super.add(
|
|
101636
|
+
super.add(object2);
|
|
101411
101637
|
} finally {
|
|
101412
|
-
if (
|
|
101413
|
-
this.updateObjectRegistration(
|
|
101638
|
+
if (object2?.isObject3D && object2 !== this) {
|
|
101639
|
+
this.updateObjectRegistration(object2, object2.parent === this);
|
|
101414
101640
|
}
|
|
101415
101641
|
}
|
|
101416
101642
|
}
|
|
101417
101643
|
return this;
|
|
101418
101644
|
}
|
|
101419
101645
|
remove(...objects) {
|
|
101420
|
-
for (const
|
|
101421
|
-
if (!this.children.includes(
|
|
101646
|
+
for (const object2 of objects) {
|
|
101647
|
+
if (!this.children.includes(object2)) continue;
|
|
101422
101648
|
this.dirty = true;
|
|
101423
|
-
this.updateObjectRegistration(
|
|
101649
|
+
this.updateObjectRegistration(object2, false);
|
|
101424
101650
|
try {
|
|
101425
|
-
super.remove(
|
|
101651
|
+
super.remove(object2);
|
|
101426
101652
|
} finally {
|
|
101427
|
-
this.updateObjectRegistration(
|
|
101653
|
+
this.updateObjectRegistration(object2, object2.parent === this);
|
|
101428
101654
|
}
|
|
101429
101655
|
}
|
|
101430
101656
|
return this;
|
|
101431
101657
|
}
|
|
101432
|
-
updateObjectRegistration(
|
|
101433
|
-
if (this.observedObjects.has(
|
|
101434
|
-
const observable =
|
|
101658
|
+
updateObjectRegistration(object2, attached) {
|
|
101659
|
+
if (this.observedObjects.has(object2) === attached) return;
|
|
101660
|
+
const observable = object2;
|
|
101435
101661
|
if (attached) {
|
|
101436
|
-
this.observedObjects.add(
|
|
101662
|
+
this.observedObjects.add(object2);
|
|
101437
101663
|
observable.addEventListener("change", this.onObjectChange);
|
|
101438
101664
|
} else {
|
|
101439
|
-
this.observedObjects.delete(
|
|
101665
|
+
this.observedObjects.delete(object2);
|
|
101440
101666
|
observable.removeEventListener("change", this.onObjectChange);
|
|
101441
101667
|
}
|
|
101442
101668
|
const change = attached ? 1 : -1;
|
|
101443
101669
|
this.stats.objectCount += change;
|
|
101444
|
-
if (isSceneObject(
|
|
101670
|
+
if (isSceneObject(object2)) {
|
|
101445
101671
|
this.stats.sceneObjectCount += change;
|
|
101446
101672
|
}
|
|
101447
101673
|
}
|
|
101448
|
-
async initAndAdd(...
|
|
101674
|
+
async initAndAdd(...object2) {
|
|
101449
101675
|
this.dirty = true;
|
|
101450
|
-
for (let obj of
|
|
101676
|
+
for (let obj of object2) {
|
|
101451
101677
|
await obj.init();
|
|
101452
101678
|
}
|
|
101453
|
-
return this.add(...
|
|
101679
|
+
return this.add(...object2);
|
|
101454
101680
|
}
|
|
101455
101681
|
async addSceneObject(asset, objectSupplier, _options, parent = this) {
|
|
101456
101682
|
this.dirty = true;
|
|
@@ -103516,11 +103742,11 @@ gl_FragDepth=readDepth(vUv);
|
|
|
103516
103742
|
var _startEvent = { type: "start" };
|
|
103517
103743
|
var _endEvent = { type: "end" };
|
|
103518
103744
|
var OrbitControls = class extends EventDispatcher {
|
|
103519
|
-
constructor(
|
|
103745
|
+
constructor(object2, domElement) {
|
|
103520
103746
|
super();
|
|
103521
103747
|
if (domElement === void 0) console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.');
|
|
103522
103748
|
if (domElement === document) console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.');
|
|
103523
|
-
this.object =
|
|
103749
|
+
this.object = object2;
|
|
103524
103750
|
this.domElement = domElement;
|
|
103525
103751
|
this.domElement.style.touchAction = "none";
|
|
103526
103752
|
this.enabled = true;
|
|
@@ -103577,7 +103803,7 @@ gl_FragDepth=readDepth(vUv);
|
|
|
103577
103803
|
};
|
|
103578
103804
|
this.update = function() {
|
|
103579
103805
|
const offset = new Vector3();
|
|
103580
|
-
const quat = new Quaternion().setFromUnitVectors(
|
|
103806
|
+
const quat = new Quaternion().setFromUnitVectors(object2.up, new Vector3(0, 1, 0));
|
|
103581
103807
|
const quatInverse = quat.clone().invert();
|
|
103582
103808
|
const lastPosition = new Vector3();
|
|
103583
103809
|
const lastQuaternion = new Quaternion();
|
|
@@ -104142,8 +104368,8 @@ gl_FragDepth=readDepth(vUv);
|
|
|
104142
104368
|
}
|
|
104143
104369
|
};
|
|
104144
104370
|
var MapControls = class extends OrbitControls {
|
|
104145
|
-
constructor(
|
|
104146
|
-
super(
|
|
104371
|
+
constructor(object2, domElement) {
|
|
104372
|
+
super(object2, domElement);
|
|
104147
104373
|
this.screenSpacePanning = false;
|
|
104148
104374
|
this.mouseButtons.LEFT = MOUSE.PAN;
|
|
104149
104375
|
this.mouseButtons.RIGHT = MOUSE.ROTATE;
|
|
@@ -105119,16 +105345,16 @@ gl_FragDepth=readDepth(vUv);
|
|
|
105119
105345
|
if (!models) this.models.set(model, models = /* @__PURE__ */ new Map());
|
|
105120
105346
|
const key = JSON.stringify([rotation.x, rotation.y, rotation.z, variant.uvlock, tints]);
|
|
105121
105347
|
const template = await cached(models, key, async () => {
|
|
105122
|
-
const
|
|
105348
|
+
const object2 = new SectionModel(model, {
|
|
105123
105349
|
instanceMeshes: false,
|
|
105124
105350
|
mergeMeshes: false,
|
|
105125
105351
|
tints,
|
|
105126
105352
|
uvLockRotation: variant.uvlock && (rotation.x !== 0 || rotation.y !== 0) ? [rotation.x, rotation.y, rotation.z] : void 0
|
|
105127
105353
|
});
|
|
105128
|
-
await
|
|
105129
|
-
const geometry =
|
|
105354
|
+
await object2.init();
|
|
105355
|
+
const geometry = object2.children[0].geometry;
|
|
105130
105356
|
geometry.applyMatrix4(new Matrix4().makeRotationFromEuler(rotation));
|
|
105131
|
-
|
|
105357
|
+
object2.clear();
|
|
105132
105358
|
const cullFaces = CUBE_FACES.map((face) => {
|
|
105133
105359
|
const local = CUBE_FACES.findIndex((name2) => name2 === atlas.model.elements[0].faces[face]?.cullface);
|
|
105134
105360
|
if (local < 0) return 0;
|
|
@@ -105316,10 +105542,10 @@ gl_FragDepth=readDepth(vUv);
|
|
|
105316
105542
|
await block.object.updateFluid((x4, y5, z4) => {
|
|
105317
105543
|
const neighbor = pos.clone().add(new Vector3(x4, y5, z4));
|
|
105318
105544
|
const section = this.getChunkAt(neighbor);
|
|
105319
|
-
const
|
|
105545
|
+
const object2 = section?.isBlockVisibleAt(neighbor) ? section.getBlockAt(neighbor)?.object : void 0;
|
|
105320
105546
|
return {
|
|
105321
|
-
fluid:
|
|
105322
|
-
level:
|
|
105547
|
+
fluid: object2?.fluidKind,
|
|
105548
|
+
level: object2?.fluidLevel,
|
|
105323
105549
|
solid: section?.isOccludingAt(neighbor) ?? false
|
|
105324
105550
|
};
|
|
105325
105551
|
});
|
|
@@ -105551,7 +105777,7 @@ gl_FragDepth=readDepth(vUv);
|
|
|
105551
105777
|
this.renderedBlocks.get(index)?.object?.removeFromScene();
|
|
105552
105778
|
if (this.sectionBlocks.delete(index)) this.meshDirty = true;
|
|
105553
105779
|
this.renderedBlocks.delete(index);
|
|
105554
|
-
let
|
|
105780
|
+
let object2;
|
|
105555
105781
|
try {
|
|
105556
105782
|
if (!readBlock) return void 0;
|
|
105557
105783
|
const stored = readBlock();
|
|
@@ -105566,22 +105792,22 @@ gl_FragDepth=readDepth(vUv);
|
|
|
105566
105792
|
this.sectionBlocks.set(index, { index, template, cullMask: 0 });
|
|
105567
105793
|
this.meshDirty = true;
|
|
105568
105794
|
} else {
|
|
105569
|
-
|
|
105795
|
+
object2 = await this.scene.addBlock(blockState, {
|
|
105570
105796
|
mergeMeshes: true,
|
|
105571
105797
|
instanceMeshes: true,
|
|
105572
105798
|
maxInstanceCount: 2e3,
|
|
105573
105799
|
initialState: stored.properties
|
|
105574
105800
|
});
|
|
105575
|
-
|
|
105801
|
+
object2.setPosition(MineRenderWorld.worldToScenePosition(worldPos));
|
|
105576
105802
|
}
|
|
105577
105803
|
const info = { get block() {
|
|
105578
105804
|
return readBlock();
|
|
105579
|
-
}, object };
|
|
105805
|
+
}, object: object2 };
|
|
105580
105806
|
this.renderedBlocks.set(index, info);
|
|
105581
105807
|
return info;
|
|
105582
105808
|
} catch (error2) {
|
|
105583
105809
|
this.data.set(index, void 0);
|
|
105584
|
-
|
|
105810
|
+
object2?.removeFromScene();
|
|
105585
105811
|
throw error2;
|
|
105586
105812
|
} finally {
|
|
105587
105813
|
await onBlocksChanged?.([worldPos]);
|