For that you'll need to build your own cache (a Map
objetc could be ideal) that stores gltf.scene
result.
You'll surely will need some functions wrapping up your object loader engine and to create a properly scoped variable for the Map
cache.
If you are going to play hard with Mapbox and three.js, I'd recommend you to take a look to threebox that already has cache implemented in this way to optimize performance and load thousands of objects among many other features. You can also check the cache logic implemented in threebox here
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…