How to use the Cache function from three
Find comprehensive JavaScript three.Cache code examples handpicked from public code repositorys.
10 11 12 13 14 15 16 17 18
() => forceUpdate(i => !i) ) } }, [filepath]) return THREE.Cache.get(filepath) || null } module.exports = useImageBitmapLoader
263
0
1
9 10 11 12 13 14 15 16 17 18
SGConnection.getResource('image', filepath) .then(({data}) => { onBitmapImageBufferLoad(filepath, data) .then((bitmap) => { console.log('Loaded TEXTUREBITMAP: ', bitmap) THREE.Cache.add( filepath, bitmap ) forceUpdate(i => !i) }) }) }
263
0
1
+ 3 other calls in file
GitHub: vladyna/storyboarder
163 164 165 166 167 168 169 170 171
// </group> } const UITest = () => { useMemo(() => { THREE.Cache.enabled = true }, []) const store = useReduxStore()
263
0
0
178 179 180 181 182 183 184 185 186 187
load(url, onLoad, onProgress, onError) { if (this.path !== undefined) url = this.path + url; url = this.manager.resolveURL(url); const scope = this; const cached = three.Cache.get(url); if (cached !== undefined) { scope.manager.itemStart(url); setTimeout(function () { if (onLoad)
2
7
0
GitHub: PrashanthG45/aframe
12 13 14 15 16 17 18 19 20 21 22 23
THREE.ImageLoader.prototype.crossOrigin = 'anonymous'; } // In-memory caching for XHRs (for images, audio files, textures, etc.). if (THREE.Cache) { THREE.Cache.enabled = true; } // TODO: Eventually include these only if they are needed by a component. require('three/examples/js/loaders/OBJLoader'); // THREE.OBJLoader
0
0
0
+ 7 other calls in file
three.Vector3 is the most popular function in three (22341 examples)