From 9ec7a52dcc4e1cbfa0a909f1fcaeb8f9bf682fd5 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 21 Sep 2017 02:03:37 +0100 Subject: [PATCH] Added Vector2.normalizeRightHand --- v3/src/math/Vector2.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/v3/src/math/Vector2.js b/v3/src/math/Vector2.js index 22bf5f36a..bb284d66d 100644 --- a/v3/src/math/Vector2.js +++ b/v3/src/math/Vector2.js @@ -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;