提交 b024ac04 编写于 作者: M Mr.doob

Updated builds.

上级 b71af495
......@@ -11881,10 +11881,20 @@ THREE.BufferGeometry.prototype = {
data.data = { attributes: {} };
var attributes = this.attributes;
var groups = this.groups;
var index = this.index;
var boundingSphere = this.boundingSphere;
if ( index !== null ) {
var array = Array.prototype.slice.call( index.array );
data.data.index = {
type: index.array.constructor.name,
array: array
};
}
var attributes = this.attributes;
for ( var key in attributes ) {
......@@ -11900,12 +11910,16 @@ THREE.BufferGeometry.prototype = {
}
var groups = this.groups;
if ( groups.length > 0 ) {
data.data.groups = JSON.parse( JSON.stringify( groups ) );
}
var boundingSphere = this.boundingSphere;
if ( boundingSphere !== null ) {
data.data.boundingSphere = {
......@@ -14062,6 +14076,15 @@ THREE.BufferGeometryLoader.prototype = {
var geometry = new THREE.BufferGeometry();
var index = json.data.index;
if ( index !== undefined ) {
var typedArray = new self[ index.type ]( index.array );
geometry.addIndex( new THREE.BufferAttribute( typedArray, 1 ) );
}
var attributes = json.data.attributes;
for ( var key in attributes ) {
......@@ -14442,6 +14465,15 @@ THREE.ObjectLoader.prototype = {
break;
case 'TextGeometry':
geometry = new THREE.TextGeometry(
data.text,
data.data
);
break;
case 'BufferGeometry':
geometry = bufferGeometryLoader.parse( data );
......@@ -14454,14 +14486,11 @@ THREE.ObjectLoader.prototype = {
break;
case 'TextGeometry':
default:
geometry = new THREE.TextGeometry(
data.text,
data.data
);
console.warn( 'THREE.ObjectLoader: Unsupported geometry type "' + data.type + '"' );
break;
continue;
}
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册