@galacean/engine 0.0.0-experimental-renderSort.0 → 0.0.0-experimental-renderSort.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +23 -19
- package/dist/browser.min.js +1 -1
- package/dist/main.js +1 -1
- package/dist/miniprogram.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +5 -5
package/dist/browser.js
CHANGED
|
@@ -26549,7 +26549,7 @@
|
|
|
26549
26549
|
*/ _proto._quickSort = function _quickSort(a, from, to, compareFunc) {
|
|
26550
26550
|
while(true){
|
|
26551
26551
|
// Insertion sort is faster for short arrays.
|
|
26552
|
-
if (to - from <=
|
|
26552
|
+
if (to - from <= 10000000) {
|
|
26553
26553
|
this._insertionSort(a, from, to, compareFunc);
|
|
26554
26554
|
return;
|
|
26555
26555
|
}
|
|
@@ -26558,45 +26558,38 @@
|
|
|
26558
26558
|
var v0 = a[from];
|
|
26559
26559
|
var v1 = a[to - 1];
|
|
26560
26560
|
var v2 = a[third_index];
|
|
26561
|
-
var swapFlag = false;
|
|
26562
26561
|
var c01 = compareFunc(v0, v1);
|
|
26563
26562
|
if (c01 > 0) {
|
|
26564
26563
|
// v1 < v0, so swap them.
|
|
26565
26564
|
var tmp = v0;
|
|
26566
26565
|
v0 = v1;
|
|
26567
26566
|
v1 = tmp;
|
|
26568
|
-
swapFlag = true;
|
|
26569
26567
|
} // v0 <= v1.
|
|
26570
26568
|
var c02 = compareFunc(v0, v2);
|
|
26571
|
-
if (c02
|
|
26572
|
-
// v2
|
|
26569
|
+
if (c02 >= 0) {
|
|
26570
|
+
// v2 <= v0 <= v1.
|
|
26573
26571
|
var tmp1 = v0;
|
|
26574
26572
|
v0 = v2;
|
|
26575
26573
|
v2 = v1;
|
|
26576
26574
|
v1 = tmp1;
|
|
26577
|
-
swapFlag = true;
|
|
26578
26575
|
} else {
|
|
26579
|
-
//
|
|
26576
|
+
// v0 <= v1 && v0 < v2
|
|
26580
26577
|
var c12 = compareFunc(v1, v2);
|
|
26581
26578
|
if (c12 > 0) {
|
|
26582
26579
|
// v0 <= v2 < v1
|
|
26583
26580
|
var tmp2 = v1;
|
|
26584
26581
|
v1 = v2;
|
|
26585
26582
|
v2 = tmp2;
|
|
26586
|
-
swapFlag = true;
|
|
26587
26583
|
}
|
|
26588
26584
|
}
|
|
26589
26585
|
// v0 <= v1 <= v2
|
|
26586
|
+
a[from] = v0;
|
|
26587
|
+
a[to - 1] = v2;
|
|
26588
|
+
var pivot = v1;
|
|
26590
26589
|
var low_end = from + 1; // Upper bound of elements lower than pivot.
|
|
26591
26590
|
var high_start = to - 1; // Lower bound of elements greater than pivot.
|
|
26592
|
-
|
|
26593
|
-
|
|
26594
|
-
a[from] = v0;
|
|
26595
|
-
a[to - 1] = v2;
|
|
26596
|
-
pivot = v1;
|
|
26597
|
-
a[third_index] = a[low_end];
|
|
26598
|
-
a[low_end] = pivot;
|
|
26599
|
-
}
|
|
26591
|
+
a[third_index] = a[low_end];
|
|
26592
|
+
a[low_end] = pivot;
|
|
26600
26593
|
// From low_end to i are elements equal to pivot.
|
|
26601
26594
|
// From i to high_start are elements that haven't been compared yet.
|
|
26602
26595
|
partition: for(var i = low_end + 1; i < high_start; i++){
|
|
@@ -26663,7 +26656,12 @@
|
|
|
26663
26656
|
if (componentA.instanceId === componentB.instanceId) {
|
|
26664
26657
|
return dataA.material._priority - dataB.material._priority || componentA._distanceForSort - componentB._distanceForSort;
|
|
26665
26658
|
} else {
|
|
26666
|
-
|
|
26659
|
+
var distanceDiff = componentA._distanceForSort - componentB._distanceForSort;
|
|
26660
|
+
if (distanceDiff === 0) {
|
|
26661
|
+
return componentA.instanceId - componentB.instanceId;
|
|
26662
|
+
} else {
|
|
26663
|
+
return distanceDiff;
|
|
26664
|
+
}
|
|
26667
26665
|
}
|
|
26668
26666
|
};
|
|
26669
26667
|
/**
|
|
@@ -26681,7 +26679,13 @@
|
|
|
26681
26679
|
if (componentA.instanceId === componentB.instanceId) {
|
|
26682
26680
|
return dataA.material._priority - dataB.material._priority || componentB._distanceForSort - componentA._distanceForSort;
|
|
26683
26681
|
} else {
|
|
26684
|
-
return componentB._distanceForSort - componentA._distanceForSort;
|
|
26682
|
+
// return componentB._distanceForSort - componentA._distanceForSort;
|
|
26683
|
+
var distanceDiff = componentB._distanceForSort - componentA._distanceForSort;
|
|
26684
|
+
if (distanceDiff === 0) {
|
|
26685
|
+
return componentA.instanceId - componentB.instanceId;
|
|
26686
|
+
} else {
|
|
26687
|
+
return distanceDiff;
|
|
26688
|
+
}
|
|
26685
26689
|
}
|
|
26686
26690
|
};
|
|
26687
26691
|
return RenderQueue;
|
|
@@ -44035,7 +44039,7 @@
|
|
|
44035
44039
|
], GALACEAN_animation_event);
|
|
44036
44040
|
|
|
44037
44041
|
//@ts-ignore
|
|
44038
|
-
var version = "0.0.0-experimental-renderSort.
|
|
44042
|
+
var version = "0.0.0-experimental-renderSort.3";
|
|
44039
44043
|
console.log("Galacean engine version: " + version);
|
|
44040
44044
|
for(var key in CoreObjects){
|
|
44041
44045
|
Loader.registerClass(key, CoreObjects[key]);
|