提交 a5607c64 编写于 作者: M Mugen87

GLTFExporter: Better support interleaved data in getMinMax().

上级 71fe47ad
......@@ -212,7 +212,23 @@ THREE.GLTFExporter.prototype = {
for ( var a = 0; a < attribute.itemSize; a ++ ) {
var value = attribute.array[ i * attribute.itemSize + a ];
var value;
if ( attribute.itemSize > 4 ) {
// no support for interleaved data for itemSize > 4
value = attribute.array[ i * attribute.itemSize + a ];
} else {
if ( a === 0 ) value = attribute.getX( i );
else if ( a === 1 ) value = attribute.getY( i );
else if ( a === 2 ) value = attribute.getZ( i );
else if ( a === 3 ) value = attribute.getW( i );
}
output.min[ a ] = Math.min( output.min[ a ], value );
output.max[ a ] = Math.max( output.max[ a ], value );
......
......@@ -235,7 +235,23 @@ GLTFExporter.prototype = {
for ( var a = 0; a < attribute.itemSize; a ++ ) {
var value = attribute.array[ i * attribute.itemSize + a ];
var value;
if ( attribute.itemSize > 4 ) {
// no support for interleaved data for itemSize > 4
value = attribute.array[ i * attribute.itemSize + a ];
} else {
if ( a === 0 ) value = attribute.getX( i );
else if ( a === 1 ) value = attribute.getY( i );
else if ( a === 2 ) value = attribute.getZ( i );
else if ( a === 3 ) value = attribute.getW( i );
}
output.min[ a ] = Math.min( output.min[ a ], value );
output.max[ a ] = Math.max( output.max[ a ], value );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册