From 2f0c96abe209afa50b76eeca8a645b78aa47f8f1 Mon Sep 17 00:00:00 2001 From: Nejcraft Date: Sat, 20 Feb 2021 14:52:02 +0100 Subject: [PATCH] now it'll work --- Source/Engine/Core/Math/Quaternion.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Core/Math/Quaternion.cs b/Source/Engine/Core/Math/Quaternion.cs index ed09e7307..19eb199fe 100644 --- a/Source/Engine/Core/Math/Quaternion.cs +++ b/Source/Engine/Core/Math/Quaternion.cs @@ -975,8 +975,10 @@ namespace FlaxEngine /// The camera look-at target. /// The camera's up vector. /// The created look-at quaternion. - public static Quaternion LookAt(Vector3 eye, Vector3 target, Vector3 up = Vector3.Up) + public static Quaternion LookAt(Vector3 eye, Vector3 target, Vector3 up = null) { + if(up == null) + up = Vector3.Up; LookAt(ref eye, ref target, ref up, out var result); return result; } @@ -999,8 +1001,10 @@ namespace FlaxEngine /// The camera's forward direction. /// The camera's up vector. /// The created look-at quaternion. - public static Quaternion RotationLookAt(Vector3 forward, Vector3 up = Vector3.Up) + public static Quaternion RotationLookAt(Vector3 forward, Vector3 up = null) { + if(up == null) + up = Vector3.Up; RotationLookAt(ref forward, ref up, out var result); return result; } @@ -1011,8 +1015,10 @@ namespace FlaxEngine /// The forward direction. Direction to orient towards. /// Up direction. Constrains y axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel. /// The calculated quaternion. - public static Quaternion LookRotation(Vector3 forward, Vector3 up = Vector3.Up) + public static Quaternion LookRotation(Vector3 forward, Vector3 up = null) { + if(up == null) + up = Vector3.Up; LookRotation(ref forward, ref up, out var result); return result; }