mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Common: update Quaternion to allow rotating pitch, yaw, and roll all at once
This commit is contained in:
@ -56,6 +56,13 @@ Quaternion Quaternion::RotateZ(float rad)
|
||||
return Rotate(rad, Vec3(0, 0, 1));
|
||||
}
|
||||
|
||||
Quaternion Quaternion::RotateXYZ(const Vec3& rads)
|
||||
{
|
||||
const auto length = rads.Length();
|
||||
return length ? Common::Quaternion::Rotate(length, rads / length) :
|
||||
Common::Quaternion::Identity();
|
||||
}
|
||||
|
||||
Quaternion Quaternion::Rotate(float rad, const Vec3& axis)
|
||||
{
|
||||
const auto sin_angle_2 = std::sin(rad / 2);
|
||||
|
Reference in New Issue
Block a user