Files
j3ml/include/J3ML/LinearAlgebra/AxisAngle.hpp
2025-03-02 05:20:58 -05:00

26 lines
773 B
C++

#pragma once
#include <J3ML/LinearAlgebra/Vector3.hpp>
#include <J3ML/LinearAlgebra/Forward.hpp>
namespace J3ML::LinearAlgebra {
class AxisAngle;
}
/// Transitional datatype, not useful for internal representation of rotation
/// But has uses for conversion and manipulation.
class J3ML::LinearAlgebra::AxisAngle {
public:
Vector3 axis;
// Radians.
float angle;
public:
AxisAngle();
explicit AxisAngle(const Quaternion& q);
explicit AxisAngle(const EulerAngleXYZ& e);
/// This constructor derives the Quaternion equivalent of the given matrix, and converts that to AxisAngle representation.
explicit AxisAngle(const Matrix3x3& m);
AxisAngle(const Vector3& axis, float angle);
[[nodiscard]] Quaternion ToQuaternion() const;
};