浏览代码

WebGLObjects: Clean up. See #10603.

Mr.doob 8 年之前
父节点
当前提交
a263586244
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/renderers/webgl/WebGLObjects.js

+ 2 - 4
src/renderers/webgl/WebGLObjects.js

@@ -2,7 +2,7 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-import { BufferAttribute } from '../../core/BufferAttribute';
+import { Uint16BufferAttribute, Uint32BufferAttribute } from '../../core/BufferAttribute';
 import { WebGLGeometries } from './WebGLGeometries';
 
 function WebGLObjects( gl, properties, info ) {
@@ -199,7 +199,6 @@ function WebGLObjects( gl, properties, info ) {
 
 		var index = geometry.index;
 		var attributes = geometry.attributes;
-		var position = attributes.position;
 
 		// console.time( 'wireframe' );
 
@@ -235,8 +234,7 @@ function WebGLObjects( gl, properties, info ) {
 
 		// console.timeEnd( 'wireframe' );
 
-		var TypeArray = Math.max.apply( Math, indices ) > 65535 ? Uint32Array : Uint16Array;
-		var attribute = new BufferAttribute( new TypeArray( indices ), 1 );
+		var attribute = new ( Math.max.apply( Math, indices ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );
 
 		updateAttribute( attribute, gl.ELEMENT_ARRAY_BUFFER );