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

Updated builds.

上级 ef4da53e
......@@ -8371,6 +8371,7 @@ THREE.Object3D.prototype = {
var isRootObject = ( meta === undefined );
var data = {};
var output = { object: data };
// meta is a hash used to collect geometries, materials.
// not providing it implies that this is the root object
......@@ -8385,7 +8386,7 @@ THREE.Object3D.prototype = {
images: {}
};
data.metadata = {
output.metadata = {
version: 4.4,
type: 'Object',
generator: 'Object3D.toJSON'
......@@ -8416,8 +8417,6 @@ THREE.Object3D.prototype = {
}
var output = {};
if ( isRootObject ) {
var geometries = extractFromCache( meta.geometries );
......@@ -8432,8 +8431,6 @@ THREE.Object3D.prototype = {
}
output.object = data;
return output;
// extract data from the cache hash
......@@ -9500,7 +9497,7 @@ THREE.Geometry.prototype = {
}
var addFace = function ( a, b, c ) {
function addFace( a, b, c ) {
var vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : [];
var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : [];
......@@ -10106,6 +10103,18 @@ THREE.Geometry.prototype = {
},
sortFacesByMaterial: function () {
function materialSort( a, b ) {
return a.materialIndex - b.materialIndex;
}
this.faces.sort( materialSort );
},
toJSON: function () {
var data = {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册