From 66493ddd513363fc6b1c3f8e9d008e73938d9451 Mon Sep 17 00:00:00 2001 From: Forrest Sun Date: Sun, 15 Oct 2023 21:52:37 -0700 Subject: [PATCH] Fix cross product of vec2 the output type of vec2 cross product is incorrect --- src/vec2-impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vec2-impl.ts b/src/vec2-impl.ts index 5e1169a..61a6413 100644 --- a/src/vec2-impl.ts +++ b/src/vec2-impl.ts @@ -358,7 +358,7 @@ export const invert = inverse; * @param dst - vector to hold result. If not passed in a new one is created. * @returns The vector of a cross b. */ -export function cross(a: Vec2, b: Vec2, dst?: Vec2): Vec2 { +export function cross(a: Vec2, b: Vec2, dst?: Vec3): Vec3 { dst = dst || new VecType(3); const z = a[0] * b[1] - a[1] * b[0]; dst[0] = 0;