From ba48b2e4f38d75e9c19a3ad91ec15b9571be0ace Mon Sep 17 00:00:00 2001 From: Jake Young Date: Fri, 8 May 2026 12:10:42 -0400 Subject: [PATCH] Deprecate the Direction properties and replace with forward. Also give more descriptive description of what they do. --- Source/Engine/Level/Actor.cpp | 5 +++++ Source/Engine/Level/Actor.h | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp index 3f1ab905b..19fef4ca1 100644 --- a/Source/Engine/Level/Actor.cpp +++ b/Source/Engine/Level/Actor.cpp @@ -822,6 +822,11 @@ void Actor::SetRotation(const Matrix& value) } void Actor::SetDirection(const Float3& value) +{ + SetForward(value); +} + +void Actor::SetForward(const Float3& value) { CHECK(!value.IsNanOrInfinity()); Quaternion orientation; diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index cd596e86c..0ed5cc822 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -549,18 +549,36 @@ public: /// /// Gets actor direction vector (forward vector). + /// [Deprecated in v1.13] /// + DEPRECATED("Use GetForward instead.") API_PROPERTY(Attributes="HideInEditor, NoSerialize") FORCE_INLINE Float3 GetDirection() const + { + return GetForward(); + } + + /// + /// Gets the actor's forward vector. + /// + API_PROPERTY(Attributes="HideInEditor, NoSerialize") FORCE_INLINE Float3 GetForward() const { return Float3::Transform(Float3::Forward, GetOrientation()); } /// /// Sets actor direction vector (forward) + /// [Deprecated in v1.13] /// /// The value to set. + DEPRECATED("Use SetForward instead.") API_PROPERTY() void SetDirection(const Float3& value); + /// + /// Rotates the actor to align its forward vector with the passed in value. + /// + /// The value to align to. + API_PROPERTY() void SetForward(const Float3& value); + public: /// /// Resets the actor local transform.