three-base 2.0.74 → 2.0.75
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/MeshBase.js +15 -13
- package/MeshBase.ts +15 -13
- package/package.json +1 -1
package/MeshBase.js
CHANGED
|
@@ -81,19 +81,21 @@ export default class MeshBase extends Group {
|
|
|
81
81
|
resoles = [];
|
|
82
82
|
// 等待加载加载完成
|
|
83
83
|
async awaitLoaded() {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.resoles.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
if (!this.loaded) {
|
|
85
|
+
await new Promise((resolve) => {
|
|
86
|
+
if (this.resoles.length === 0) {
|
|
87
|
+
(async () => {
|
|
88
|
+
while (!this.loaded) {
|
|
89
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
90
|
+
}
|
|
91
|
+
while (this.resoles.length > 0) {
|
|
92
|
+
this.resoles.pop()();
|
|
93
|
+
}
|
|
94
|
+
})();
|
|
95
|
+
}
|
|
96
|
+
this.resoles.unshift(resolve);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
97
99
|
}
|
|
98
100
|
//遍历模型
|
|
99
101
|
async traverseMesh(callback) {
|
package/MeshBase.ts
CHANGED
|
@@ -112,19 +112,21 @@ export default class MeshBase extends Group {
|
|
|
112
112
|
resoles = [];
|
|
113
113
|
// 等待加载加载完成
|
|
114
114
|
async awaitLoaded() {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.resoles.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
115
|
+
if (!this.loaded) {
|
|
116
|
+
await new Promise<void>((resolve) => {
|
|
117
|
+
if (this.resoles.length === 0) {
|
|
118
|
+
(async () => {
|
|
119
|
+
while (!this.loaded) {
|
|
120
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
121
|
+
}
|
|
122
|
+
while (this.resoles.length > 0) {
|
|
123
|
+
this.resoles.pop()();
|
|
124
|
+
}
|
|
125
|
+
})();
|
|
126
|
+
}
|
|
127
|
+
this.resoles.unshift(resolve);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
//遍历模型
|