未验证 提交 e9420ca7 编写于 作者: M Michael Herzog 提交者: GitHub

Merge pull request #17583 from Mugen87/dev34

Vector3: Improve feedback of .angleTo().
......@@ -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.
先完成此消息的编辑!
想要评论请 注册