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

Box3: Return 0,0,0 center if empty. See #9675

上级 f6df06c2
......@@ -204,7 +204,7 @@ Box3.prototype = {
center: function ( optionalTarget ) {
var result = optionalTarget || new Vector3();
return result.addVectors( this.min, this.max ).multiplyScalar( 0.5 );
return this.isEmpty() ? result.set( 0, 0, 0 ) : result.addVectors( this.min, this.max ).multiplyScalar( 0.5 );
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册