Parcourir la source

USDZLoader: Fix index array type. (#26751)

* USDZ Loader - fix index array type

- Current `Uint16Array` type might cause spaghetti-like effect when opening some USDZ models
- Changed to `Uint32Array` type

* Switch to automatic type detection

- As per @Mugen87 suggestion
GitHubDragonFly il y a 1 an
Parent
commit
b25c90c4e1
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      examples/jsm/loaders/USDZLoader.js

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

@@ -368,7 +368,7 @@ class USDZLoader extends Loader {
 			if ( 'int[] faceVertexIndices' in data ) {
 
 				const indices = JSON.parse( data[ 'int[] faceVertexIndices' ] );
-				geometry.setIndex( new BufferAttribute( new Uint16Array( indices ), 1 ) );
+				geometry.setIndex( indices );
 
 			}