Last change
on this file since 28897 was 28897, checked in by davidb, 10 years ago |
GUI front-end to server base plus web page content
|
File size:
593 bytes
|
Line | |
---|
1 | /**
|
---|
2 | * @author mrdoob / http://mrdoob.com/
|
---|
3 | */
|
---|
4 |
|
---|
5 | THREE.LoadingManager = function ( onLoad, onProgress, onError ) {
|
---|
6 |
|
---|
7 | var scope = this;
|
---|
8 |
|
---|
9 | var loaded = 0, total = 0;
|
---|
10 |
|
---|
11 | this.onLoad = onLoad;
|
---|
12 | this.onProgress = onProgress;
|
---|
13 | this.onError = onError;
|
---|
14 |
|
---|
15 | this.itemStart = function ( url ) {
|
---|
16 |
|
---|
17 | total ++;
|
---|
18 |
|
---|
19 | };
|
---|
20 |
|
---|
21 | this.itemEnd = function ( url ) {
|
---|
22 |
|
---|
23 | loaded ++;
|
---|
24 |
|
---|
25 | if ( scope.onProgress !== undefined ) {
|
---|
26 |
|
---|
27 | scope.onProgress( url, loaded, total );
|
---|
28 |
|
---|
29 | }
|
---|
30 |
|
---|
31 | if ( loaded === total && scope.onLoad !== undefined ) {
|
---|
32 |
|
---|
33 | scope.onLoad();
|
---|
34 |
|
---|
35 | }
|
---|
36 |
|
---|
37 | };
|
---|
38 |
|
---|
39 | };
|
---|
40 |
|
---|
41 | THREE.DefaultLoadingManager = new THREE.LoadingManager();
|
---|
Note:
See
TracBrowser
for help on using the repository browser.