Overloaded
This commit is contained in:
@@ -967,7 +967,17 @@ namespace FlaxEngine
|
||||
Matrix3x3.LookAt(ref eye, ref target, ref up, out var matrix);
|
||||
RotationMatrix(ref matrix, out result);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a left-handed, look-at quaternion.
|
||||
/// </summary>
|
||||
/// <param name="eye">The position of the viewer's eye.</param>
|
||||
/// <param name="target">The camera look-at target.</param>
|
||||
/// <returns>The created look-at quaternion.</returns>
|
||||
public static Quaternion LookAt(Vector3 eye, Vector3 target){
|
||||
return LookAt(eye, target, Vector3.Up);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a left-handed, look-at quaternion.
|
||||
/// </summary>
|
||||
@@ -975,10 +985,8 @@ namespace FlaxEngine
|
||||
/// <param name="target">The camera look-at target.</param>
|
||||
/// <param name="up">The camera's up vector.</param>
|
||||
/// <returns>The created look-at quaternion.</returns>
|
||||
public static Quaternion LookAt(Vector3 eye, Vector3 target, Vector3 up = null)
|
||||
public static Quaternion LookAt(Vector3 eye, Vector3 target, Vector3 up)
|
||||
{
|
||||
if(up == null)
|
||||
up = Vector3.Up;
|
||||
LookAt(ref eye, ref target, ref up, out var result);
|
||||
return result;
|
||||
}
|
||||
@@ -995,20 +1003,38 @@ namespace FlaxEngine
|
||||
LookAt(ref eye, ref forward, ref up, out result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a left-handed, look-at quaternion.
|
||||
/// </summary>
|
||||
/// <param name="forward">The camera's forward direction.</param>
|
||||
/// <returns>The created look-at quaternion.</returns>
|
||||
public static Quaternion RotationLookAt(Vector3 forward)
|
||||
{
|
||||
return RotationLookAt(forward, Vector3.Up);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a left-handed, look-at quaternion.
|
||||
/// </summary>
|
||||
/// <param name="forward">The camera's forward direction.</param>
|
||||
/// <param name="up">The camera's up vector.</param>
|
||||
/// <returns>The created look-at quaternion.</returns>
|
||||
public static Quaternion RotationLookAt(Vector3 forward, Vector3 up = null)
|
||||
public static Quaternion RotationLookAt(Vector3 forward, Vector3 up)
|
||||
{
|
||||
if(up == null)
|
||||
up = Vector3.Up;
|
||||
RotationLookAt(ref forward, ref up, out var result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a rotation with the specified forward and upwards directions.
|
||||
/// </summary>
|
||||
/// <param name="forward">The forward direction. Direction to orient towards.</param>
|
||||
/// <returns>The calculated quaternion.</returns>
|
||||
public static Quaternion LookRotation(Vector3 forward)
|
||||
{
|
||||
return LookRotation(forward, Vector3.Up);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a rotation with the specified forward and upwards directions.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user