From 355035c49a9e7322311e001bdb0a648048caff6b Mon Sep 17 00:00:00 2001 From: Wayne Langman Date: Wed, 1 Nov 2017 13:52:15 +0200 Subject: [PATCH 1/5] Added missing defintion for, fromEuler(), to Quaternion. --- types/gl-matrix/gl-matrix-tests.ts | 1 + types/gl-matrix/index.d.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/types/gl-matrix/gl-matrix-tests.ts b/types/gl-matrix/gl-matrix-tests.ts index 02654491b4..fa5aabf7bb 100644 --- a/types/gl-matrix/gl-matrix-tests.ts +++ b/types/gl-matrix/gl-matrix-tests.ts @@ -338,6 +338,7 @@ outVal = quat.squaredLength(quatA); outVal = quat.sqrLen(quatA); outQuat = quat.normalize(outQuat, quatA); outVal = quat.dot(quatA, quatB); +outQuat = quat.fromEuler(quatA, deg90, deg90, deg90); outQuat = quat.lerp(outQuat, quatA, quatB, 0.5); outQuat = quat.slerp(outQuat, quatA, quatB, 0.5); outQuat = quat.invert(outQuat, quatA); diff --git a/types/gl-matrix/index.d.ts b/types/gl-matrix/index.d.ts index e698f2d4bb..5040c18247 100644 --- a/types/gl-matrix/index.d.ts +++ b/types/gl-matrix/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Mattijs Kneppers , based on definitions by Tat // Nikolay Babanov // Austin Martin +// Wayne Langman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'gl-matrix' { @@ -2943,6 +2944,18 @@ declare module 'gl-matrix' { */ public static dot(a: quat, b: quat): number; + /** + * Creates a quaternion from the given euler angle x, y, z. + * + * @param {quat} out the receiving quaternion + * @param {x} Angle to rotate around X axis in degrees. + * @param {y} Angle to rotate around Y axis in degrees. + * @param {z} Angle to rotate around Z axis in degrees. + * @returns {quat} out + * @function + */ + public static fromEuler(out: quat, x: number, y: number, z: number): quat; + /** * Performs a linear interpolation between two quat's * From 6e44ebe0779b6aaef366af38092092926540f594 Mon Sep 17 00:00:00 2001 From: Wayne Langman Date: Wed, 1 Nov 2017 14:09:33 +0200 Subject: [PATCH 2/5] Fixed description. --- types/gl-matrix/index.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/gl-matrix/index.d.ts b/types/gl-matrix/index.d.ts index 5040c18247..1c7127fcaa 100644 --- a/types/gl-matrix/index.d.ts +++ b/types/gl-matrix/index.d.ts @@ -2948,11 +2948,10 @@ declare module 'gl-matrix' { * Creates a quaternion from the given euler angle x, y, z. * * @param {quat} out the receiving quaternion - * @param {x} Angle to rotate around X axis in degrees. - * @param {y} Angle to rotate around Y axis in degrees. - * @param {z} Angle to rotate around Z axis in degrees. + * @param {number} x Angle to rotate around X axis in degrees. + * @param {number} y Angle to rotate around Y axis in degrees. + * @param {number} z Angle to rotate around Z axis in degrees. * @returns {quat} out - * @function */ public static fromEuler(out: quat, x: number, y: number, z: number): quat; From 1cd6e1eb4bd3fc47bdffd88af0ce4b5db054e484 Mon Sep 17 00:00:00 2001 From: Wayne Langman Date: Wed, 1 Nov 2017 14:17:03 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Fixed=20the=20test=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/gl-matrix/gl-matrix-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/gl-matrix/gl-matrix-tests.ts b/types/gl-matrix/gl-matrix-tests.ts index fa5aabf7bb..c929323764 100644 --- a/types/gl-matrix/gl-matrix-tests.ts +++ b/types/gl-matrix/gl-matrix-tests.ts @@ -338,7 +338,7 @@ outVal = quat.squaredLength(quatA); outVal = quat.sqrLen(quatA); outQuat = quat.normalize(outQuat, quatA); outVal = quat.dot(quatA, quatB); -outQuat = quat.fromEuler(quatA, deg90, deg90, deg90); +outQuat = quat.fromEuler(outQuat, deg90, deg90, deg90); outQuat = quat.lerp(outQuat, quatA, quatB, 0.5); outQuat = quat.slerp(outQuat, quatA, quatB, 0.5); outQuat = quat.invert(outQuat, quatA); From 7aa4d751a304ba96b3936837b9bd9d8446c7f03b Mon Sep 17 00:00:00 2001 From: Wayne Langman Date: Wed, 1 Nov 2017 14:22:43 +0200 Subject: [PATCH 4/5] Updated the gl-matrix version. --- 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 1c7127fcaa..ed9dcca595 100644 --- a/types/gl-matrix/index.d.ts +++ b/types/gl-matrix/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for gl-matrix 2.3.2 +// Type definitions for gl-matrix 2.4.0 // Project: https://github.com/toji/gl-matrix // Definitions by: Mattijs Kneppers , based on definitions by Tat // Nikolay Babanov From 736cbe1ae88af2ea070171e52e5aba1197e5c07c Mon Sep 17 00:00:00 2001 From: surtr-isaz <31244636+surtr-isaz@users.noreply.github.com> Date: Wed, 8 Nov 2017 09:44:43 +0200 Subject: [PATCH 5/5] Update index.d.ts Fixed version number. --- 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 ed9dcca595..cad714796d 100644 --- a/types/gl-matrix/index.d.ts +++ b/types/gl-matrix/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for gl-matrix 2.4.0 +// Type definitions for gl-matrix 2.4 // Project: https://github.com/toji/gl-matrix // Definitions by: Mattijs Kneppers , based on definitions by Tat // Nikolay Babanov