voxolith

makePoseCache()

Make a cache for baked poses (or anything else keyed by string). When the estimated size goes over maxBytes (default 48 MiB) the least recently used entries are evicted. makeCrowd makes one itself; make your own to share poses between crowds or to cache poses you bake by hand.

function makePoseCache<T>(sizeOf: (value: T) => number, opts?: object): PoseCache<T>;

Defined in: engine/src/animation/cache.ts:31

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
sizeOf(value: T) => numberEstimated bytes of a value, counted against maxBytes.
opts?{ maxBytes?: number; onEvict?: (key: string, value: T) => void; }-
opts.maxBytes?number-
opts.onEvict?(key: string, value: T) => void-

Returns

PoseCache<T>

On this page