Procházet zdrojové kódy

SphereBufferGeometry: Handle Uint16 limit. Fixes #7288.

Mr.doob před 10 roky
rodič
revize
23d6cc56e2
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/extras/geometries/SphereBufferGeometry.js

+ 1 - 1
src/extras/geometries/SphereBufferGeometry.js

@@ -88,7 +88,7 @@ THREE.SphereBufferGeometry = function ( radius, widthSegments, heightSegments, p
 
 	}
 
-	this.setIndex( new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) );
+	this.setIndex( new ( positions.count > 65535 ? THREE.Uint32Attribute : THREE.Uint16Attribute )( indices, 1 ) );
 	this.addAttribute( 'position', positions );
 	this.addAttribute( 'normal', normals );
 	this.addAttribute( 'uv', uvs );

粤ICP备19079148号