From 6d664fd668b519751c03b635fac2763dfdf4858e Mon Sep 17 00:00:00 2001 From: Triplelexx Date: Tue, 21 Mar 2017 19:54:32 +0000 Subject: [PATCH] add getForward, getFront returns getForward getForward better describes the returned vector as a direction --- libraries/script-engine/src/Quat.cpp | 5 +++++ libraries/script-engine/src/Quat.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/script-engine/src/Quat.cpp b/libraries/script-engine/src/Quat.cpp index 6c2e7a349e..64d1c294c6 100644 --- a/libraries/script-engine/src/Quat.cpp +++ b/libraries/script-engine/src/Quat.cpp @@ -68,7 +68,12 @@ glm::quat Quat::inverse(const glm::quat& q) { return glm::inverse(q); } +// redundant, calls getForward which better describes the returned vector as a direction glm::vec3 Quat::getFront(const glm::quat& orientation) { + return getForward(orientation); +} + +glm::vec3 Quat::getForward(const glm::quat& orientation) { return orientation * Vectors::FRONT; } diff --git a/libraries/script-engine/src/Quat.h b/libraries/script-engine/src/Quat.h index b51f1cb47e..6a15bbac83 100644 --- a/libraries/script-engine/src/Quat.h +++ b/libraries/script-engine/src/Quat.h @@ -45,7 +45,8 @@ public slots: glm::quat fromPitchYawRollDegrees(float pitch, float yaw, float roll); // degrees glm::quat fromPitchYawRollRadians(float pitch, float yaw, float roll); // radians glm::quat inverse(const glm::quat& q); - glm::vec3 getFront(const glm::quat& orientation); + glm::vec3 getFront(const glm::quat& orientation); // redundant, calls getForward which better describes the returned vector as a direction + glm::vec3 getForward(const glm::quat& orientation); glm::vec3 getRight(const glm::quat& orientation); glm::vec3 getUp(const glm::quat& orientation); glm::vec3 safeEulerAngles(const glm::quat& orientation); // degrees