From 64708a14d9de957a6534a5fee7519020d8625f7b Mon Sep 17 00:00:00 2001 From: Jake Young Date: Fri, 8 May 2026 12:22:45 -0400 Subject: [PATCH] Update LookingAt to be a more descriptive name. --- Source/Engine/Level/Actor.cpp | 10 ++++++++++ Source/Engine/Level/Actor.h | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp index 3f1ab905b..5f60ad2bd 100644 --- a/Source/Engine/Level/Actor.cpp +++ b/Source/Engine/Level/Actor.cpp @@ -1725,6 +1725,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) @@ -1752,6 +1757,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) diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index cd596e86c..d17726c28 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -897,16 +897,33 @@ public: /// /// Gets rotation of the actor oriented towards the specified world position. + /// [Deprecated in v1.13] /// /// The world position to orient towards. + DEPRECATED("Use GetLookAtDirection instead.") API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos) const; + + /// + /// Gets rotation of the actor oriented towards the specified world position. + /// + /// The world position to orient towards. + API_FUNCTION() Quaternion GetLookAtDirection(const Vector3& worldPos) const; + /// + /// Gets rotation of the actor oriented towards the specified world position with upwards direction. + /// [Deprecated in v1.13] + /// + /// The world position to orient towards. + /// 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. + DEPRECATED("Use GetLookAtDirection instead.") + API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const; + /// /// Gets rotation of the actor oriented towards the specified world position with upwards direction. /// /// The world position to orient towards. /// 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. - API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const; + API_FUNCTION() Quaternion GetLookAtDirection(const Vector3& worldPos, const Vector3& worldUp) const; public: ///