example/threejs/asset/three.js
function( var_args ) {

		var objects = this._objects,
			nObjects = objects.length,
			nCachedObjects = this.nCachedObjects_,
			indicesByUUID = this._indicesByUUID,
			bindings = this._bindings,
			nBindings = bindings.length;

		for ( var i = 0, n = arguments.length; i !== n; ++ i ) {

			var object = arguments[ i ],
				uuid = object.uuid,
				index = indicesByUUID[ uuid ];

			if ( index !== undefined ) {

				delete indicesByUUID[ uuid ];

				if ( index < nCachedObjects ) {

					// object is cached, shrink the CACHED region

					var firstActiveIndex = -- nCachedObjects,
						lastCachedObject = objects[ firstActiveIndex ],
						lastIndex = -- nObjects,
						lastObject = objects[ lastIndex ];

					// last cached object takes this object's place
					indicesByUUID[ lastCachedObject.uuid ] = index;
					objects[ index ] = lastCachedObject;

					// last object goes to the activated slot and pop
					indicesByUUID[ lastObject.uuid ] = firstActiveIndex;
					objects[ firstActiveIndex ] = lastObject;
					objects.pop();

					// accounting is done, now do the same for all bindings

					for ( var j = 0, m = nBindings; j !== m; ++ j ) {

						var bindingsForPath = bindings[ j ],
							lastCached = bindingsForPath[ firstActiveIndex ],
							last = bindingsForPath[ lastIndex ];

						bindingsForPath[ index ] = lastCached;
						bindingsForPath[ firstActiveIndex ] = last;
						bindingsForPath.pop();

					}

				} else {

					// object is active, just swap with the last and pop

					var lastIndex = -- nObjects,
						lastObject = objects[ lastIndex ];

					indicesByUUID[ lastObject.uuid ] = index;
					objects[ index ] = lastObject;
					objects.pop();

					// accounting is done, now do the same for all bindings

					for ( var j = 0, m = nBindings; j !== m; ++ j ) {

						var bindingsForPath = bindings[ j ];

						bindingsForPath[ index ] = bindingsForPath[ lastIndex ];
						bindingsForPath.pop();

					}

				} // cached or active

			} // if object is known

		} // for arguments

		this.nCachedObjects_ = nCachedObjects;

	}
function( var_args ) {

		var objects = this._objects,
			nObjects = objects.length,
			nCachedObjects = this.nCachedObjects_,
			indicesByUUID = this._indicesByUUID,
			bindings = this._bindings,
			nBindings = bindings.length;

		for ( var i = 0, n = arguments.length; i !== n; ++ i ) {

			var object = arguments[ i ],
				uuid = object.uuid,
				index = indicesByUUID[ uuid ];

			if ( index !== undefined ) {

				delete indicesByUUID[ uuid ];

				if ( index < nCachedObjects ) {

					// object is cached, shrink the CACHED region

					var firstActiveIndex = -- nCachedObjects,
						lastCachedObject = objects[ firstActiveIndex ],
						lastIndex = -- nObjects,
						lastObject = objects[ lastIndex ];

					// last cached object takes this object's place
					indicesByUUID[ lastCachedObject.uuid ] = index;
					objects[ index ] = lastCachedObject;

					// last object goes to the activated slot and pop
					indicesByUUID[ lastObject.uuid ] = firstActiveIndex;
					objects[ firstActiveIndex ] = lastObject;
					objects.pop();

					// accounting is done, now do the same for all bindings

					for ( var j = 0, m = nBindings; j !== m; ++ j ) {

						var bindingsForPath = bindings[ j ],
							lastCached = bindingsForPath[ firstActiveIndex ],
							last = bindingsForPath[ lastIndex ];

						bindingsForPath[ index ] = lastCached;
						bindingsForPath[ firstActiveIndex ] = last;
						bindingsForPath.pop();

					}

				} else {

					// object is active, just swap with the last and pop

					var lastIndex = -- nObjects,
						lastObject = objects[ lastIndex ];

					indicesByUUID[ lastObject.uuid ] = index;
					objects[ index ] = lastObject;
					objects.pop();

					// accounting is done, now do the same for all bindings

					for ( var j = 0, m = nBindings; j !== m; ++ j ) {

						var bindingsForPath = bindings[ j ];

						bindingsForPath[ index ] = bindingsForPath[ lastIndex ];
						bindingsForPath.pop();

					}

				} // cached or active

			} // if object is known

		} // for arguments

		this.nCachedObjects_ = nCachedObjects;

	}
function ( var_args ) { var objects = this . _objects , nObjects = objects . length , nCachedObjects = this . nCachedObjects_ , indicesByUUID = this . _indicesByUUID , bindings = this . _bindings , nBindings = bindings . length ; for ( var i = 0 , n = arguments . length ; i !== n ; ++ i ) { var object = arguments [ i ] , uuid = object . uuid , index = indicesByUUID [ uuid ] ; if ( index !== undefined ) { delete indicesByUUID [ uuid ] ; if ( index < nCachedObjects ) { // object is cached, shrink the CACHED region var firstActiveIndex = -- nCachedObjects , lastCachedObject = objects [ firstActiveIndex ] , lastIndex = -- nObjects , lastObject = objects [ lastIndex ] ; // last cached object takes this object's place indicesByUUID [ lastCachedObject . uuid ] = index ; objects [ index ] = lastCachedObject ; // last object goes to the activated slot and pop indicesByUUID [ lastObject . uuid ] = firstActiveIndex ; objects [ firstActiveIndex ] = lastObject ; objects . pop ( ) ; // accounting is done, now do the same for all bindings for ( var j = 0 , m = nBindings ; j !== m ; ++ j ) { var bindingsForPath = bindings [ j ] , lastCached = bindingsForPath [ firstActiveIndex ] , last = bindingsForPath [ lastIndex ] ; bindingsForPath [ index ] = lastCached ; bindingsForPath [ firstActiveIndex ] = last ; bindingsForPath . pop ( ) ; } } else { // object is active, just swap with the last and pop var lastIndex = -- nObjects , lastObject = objects [ lastIndex ] ; indicesByUUID [ lastObject . uuid ] = index ; objects [ index ] = lastObject ; objects . pop ( ) ; // accounting is done, now do the same for all bindings for ( var j = 0 , m = nBindings ; j !== m ; ++ j ) { var bindingsForPath = bindings [ j ] ; bindingsForPath [ index ] = bindingsForPath [ lastIndex ] ; bindingsForPath . pop ( ) ; } } // cached or active } // if object is known } // for arguments this . nCachedObjects_ = nCachedObjects ; }
remove & forget
remove & forget