@@ -125,7 +125,7 @@ THREE.AssimpJSONLoader.prototype = {
}
- geometry.setIndexArray( indices );
+ geometry.setIndex( indices );
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
if ( normals.length > 0 ) {
@@ -263,7 +263,7 @@
if ( geoNode.indices !== undefined && geoNode.indices.length > 0 ) {
- tmpGeo.setIndexArray( geoNode.indices );
+ tmpGeo.setIndex( geoNode.indices );
@@ -1477,7 +1477,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
var initGeometry = function () {
- geometry.setIndexArray( buffer.indices );
+ geometry.setIndex( buffer.indices );
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( buffer.vertices, 3 ) );
geometry.addAttribute( 'normal', new THREE.Float32BufferAttribute( buffer.normals, 3 ) );
geometry.addAttribute( 'uv', new THREE.Float32BufferAttribute( buffer.uvs, 2 ) );
@@ -314,7 +314,7 @@ THREE.PLYLoader.prototype = {
if ( buffer.indices.length > 0 ) {
@@ -52,13 +52,15 @@ BufferGeometry.prototype = {
setIndex: function ( index ) {
- this.index = index;
+ if ( Array.isArray( index ) ) {
- },
+ this.index = new ( _Math.arrayMax( index ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 );
+
+ } else {
- setIndexArray: function ( indices ) {
+ this.index = index;
- this.index = new ( _Math.arrayMax( indices ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );
+ }
},
@@ -82,7 +82,7 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments,
// build geometry
- this.setIndexArray( indices );
+ this.setIndex( indices );
this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
@@ -106,7 +106,7 @@ function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) {
@@ -96,7 +96,7 @@ function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments
@@ -135,7 +135,7 @@ function LatheBufferGeometry( points, segments, phiStart, phiLength ) {
@@ -100,7 +100,7 @@ function ParametricBufferGeometry( func, slices, stacks ) {
@@ -112,7 +112,7 @@ function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) {
@@ -137,7 +137,7 @@ function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegment
@@ -87,7 +87,7 @@ function ShapeBufferGeometry( shapes, curveSegments ) {
@@ -137,7 +137,7 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
@@ -128,7 +128,7 @@ function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc
@@ -166,7 +166,7 @@ function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments,
@@ -101,7 +101,7 @@ function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, clos