Skip to content

Commit 9ec7a52

Browse files
committed
Added Vector2.normalizeRightHand
1 parent 1439144 commit 9ec7a52

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

v3/src/math/Vector2.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ var Vector2 = new Class({
168168
return this;
169169
},
170170

171+
/**
172+
* Right-hand normalize (make unit length) this Vector
173+
*/
174+
normalizeRightHand: function ()
175+
{
176+
var x = this.x;
177+
178+
this.x = this.y * -1;
179+
this.y = x;
180+
181+
return this;
182+
},
183+
171184
dot: function (src)
172185
{
173186
return this.x * src.x + this.y * src.y;

0 commit comments

Comments
 (0)