Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions examples/js/loaders/LWOLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ THREE.LWOLoader = ( function () {
// In this case, we'll strip out everything and load 'bumpMap.png' from the same directory as the model
cleanPath( path ) {

if ( path.indexOf( 'Images' ) === 0 ) return './' + path;
if ( path.toLowerCase().indexOf( 'images' ) === 0 ) return './' + path;
return path.split( '/' ).pop().split( '\\' ).pop();

},
Expand Down Expand Up @@ -1156,14 +1156,11 @@ THREE.LWOLoader = ( function () {
break;
// Skipped LWO2 chunks
case 'DIFF': // diffuse level, may be necessary to modulate COLR with this
if ( this.tree.format === 'LWO2' ) {

this.currentSurface.diffusePower = this.reader.getFloat32();
this.reader.skip( 2 );

}
this.currentSurface.diffusePower = this.reader.getFloat32();
this.reader.skip( 2 );
break;
case 'TRNL':
case 'REFL':
case 'GLOS':
case 'SHRP':
case 'RFOP':
Expand All @@ -1178,6 +1175,7 @@ THREE.LWOLoader = ( function () {
case 'LINE':
case 'ALPH':
case 'VCOL':
case 'ENAB':
this.reader.skip( length );
break;
case 'SURF':
Expand Down Expand Up @@ -1345,10 +1343,6 @@ THREE.LWOLoader = ( function () {
this.currentSurface.attributes.smooth = ( maxSmoothingAngle < 0 ) ? false : true;
break;

case 'ENAB':
this.currentForm.enabled = this.reader.getUint16();
break;

// LWO2: Basic Surface Parameters
case 'COLR':
this.currentSurface.attributes.Color = {};
Expand All @@ -1366,11 +1360,6 @@ THREE.LWOLoader = ( function () {
this.reader.skip( 2 );
break;

case 'REFL':
this.currentSurface.attributes.reflectivity = this.reader.getFloat32();
this.reader.skip( 2 );
break;

case 'TRAN':
this.currentSurface.attributes.opacity = this.reader.getFloat32();
this.reader.skip( 2 );
Expand Down Expand Up @@ -1484,6 +1473,7 @@ THREE.LWOLoader = ( function () {
// if break; is called directly, the position in the lwoTree is not created
// any sub chunks and forms are added to the parent form instead
case 'META':
case 'NNDS':
case 'NODS':
case 'NDTA':
case 'ADAT':
Expand Down Expand Up @@ -1566,10 +1556,6 @@ THREE.LWOLoader = ( function () {
this.parseSubNode( length );
break;

case 'NNDS':
this.setupForm( 'nodes', length );
break;

case 'ATTR': // BSDF Node Attributes
case 'SATR': // Standard Node Attributes
this.setupForm( 'attributes', length );
Expand Down