diff --git a/Source/Engine/Core/Math/Quaternion.cs b/Source/Engine/Core/Math/Quaternion.cs index f3bc66f76..7dc5b6826 100644 --- a/Source/Engine/Core/Math/Quaternion.cs +++ b/Source/Engine/Core/Math/Quaternion.cs @@ -967,7 +967,17 @@ namespace FlaxEngine Matrix3x3.LookAt(ref eye, ref target, ref up, out var matrix); RotationMatrix(ref matrix, out result); } - + + /// + /// Creates a left-handed, look-at quaternion. + /// + /// The position of the viewer's eye. + /// The camera look-at target. + /// The created look-at quaternion. + public static Quaternion LookAt(Vector3 eye, Vector3 target){ + return LookAt(eye, target, Vector3.Up); + } + /// /// Creates a left-handed, look-at quaternion. /// @@ -993,6 +1003,16 @@ namespace FlaxEngine LookAt(ref eye, ref forward, ref up, out result); } + /// + /// Creates a left-handed, look-at quaternion. + /// + /// The camera's forward direction. + /// The created look-at quaternion. + public static Quaternion RotationLookAt(Vector3 forward) + { + return RotationLookAt(forward, Vector3.Up); + } + /// /// Creates a left-handed, look-at quaternion. /// @@ -1005,6 +1025,16 @@ namespace FlaxEngine return result; } + /// + /// Creates a rotation with the specified forward and upwards directions. + /// + /// The forward direction. Direction to orient towards. + /// The calculated quaternion. + public static Quaternion LookRotation(Vector3 forward) + { + return LookRotation(forward, Vector3.Up); + } + /// /// Creates a rotation with the specified forward and upwards directions. ///