未验证 提交 3544db9e 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #16192 from sciecode/dev4

LWOloader: lwo3 IFF-parsing types fix
...@@ -678,7 +678,7 @@ THREE.LWOLoader = ( function () { ...@@ -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 // In this case, we'll strip out everything and load 'bumpMap.png' from the same directory as the model
cleanPath( path ) { cleanPath( path ) {
if ( path.indexOf( 'Images' ) === 0 ) return './' + path; if ( path.toLowerCase().indexOf( 'images' ) === 0 ) return './' + path;
return path.split( '/' ).pop().split( '\\' ).pop(); return path.split( '/' ).pop().split( '\\' ).pop();
}, },
...@@ -1156,14 +1156,11 @@ THREE.LWOLoader = ( function () { ...@@ -1156,14 +1156,11 @@ THREE.LWOLoader = ( function () {
break; break;
// Skipped LWO2 chunks // Skipped LWO2 chunks
case 'DIFF': // diffuse level, may be necessary to modulate COLR with this 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; break;
case 'TRNL': case 'TRNL':
case 'REFL':
case 'GLOS': case 'GLOS':
case 'SHRP': case 'SHRP':
case 'RFOP': case 'RFOP':
...@@ -1178,6 +1175,7 @@ THREE.LWOLoader = ( function () { ...@@ -1178,6 +1175,7 @@ THREE.LWOLoader = ( function () {
case 'LINE': case 'LINE':
case 'ALPH': case 'ALPH':
case 'VCOL': case 'VCOL':
case 'ENAB':
this.reader.skip( length ); this.reader.skip( length );
break; break;
case 'SURF': case 'SURF':
...@@ -1345,10 +1343,6 @@ THREE.LWOLoader = ( function () { ...@@ -1345,10 +1343,6 @@ THREE.LWOLoader = ( function () {
this.currentSurface.attributes.smooth = ( maxSmoothingAngle < 0 ) ? false : true; this.currentSurface.attributes.smooth = ( maxSmoothingAngle < 0 ) ? false : true;
break; break;
case 'ENAB':
this.currentForm.enabled = this.reader.getUint16();
break;
// LWO2: Basic Surface Parameters // LWO2: Basic Surface Parameters
case 'COLR': case 'COLR':
this.currentSurface.attributes.Color = {}; this.currentSurface.attributes.Color = {};
...@@ -1366,11 +1360,6 @@ THREE.LWOLoader = ( function () { ...@@ -1366,11 +1360,6 @@ THREE.LWOLoader = ( function () {
this.reader.skip( 2 ); this.reader.skip( 2 );
break; break;
case 'REFL':
this.currentSurface.attributes.reflectivity = this.reader.getFloat32();
this.reader.skip( 2 );
break;
case 'TRAN': case 'TRAN':
this.currentSurface.attributes.opacity = this.reader.getFloat32(); this.currentSurface.attributes.opacity = this.reader.getFloat32();
this.reader.skip( 2 ); this.reader.skip( 2 );
...@@ -1484,6 +1473,7 @@ THREE.LWOLoader = ( function () { ...@@ -1484,6 +1473,7 @@ THREE.LWOLoader = ( function () {
// if break; is called directly, the position in the lwoTree is not created // 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 // any sub chunks and forms are added to the parent form instead
case 'META': case 'META':
case 'NNDS':
case 'NODS': case 'NODS':
case 'NDTA': case 'NDTA':
case 'ADAT': case 'ADAT':
...@@ -1566,10 +1556,6 @@ THREE.LWOLoader = ( function () { ...@@ -1566,10 +1556,6 @@ THREE.LWOLoader = ( function () {
this.parseSubNode( length ); this.parseSubNode( length );
break; break;
case 'NNDS':
this.setupForm( 'nodes', length );
break;
case 'ATTR': // BSDF Node Attributes case 'ATTR': // BSDF Node Attributes
case 'SATR': // Standard Node Attributes case 'SATR': // Standard Node Attributes
this.setupForm( 'attributes', length ); this.setupForm( 'attributes', length );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册