From 8dd9bbd75f40da1dfa6cb35066233969abeda583 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Wed, 18 Nov 2020 21:23:44 +0100 Subject: [PATCH] Add constructor to create Pose from euler angles --- openVulkanoCpp/Math/Pose.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openVulkanoCpp/Math/Pose.hpp b/openVulkanoCpp/Math/Pose.hpp index 67e4d1a..c33f4c0 100644 --- a/openVulkanoCpp/Math/Pose.hpp +++ b/openVulkanoCpp/Math/Pose.hpp @@ -18,10 +18,14 @@ namespace openVulkanoCpp::Math Vector3_SIMD m_position; public: - Pose(Quaternion orientation, Vector3_SIMD position) + Pose(const Quaternion& orientation, const Vector3_SIMD& position) : m_orientation(orientation), m_position(position) {} + Pose(const Math::Vector3_SIMD& eulerAngle, const Vector3f_SIMD& position) + : m_orientation(Math::Utils::qua(eulerAngle)), m_position(position) + {} + [[nodiscard]] Quaternion& GetOrientation() const { return m_orientation; } [[nodiscard]] Vector3_SIMD GetPosition() const { return m_position; } @@ -55,6 +59,10 @@ namespace openVulkanoCpp::Math : m_timestamp(timestamp), Pose(orientation, position) {} + PoseWithTimestamp(Timestamp timestamp, Math::Vector3_SIMD eulerAngle, Vector3_SIMD position) + : m_timestamp(timestamp), Pose(eulerAngle, position) + {} + PoseWithTimestamp(Timestamp timestamp, Pose pose) : m_timestamp(timestamp), Pose(pose) {}