@@ -28,19 +28,15 @@ THREE.UTF8Loader.prototype.load = function ( jsonUrl, callback, options ) {
2828THREE . UTF8Loader . BufferGeometryCreator = function ( ) {
2929} ;
3030
31- THREE . UTF8Loader . BufferGeometryCreator . prototype . create = function ( attribArray , indexArray ) {
31+ THREE . UTF8Loader . BufferGeometryCreator . prototype . create = function ( attribArray , indices ) {
3232
33- var ntris = indexArray . length / 3 ;
33+ var ntris = indices . length / 3 ;
3434
3535 var geometry = new THREE . BufferGeometry ( ) ;
3636
37- var positions = new THREE . Float32Attribute ( ntris * 3 , 3 ) ;
38- var normals = new THREE . Float32Attribute ( ntris * 3 , 3 ) ;
39- var uvs = new THREE . Float32Attribute ( ntris * 3 , 2 ) ;
40-
41- var positionsArray = positions . array ;
42- var normalsArray = normals . array ;
43- var uvsArray = uvs . array ;
37+ var positions = new Float32Array ( ntris * 3 * 3 ) ;
38+ var normals = new Float32Array ( ntris * 3 * 3 ) ;
39+ var uvs = new Float32Array ( ntris * 3 * 2 ) ;
4440
4541 var i , j , offset ;
4642 var x , y , z ;
@@ -60,9 +56,9 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
6056 y = attribArray [ i + 1 ] ;
6157 z = attribArray [ i + 2 ] ;
6258
63- positionsArray [ j ++ ] = x ;
64- positionsArray [ j ++ ] = y ;
65- positionsArray [ j ++ ] = z ;
59+ positions [ j ++ ] = x ;
60+ positions [ j ++ ] = y ;
61+ positions [ j ++ ] = z ;
6662
6763 }
6864
@@ -76,8 +72,8 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
7672 u = attribArray [ i ] ;
7773 v = attribArray [ i + 1 ] ;
7874
79- uvsArray [ j ++ ] = u ;
80- uvsArray [ j ++ ] = v ;
75+ uvs [ j ++ ] = u ;
76+ uvs [ j ++ ] = v ;
8177
8278 }
8379
@@ -92,18 +88,18 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
9288 y = attribArray [ i + 1 ] ;
9389 z = attribArray [ i + 2 ] ;
9490
95- normalsArray [ j ++ ] = x ;
96- normalsArray [ j ++ ] = y ;
97- normalsArray [ j ++ ] = z ;
91+ normals [ j ++ ] = x ;
92+ normals [ j ++ ] = y ;
93+ normals [ j ++ ] = z ;
9894
9995 }
10096
101- geometry . addAttribute ( 'index' , indexArray , 1 ) ;
102- geometry . addAttribute ( 'position' , positions ) ;
103- geometry . addAttribute ( 'normal' , normals ) ;
104- geometry . addAttribute ( 'uv' , uvs ) ;
97+ geometry . addAttribute ( 'index' , new THREE . Uint32Attribute ( indices , 1 ) ) ;
98+ geometry . addAttribute ( 'position' , new THREE . Float32Attribute ( positions , 3 ) ) ;
99+ geometry . addAttribute ( 'normal' , new THREE . Float32Attribute ( normals , 3 ) ) ;
100+ geometry . addAttribute ( 'uv' , new THREE . Float32Attribute ( uvs , 2 ) ) ;
105101
106- geometry . offsets . push ( { start : 0 , count : indexArray . length , index : 0 } ) ;
102+ geometry . offsets . push ( { start : 0 , count : indices . length , index : 0 } ) ;
107103
108104 geometry . computeBoundingSphere ( ) ;
109105
0 commit comments