提交 f2c9797b 编写于 作者: M Mugen87

Quaternion: Simplify .angleTo()

上级 e1ed8172
......@@ -393,21 +393,11 @@ Object.assign( Quaternion.prototype, {
}(),
angleTo: function () {
angleTo: function ( q ) {
var p = new Quaternion();
return 2 * Math.acos( Math.abs( this.dot( q ) ) );
return function angleTo( q ) {
p.copy( this ).inverse();
p.premultiply( q );
return 2 * Math.acos( p.w );
};
}(),
},
inverse: function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册