src/systems/geometry.js
function (data) {
    var cache = this.cache;
    var cacheCount = this.cacheCount;
    var geometry;
    var hash;

    if (data.skipCache) { return; }

    hash = this.hash(data);

    if (!cache[hash]) { return; }

    decrementCacheCount(cacheCount, hash);

    // Another entity is still using this geometry. No need to do anything.
    if (cacheCount[hash] > 0) { return; }

    // No more entities are using this geometry. Dispose.
    geometry = cache[hash];
    geometry.dispose();
    delete cache[hash];
    delete cacheCount[hash];
  }
function (data) {
    var cache = this.cache;
    var cacheCount = this.cacheCount;
    var geometry;
    var hash;

    if (data.skipCache) { return; }

    hash = this.hash(data);

    if (!cache[hash]) { return; }

    decrementCacheCount(cacheCount, hash);

    // Another entity is still using this geometry. No need to do anything.
    if (cacheCount[hash] > 0) { return; }

    // No more entities are using this geometry. Dispose.
    geometry = cache[hash];
    geometry.dispose();
    delete cache[hash];
    delete cacheCount[hash];
  }
function ( data ) { var cache = this . cache ; var cacheCount = this . cacheCount ; var geometry ; var hash ; if ( data . skipCache ) { return ; } hash = this . hash ( data ) ; if ( ! cache [ hash ] ) { return ; } decrementCacheCount ( cacheCount , hash ) ; // Another entity is still using this geometry. No need to do anything. if ( cacheCount [ hash ] > 0 ) { return ; } // No more entities are using this geometry. Dispose. geometry = cache [ hash ] ; geometry . dispose ( ) ; delete cache [ hash ] ; delete cacheCount [ hash ] ; }
Let system know that an entity is no longer using a geometry.
Let system know that an entity is no longer using a geometry .