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

BufferGeometry: Check and report NaN cases in computeBoundingBox/computeBoundinSphere.

上级 bf2f1675
......@@ -149,6 +149,12 @@ THREE.BufferGeometry.prototype = {
}
if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {
console.error( 'THREE.BufferGeometry.computeBoundingBox()', 'Computed min/max have NaN values. The "position" attribute is likely to have NaN values.' );
}
},
computeBoundingSphere: function () {
......@@ -195,6 +201,12 @@ THREE.BufferGeometry.prototype = {
this.boundingSphere.radius = Math.sqrt( maxRadiusSq );
if ( isNaN( this.boundingSphere.radius ) ) {
console.error( 'THREE.BufferGeometry.computeBoundingSphere()', 'Computed radius is NaN. The "position" attribute is likely to have NaN values.' );
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册