mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-22 07:45:19 +03:00
coderabbit strikes again
This commit is contained in:
parent
60e7145895
commit
b18a1a811f
1 changed files with 10 additions and 3 deletions
|
@ -119,9 +119,16 @@ Model.prototype.loadGLTF = function (model_file, callback) {
|
||||||
},
|
},
|
||||||
(progress) => {
|
(progress) => {
|
||||||
// Optional: Handle loading progress
|
// Optional: Handle loading progress
|
||||||
console.log(
|
if (progress.total > 0) {
|
||||||
`Loading progress: ${progress.loaded}/${progress.total} (${Math.round((progress.loaded / progress.total) * 100)}%)`,
|
const pct = Math.round((progress.loaded / progress.total) * 100);
|
||||||
);
|
if (pct !== this._lastPct) {
|
||||||
|
// throttle identical values
|
||||||
|
this._lastPct = pct;
|
||||||
|
console.log(`Loading progress: ${progress.loaded}/${progress.total} (${pct}%)`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`Loading progress: ${progress.loaded} bytes`);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.error("Error loading model:", error);
|
console.error("Error loading model:", error);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue