@@ -21,6 +21,7 @@ import { MaterialHandler } from "./obj2/shared/MaterialHandler.js";
2121 * @constructor
2222 */
2323const OBJLoader2 = function ( manager ) {
24+
2425 Loader . call ( this , manager ) ;
2526
2627 this . parser = new OBJLoader2Parser ( ) ;
@@ -35,9 +36,12 @@ const OBJLoader2 = function ( manager ) {
3536 // as OBJLoader2 is no longer derived from OBJLoader2Parser, we need to override the default onAssetAvailable callback
3637 let scope = this ;
3738 let defaultOnAssetAvailable = function ( payload ) {
38- scope . _onAssetAvailable ( payload )
39+
40+ scope . _onAssetAvailable ( payload ) ;
41+
3942 } ;
4043 this . parser . setCallbackOnAssetAvailable ( defaultOnAssetAvailable ) ;
44+
4145} ;
4246
4347OBJLoader2 . OBJLOADER2_VERSION = '3.1.0' ;
@@ -124,7 +128,7 @@ OBJLoader2.prototype = Object.assign( Object.create( Loader.prototype ), {
124128 */
125129 setBaseObject3d : function ( baseObject3d ) {
126130
127- this . baseObject3d = ( baseObject3d === undefined || baseObject3d === null ) ? this . baseObject3d : baseObject3d ;
131+ this . baseObject3d = ( baseObject3d === undefined || baseObject3d === null ) ? this . baseObject3d : baseObject3d ;
128132 return this ;
129133
130134 } ,
@@ -224,19 +228,18 @@ OBJLoader2.prototype = Object.assign( Object.create( Loader.prototype ), {
224228 load : function ( url , onLoad , onFileLoadProgress , onError , onMeshAlter ) {
225229
226230 let scope = this ;
227- if ( onLoad === null || onLoad === undefined || ! ( onLoad instanceof Function ) ) {
231+ if ( onLoad === null || onLoad === undefined || ! ( onLoad instanceof Function ) ) {
228232
229233 let errorMessage = 'onLoad is not a function! Aborting...' ;
230234 scope . parser . callbacks . onError ( errorMessage ) ;
231- throw errorMessage
235+ throw errorMessage ;
232236
233- }
234- else {
237+ } else {
235238
236239 this . parser . setCallbackOnLoad ( onLoad ) ;
237240
238241 }
239- if ( onError === null || onError === undefined || ! ( onError instanceof Function ) ) {
242+ if ( onError === null || onError === undefined || ! ( onError instanceof Function ) ) {
240243
241244 onError = function ( event ) {
242245
@@ -251,7 +254,7 @@ OBJLoader2.prototype = Object.assign( Object.create( Loader.prototype ), {
251254 } ;
252255
253256 }
254- if ( ! url ) {
257+ if ( ! url ) {
255258
256259 onError ( 'An invalid url was provided. Unable to continue!' ) ;
257260
@@ -266,19 +269,19 @@ OBJLoader2.prototype = Object.assign( Object.create( Loader.prototype ), {
266269 if ( urlPartsPath !== undefined && urlPartsPath !== null ) this . path = urlPartsPath ;
267270
268271 }
269- if ( onFileLoadProgress === null || onFileLoadProgress === undefined || ! ( onFileLoadProgress instanceof Function ) ) {
272+ if ( onFileLoadProgress === null || onFileLoadProgress === undefined || ! ( onFileLoadProgress instanceof Function ) ) {
270273
271274 let numericalValueRef = 0 ;
272275 let numericalValue = 0 ;
273276 onFileLoadProgress = function ( event ) {
274277
275- if ( ! event . lengthComputable ) return ;
278+ if ( ! event . lengthComputable ) return ;
276279
277280 numericalValue = event . loaded / event . total ;
278281 if ( numericalValue > numericalValueRef ) {
279282
280283 numericalValueRef = numericalValue ;
281- let output = 'Download of "' + url + '": ' + ( numericalValue * 100 ) . toFixed ( 2 ) + '%' ;
284+ let output = 'Download of "' + url + '": ' + ( numericalValue * 100 ) . toFixed ( 2 ) + '%' ;
282285 scope . parser . callbacks . onProgress ( 'progressLoad' , output , numericalValue ) ;
283286
284287 }
@@ -331,7 +334,7 @@ OBJLoader2.prototype = Object.assign( Object.create( Loader.prototype ), {
331334 if ( this . parser . logging . enabled ) console . info ( 'Parsing arrayBuffer...' ) ;
332335 this . parser . execute ( content ) ;
333336
334- } else if ( typeof ( content ) === 'string' || content instanceof String ) {
337+ } else if ( typeof ( content ) === 'string' || content instanceof String ) {
335338
336339 if ( this . parser . logging . enabled ) console . info ( 'Parsing text...' ) ;
337340 this . parser . executeLegacy ( content ) ;
0 commit comments