提交 04c1ca5e 编写于 作者: M Mugen87

Vector3: Improve feedback of .angleTo().

上级 6e6f5f51
......@@ -557,7 +557,11 @@ Object.assign( Vector3.prototype, {
// assumes this and v are not the zero vector
var theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) );
var denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );
if ( denominator === 0 ) console.error( 'THREE.Vector3: angleTo() does not accept zero vectors.' );
var theta = this.dot( v ) / denominator;
// clamp, to handle numerical problems
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册