Преглед изворни кода

SphereBufferGeometry: Handle Uint16 limit. Fixes #7288.

Mr.doob пре 9 година
родитељ
комит
23d6cc56e2
1 измењених фајлова са 1 додато и 1 уклоњено
  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 );