Explorar o código

WebGLObjects: Clean up. See #10603.

Mr.doob %!s(int64=8) %!d(string=hai) anos
pai
achega
a263586244
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      src/renderers/webgl/WebGLObjects.js

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

@@ -2,7 +2,7 @@
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
  */
  */
 
 
-import { BufferAttribute } from '../../core/BufferAttribute';
+import { Uint16BufferAttribute, Uint32BufferAttribute } from '../../core/BufferAttribute';
 import { WebGLGeometries } from './WebGLGeometries';
 import { WebGLGeometries } from './WebGLGeometries';
 
 
 function WebGLObjects( gl, properties, info ) {
 function WebGLObjects( gl, properties, info ) {
@@ -199,7 +199,6 @@ function WebGLObjects( gl, properties, info ) {
 
 
 		var index = geometry.index;
 		var index = geometry.index;
 		var attributes = geometry.attributes;
 		var attributes = geometry.attributes;
-		var position = attributes.position;
 
 
 		// console.time( 'wireframe' );
 		// console.time( 'wireframe' );
 
 
@@ -235,8 +234,7 @@ function WebGLObjects( gl, properties, info ) {
 
 
 		// console.timeEnd( 'wireframe' );
 		// 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 );
 		updateAttribute( attribute, gl.ELEMENT_ARRAY_BUFFER );