소스 검색

GLTFLoader: Fix usage of ImageBitmapLoader.

Mugen87 5 년 전
부모
커밋
4a34bd7635
4개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      examples/js/loaders/GLTFLoader.js
  2. 1 1
      examples/jsm/loaders/GLTFLoader.js
  3. 2 0
      src/loaders/ImageBitmapLoader.d.ts
  4. 2 0
      src/loaders/ImageBitmapLoader.js

+ 1 - 1
examples/js/loaders/GLTFLoader.js

@@ -2013,7 +2013,7 @@ THREE.GLTFLoader = ( function () {
 
 				var onLoad = resolve;
 
-				if ( useImageBitmap ) {
+				if ( loader.isImageBitmapLoader === true ) {
 
 					onLoad = function ( imageBitmap ) {
 

+ 1 - 1
examples/jsm/loaders/GLTFLoader.js

@@ -2078,7 +2078,7 @@ var GLTFLoader = ( function () {
 
 				var onLoad = resolve;
 
-				if ( useImageBitmap ) {
+				if ( loader.isImageBitmapLoader === true ) {
 
 					onLoad = function ( imageBitmap ) {
 

+ 2 - 0
src/loaders/ImageBitmapLoader.d.ts

@@ -7,6 +7,8 @@ export class ImageBitmapLoader extends Loader {
 
 	options: undefined | object;
 
+	readonly isImageBitmapLoader: true;
+
 	setOptions( options: object ): ImageBitmapLoader;
 	load(
 		url: string,

+ 2 - 0
src/loaders/ImageBitmapLoader.js

@@ -30,6 +30,8 @@ ImageBitmapLoader.prototype = Object.assign( Object.create( Loader.prototype ),
 
 	constructor: ImageBitmapLoader,
 
+	isImageBitmapLoader: true,
+
 	setOptions: function setOptions( options ) {
 
 		this.options = options;