Skip to content

Commit

Permalink
implement getDependency for light extension
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Sep 6, 2022
1 parent ae3775d commit d1c04ec
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,14 @@ class GLTFLightsExtension {

}

getDependency( type, index ) {

if ( type !== 'light' ) return;

return this._loadLight( index );

}

createNodeAttachment( nodeIndex ) {

const self = this;
Expand Down Expand Up @@ -1206,6 +1214,12 @@ class GLTFAnimationPointerExtension {

return depPromise;

}

getDependency( type, index ) {



}

createAnimationTracks( node, inputAccessor, outputAccessor, sampler, target ) {
Expand Down Expand Up @@ -3357,16 +3371,20 @@ class GLTFParser {
dependency = this.loadCamera( index );
break;

case 'light':
default:
dependency = this._invokeOne( function ( ext ) {

return ext._loadLight && ext._loadLight( index );
return ext != this && ext.getDependency && ext.getDependency( type, index );

} );
break;

default:
throw new Error( 'Unknown type: ' + type );
if ( ! dependency ) {

throw new Error( 'Unknown type: ' + type );

}

break;

}

Expand Down

0 comments on commit d1c04ec

Please sign in to comment.