From 87471b1b12d81cb69be62fed3dc345165d39a15a Mon Sep 17 00:00:00 2001 From: polygonboutique Date: Tue, 22 Nov 2016 16:10:03 +0100 Subject: [PATCH] ABORT ABORT ABORT --- src/game-lib-vector-3.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game-lib-vector-3.js b/src/game-lib-vector-3.js index d6396e7..6b5d802 100644 --- a/src/game-lib-vector-3.js +++ b/src/game-lib-vector-3.js @@ -12,6 +12,14 @@ GameLib.D3.Vector3.prototype.subtract = function (v) { ); }; +GameLib.D3.Vector3.prototype.sub = function (v) { + return new GameLib.D3.Vector3( + this.x - v.x, + this.y - v.y, + this.z - v.z + ); +}; + GameLib.D3.Vector3.prototype.cross = function (v) { return new GameLib.D3.Vector3( this.y * v.z - this.z * v.y, @@ -137,7 +145,7 @@ GameLib.D3.Vector3.prototype.multiply = function (s) { z ); - } else if(isNumber(s)) { + } else if(!isNaN(parseFloat(s)) && isFinite(s)) { return new GameLib.D3.Vector3( this.x * s,