1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<p class="desc">
A simple caching system, used internally by [page:FileLoader].
</p>
<h2>Examples</h2>
<p>
[example:webgl_geometry_text WebGL / geometry / text ]<br />
[example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]<br />
[example:webgl_loader_ttf WebGL / loader / ttf]
</p>
<h2>Usage</h2>
<p>To enable caching across all loaders that use [page:FileLoader], set</p>
<code>
THREE.Cache.enabled = true.
</code>
<h2>Properties</h2>
<h3>[property:Boolean enabled]</h3>
<p>Whether caching is enabled. Default is *false*.</p>
<h3>[property:Object files]</h3>
<p>An [page:Object object] that holds cached files.</p>
<h2>Methods</h2>
<h3>[method:null add]( [param:String key], file )</h3>
<p>
[page:String key] — the [page:String key] to reference the cached file by.<br />
[page:Object file] — The file to be cached.<br /><br />
Adds a cache entry with a key to reference the file. If this key already holds a file,
it is overwritten.
</p>
<h3>[method:null get]( [param:String key] )</h3>
<p>
[page:String key] — A string key <br /><br />
Get the value of [page:String key]. If the key does not exist *undefined* is returned.
</p>
<h3>[method:null remove]( [param:String key] )</h3>
<p>
[page:String key] — A string key that references a cached file.<br /><br />
Remove the cached file associated with the key.
</p>
<h3>[method:null clear]()</h3>
<p>Remove all values from the cache.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>
|