From c4cd84c09e8e21e84cca62782420442278322bc5 Mon Sep 17 00:00:00 2001 From: CaptainCarrot Date: Tue, 21 Nov 2017 19:13:35 +0100 Subject: [PATCH] Add files via upload --- glm/gtx/quaternion.inl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl index b29b53d8..31d39e48 100644 --- a/glm/gtx/quaternion.inl +++ b/glm/gtx/quaternion.inl @@ -232,9 +232,9 @@ namespace glm { mat<3, 3, T, Q> Result; - Result[2] = -direction; - Result[0] = normalize(cross(up, Result[2])); - Result[1] = cross(Result[2], Result[0]); + Result[0] = normalize(cross(direction, up)); // new right + Result[1] = cross(Result[0], direction); // new up + Result[2] = -direction; // new forward return quat_cast(Result); } @@ -244,9 +244,9 @@ namespace glm { mat<3, 3, T, Q> Result; - Result[2] = direction; - Result[0] = normalize(cross(up, Result[2])); - Result[1] = cross(Result[2], Result[0]); + Result[0] = normalize(cross(up, direction)); // new right + Result[1] = cross(direction, Result[0]); // new up + Result[2] = direction; // new forward return quat_cast(Result); }