mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Added Vector2.normalizeRightHand
This commit is contained in:
parent
1439144fae
commit
9ec7a52dcc
1 changed files with 13 additions and 0 deletions
|
@ -168,6 +168,19 @@ var Vector2 = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Right-hand normalize (make unit length) this Vector
|
||||
*/
|
||||
normalizeRightHand: function ()
|
||||
{
|
||||
var x = this.x;
|
||||
|
||||
this.x = this.y * -1;
|
||||
this.y = x;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
dot: function (src)
|
||||
{
|
||||
return this.x * src.x + this.y * src.y;
|
||||
|
|
Loading…
Reference in a new issue