提交 c1799412 编写于 作者: M Mr.doob

Merge branch 'master' into dev

......@@ -65,7 +65,7 @@ This code creates a scene, then creates a camera, adds the camera and cube to th
### Change log ###
2012 09 15 - **r51** (405,240 KB, gzip: 99,326 KB)
2012 09 15 - **r51** (405,491 KB, gzip: 99,389 KB)
* Added `STLLoader`. ([aleeper](http://github.com/aleeper) and [mrdoob](http://github.com/mrdoob))
* Optimised `Ray` (2x faster). ([gero3](http://github.com/gero3))
......
......@@ -8157,6 +8157,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/
......
......@@ -34,9 +34,6 @@
<script src="../build/three.min.js"></script>
<script src="../src/loaders/LoadingMonitor.js"></script>
<script src="../src/loaders/GeometryLoader.js"></script>
<script src="js/loaders/ColladaLoader.js"></script>
<script src="js/Detector.js"></script>
......
......@@ -35,6 +35,7 @@
"../src/loaders/BinaryLoader.js",
"../src/loaders/ImageLoader.js",
"../src/loaders/JSONLoader.js",
"../src/loaders/LoadingMonitor.js",
"../src/loaders/GeometryLoader.js",
"../src/loaders/SceneLoader.js",
"../src/loaders/TextureLoader.js",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册