Skip to content

Commit

Permalink
Add missing LoadingMonitor in the source
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Pfenniger committed Sep 30, 2012
1 parent 8707cc2 commit 19d815f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 10 deletions.
36 changes: 36 additions & 0 deletions build/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -8134,6 +8134,42 @@ THREE.JSONLoader.prototype.createModel = function ( json, callback, texturePath
callback( geometry );

};
/**
* @author mrdoob / http://mrdoob.com/
*/

THREE.LoadingMonitor = function () {

THREE.EventTarget.call( this );

var scope = this;

var loaded = 0;
var total = 0;

var onLoad = function ( event ) {

loaded ++;

scope.dispatchEvent( { type: 'progress', loaded: loaded, total: total } );

if ( loaded === total ) {

scope.dispatchEvent( { type: 'load' } );

}

};

this.add = function ( loader ) {

total ++;

loader.addEventListener( 'load', onLoad, false );

};

};
/**
* @author mrdoob / http://mrdoob.com/
* @author alteredq / http://alteredqualia.com/
Expand Down
Loading

0 comments on commit 19d815f

Please sign in to comment.