Fixed Memory Leak and Improved Performance

This commit is contained in:
2026-08-05 02:22:02 +08:00
parent 2220d4031c
commit 8de2c3004b
+3 -2
View File
@@ -105,6 +105,8 @@ if (window.innerWidth <= 600) {
const loaderContainer = document.getElementById('loader-container');
const loadingText = document.getElementById('loading-text');
let latestModelPath = null;
//Load Function
function loadModel(modelPath) {
if (currentModel) {
@@ -147,6 +149,7 @@ function loadModel(modelPath) {
});
}
function startApp() {
// 1. Create an object to hold the currently selected values
const modelsData = loadData;
@@ -237,7 +240,6 @@ scene.environment = env_texture;
renderer.setAnimationLoop( animate );
function animate() {
requestAnimationFrame(animate);
const delta = clock.getDelta();
if (mixer) {
mixer.update(delta);
@@ -246,7 +248,6 @@ function animate() {
renderer.render( scene, camera );
}
animate();
//Toggle GUI
function setGuiEnabled(guiInstance, isEnabled) {