diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp index 19fef4ca1..29aaff502 100644 --- a/Source/Engine/Level/Actor.cpp +++ b/Source/Engine/Level/Actor.cpp @@ -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) diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index 0ed5cc822..16b0c8ce3 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -915,16 +915,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: ///