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.