From c0ccefc056068f557f53d083dc2e8658de5ec6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20de=20=C3=81vila=20Martins?= Date: Tue, 26 Sep 2017 22:15:59 -0300 Subject: [PATCH 1/2] Change vec2.cross out from vec2 to vec3 There is a mathematical reasoning behind it but I'm in a bit o a hurry to explain. Anyway, it works like this and it's documented like this. http://glmatrix.net/docs/module-vec2.html --- types/gl-matrix/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/gl-matrix/index.d.ts b/types/gl-matrix/index.d.ts index d39496e20d..df55ace30d 100644 --- a/types/gl-matrix/index.d.ts +++ b/types/gl-matrix/index.d.ts @@ -343,7 +343,7 @@ declare module 'gl-matrix' { * @param b the second operand * @returns out */ - public static cross(out: vec2, a: vec2 | number[], b: vec2 | number[]): vec2; + public static cross(out: vec3, a: vec2 | number[], b: vec2 | number[]): vec2; /** * Performs a linear interpolation between two vec2's From 3e28d5d77deec7407273fb400bbe9cb360cfa0d4 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 16 Oct 2017 10:10:25 -0700 Subject: [PATCH 2/2] Fix test --- types/gl-matrix/gl-matrix-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/gl-matrix/gl-matrix-tests.ts b/types/gl-matrix/gl-matrix-tests.ts index 765f871e30..02654491b4 100644 --- a/types/gl-matrix/gl-matrix-tests.ts +++ b/types/gl-matrix/gl-matrix-tests.ts @@ -70,7 +70,7 @@ outVec2 = vec2.negate(outVec2, vec2A); outVec2 = vec2.inverse(outVec2, vec2A); outVec2 = vec2.normalize(outVec2, vec2A); outVal = vec2.dot(vec2A, vec2B); -outVec2 = vec2.cross(outVec2, vec2A, vec2B); +outVec2 = vec2.cross(outVec3, vec2A, vec2B); outVec2 = vec2.lerp(outVec2, vec2A, vec2B, 0.5); outVec2 = vec2.random(outVec2); outVec2 = vec2.random(outVec2, 5.0); @@ -432,7 +432,7 @@ outVec2 = _vec2.negate(outVec2, vec2A); outVec2 = _vec2.inverse(outVec2, vec2A); outVec2 = _vec2.normalize(outVec2, vec2A); outVal = _vec2.dot(vec2A, vec2B); -outVec2 = _vec2.cross(outVec2, vec2A, vec2B); +outVec2 = _vec2.cross(outVec3, vec2A, vec2B); outVec2 = _vec2.lerp(outVec2, vec2A, vec2B, 0.5); outVec2 = _vec2.random(outVec2); outVec2 = _vec2.random(outVec2, 5.0);