Skip to content

Commit 6fb1304

Browse files
committed
(Math) Added alias for Quaternion from axis angle.
1 parent 5c3df2f commit 6fb1304

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

inc/Utils/Math/Quaternion.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ namespace SR_MATH_NS {
5555

5656
static bool IsEqualUsingDot(Unit dot);
5757
static Quaternion FromBasis(const Vector3<Unit>& right, const Vector3<Unit>& up, const Vector3<Unit>& forward);
58+
static Quaternion FromAxisAngle(const Vector3<Unit>& axis, Unit angle);
5859
static Unit Angle(const Quaternion& a, const Quaternion& b);
5960
static Unit Dot(const Quaternion& a, const Quaternion& b);
6061
static Quaternion AngleAxis(float_t angle, const Vector3<float_t>& axis);

src/Utils/Math/Quaternion.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ namespace SR_MATH_NS {
220220
return FromBasis(right, newUp, forward);
221221
}
222222

223+
Quaternion Quaternion::FromAxisAngle(const Vector3<Unit>& axis, Unit angle) {
224+
return AngleAxis(angle, axis);
225+
}
226+
223227
Quaternion Quaternion::LookAt(const Vector3<Unit>& direction, const Vector3<Unit>& up) {
224228
FVector3 normDir = direction.Normalize();
225229
Quaternion q = glm::quatLookAt(glm::vec3(normDir.x, normDir.y, normDir.z), glm::vec3(up.x, up.y, up.z));

0 commit comments

Comments
 (0)