|
@@ -68,7 +68,8 @@ THREE.GLTFExporter.prototype = {
|
|
onlyVisible: true,
|
|
onlyVisible: true,
|
|
truncateDrawRange: true,
|
|
truncateDrawRange: true,
|
|
embedImages: true,
|
|
embedImages: true,
|
|
- animations: []
|
|
|
|
|
|
+ animations: [],
|
|
|
|
+ forceIndices: false
|
|
};
|
|
};
|
|
|
|
|
|
options = Object.assign( {}, DEFAULT_OPTIONS, options );
|
|
options = Object.assign( {}, DEFAULT_OPTIONS, options );
|
|
@@ -809,6 +810,18 @@ THREE.GLTFExporter.prototype = {
|
|
|
|
|
|
gltfMesh.primitives[ 0 ].indices = processAccessor( geometry.index, geometry );
|
|
gltfMesh.primitives[ 0 ].indices = processAccessor( geometry.index, geometry );
|
|
|
|
|
|
|
|
+ } else if ( options.forceIndices ) {
|
|
|
|
+
|
|
|
|
+ var numFaces = geometry.attributes.position.count;
|
|
|
|
+ var indices = new Uint32Array( numFaces );
|
|
|
|
+ for ( var i = 0; i < numFaces; i ++ ) {
|
|
|
|
+
|
|
|
|
+ indices[ i ] = i;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ gltfMesh.primitives[ 0 ].indices = processAccessor( new THREE.Uint32BufferAttribute( indices, 1 ), geometry );
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
// We've just one primitive per mesh
|
|
// We've just one primitive per mesh
|