@xeokit/xeokit-sdk 2.6.0-beta-1 → 2.6.0-beta-2
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/xeokit-sdk.cjs.js +17 -14
- package/dist/xeokit-sdk.es.js +17 -14
- package/dist/xeokit-sdk.es5.js +3 -2
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/viewer/scene/core.js +16 -13
package/package.json
CHANGED
package/src/viewer/scene/core.js
CHANGED
|
@@ -155,22 +155,25 @@ const frame = function () {
|
|
|
155
155
|
lastTime = time;
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
this.worker.onmessage = callback;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
stop() {
|
|
169
|
-
this.worker.terminate();
|
|
158
|
+
function customSetInterval(callback, interval) {
|
|
159
|
+
let expected = Date.now() + interval;
|
|
160
|
+
function loop() {
|
|
161
|
+
const elapsed = Date.now() - expected;
|
|
162
|
+
callback();
|
|
163
|
+
expected += interval;
|
|
164
|
+
setTimeout(loop, Math.max(0, interval - elapsed));
|
|
170
165
|
}
|
|
166
|
+
loop();
|
|
167
|
+
return {
|
|
168
|
+
cancel: function() {
|
|
169
|
+
// No need to do anything, setTimeout cannot be directly cancelled
|
|
170
|
+
}
|
|
171
|
+
};
|
|
171
172
|
}
|
|
172
173
|
|
|
173
|
-
|
|
174
|
+
customSetInterval(() => {
|
|
175
|
+
frame();
|
|
176
|
+
}, 100);
|
|
174
177
|
|
|
175
178
|
const renderFrame = function () {
|
|
176
179
|
let time = Date.now();
|