Add constructor to create Pose from euler angles

This commit is contained in:
2020-11-18 21:23:44 +01:00
parent 5f53ebd4d5
commit 8dd9bbd75f

View File

@@ -18,10 +18,14 @@ namespace openVulkanoCpp::Math
Vector3_SIMD<T> m_position;
public:
Pose(Quaternion<T> orientation, Vector3_SIMD<T> position)
Pose(const Quaternion<T>& orientation, const Vector3_SIMD<T>& position)
: m_orientation(orientation), m_position(position)
{}
Pose(const Math::Vector3_SIMD<T>& eulerAngle, const Vector3f_SIMD& position)
: m_orientation(Math::Utils::qua(eulerAngle)), m_position(position)
{}
[[nodiscard]] Quaternion<T>& GetOrientation() const { return m_orientation; }
[[nodiscard]] Vector3_SIMD<T> GetPosition() const { return m_position; }
@@ -55,6 +59,10 @@ namespace openVulkanoCpp::Math
: m_timestamp(timestamp), Pose<T>(orientation, position)
{}
PoseWithTimestamp(Timestamp timestamp, Math::Vector3_SIMD<T> eulerAngle, Vector3_SIMD<T> position)
: m_timestamp(timestamp), Pose<T>(eulerAngle, position)
{}
PoseWithTimestamp(Timestamp timestamp, Pose<T> pose)
: m_timestamp(timestamp), Pose<T>(pose)
{}