mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-09 04:56:01 +10:00
Added progress callback to ColladaLoader.
This commit is contained in:
@@ -49,7 +49,9 @@ THREE.ColladaLoader = function () {
|
||||
|
||||
var TO_RADIANS = Math.PI / 180;
|
||||
|
||||
function load ( url, readyCallback ) {
|
||||
function load ( url, readyCallback, progressCallback ) {
|
||||
|
||||
var length = 0;
|
||||
|
||||
if ( document.implementation && document.implementation.createDocument ) {
|
||||
|
||||
@@ -83,6 +85,20 @@ THREE.ColladaLoader = function () {
|
||||
|
||||
}
|
||||
|
||||
} else if ( req.readyState == 3 ) {
|
||||
|
||||
if ( progressCallback ) {
|
||||
|
||||
if ( length == 0 ) {
|
||||
|
||||
length = req.getResponseHeader( "Content-Length" );
|
||||
|
||||
}
|
||||
|
||||
progressCallback( { total: length, loaded: req.responseText.length } );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user