Merge branch 'change-lookingatdirection-name' of https://github.com/Duroxxigar/FlaxEngine into Duroxxigar-change-lookingatdirection-name

This commit is contained in:
2026-05-12 18:21:31 +02:00
2 changed files with 28 additions and 1 deletions
+10
View File
@@ -1730,6 +1730,11 @@ void Actor::LookAt(const Vector3& worldPos, const Vector3& worldUp)
}
Quaternion Actor::LookingAt(const Vector3& worldPos) const
{
return GetLookAtDirection(worldPos);
}
Quaternion Actor::GetLookAtDirection(const Vector3& worldPos) const
{
const Vector3 direction = worldPos - _transform.Translation;
if (direction.LengthSquared() < ZeroTolerance)
@@ -1757,6 +1762,11 @@ Quaternion Actor::LookingAt(const Vector3& worldPos) const
}
Quaternion Actor::LookingAt(const Vector3& worldPos, const Vector3& worldUp) const
{
return GetLookAtDirection(worldPos, worldUp);
}
Quaternion Actor::GetLookAtDirection(const Vector3& worldPos, const Vector3& worldUp) const
{
const Vector3 direction = worldPos - _transform.Translation;
if (direction.LengthSquared() < ZeroTolerance)
+18 -1
View File
@@ -915,16 +915,33 @@ public:
/// <summary>
/// Gets rotation of the actor oriented towards the specified world position.
/// [Deprecated in v1.13]
/// </summary>
/// <param name="worldPos">The world position to orient towards.</param>
DEPRECATED("Use GetLookAtDirection instead.")
API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos) const;
/// <summary>
/// Gets rotation of the actor oriented towards the specified world position.
/// </summary>
/// <param name="worldPos">The world position to orient towards.</param>
API_FUNCTION() Quaternion GetLookAtDirection(const Vector3& worldPos) const;
/// <summary>
/// Gets rotation of the actor oriented towards the specified world position with upwards direction.
/// [Deprecated in v1.13]
/// </summary>
/// <param name="worldPos">The world position to orient towards.</param>
/// <param name="worldUp">The up direction that constrains up axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.</param>
DEPRECATED("Use GetLookAtDirection instead.")
API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const;
/// <summary>
/// Gets rotation of the actor oriented towards the specified world position with upwards direction.
/// </summary>
/// <param name="worldPos">The world position to orient towards.</param>
/// <param name="worldUp">The up direction that constrains up axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.</param>
API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const;
API_FUNCTION() Quaternion GetLookAtDirection(const Vector3& worldPos, const Vector3& worldUp) const;
public:
/// <summary>