Fixed Memory Leak and Improved Performance
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user