diff --git a/Source/Engine/Graphics/RenderView.cpp b/Source/Engine/Graphics/RenderView.cpp
index 0472ce346..aa2e94604 100644
--- a/Source/Engine/Graphics/RenderView.cpp
+++ b/Source/Engine/Graphics/RenderView.cpp
@@ -195,7 +195,7 @@ void RenderView::CopyFrom(const Camera* camera, const Viewport* viewport)
const Vector3 cameraPos = camera->GetPosition();
LargeWorlds::UpdateOrigin(Origin, cameraPos);
Position = cameraPos - Origin;
- Direction = camera->GetDirection();
+ Direction = camera->GetForward();
Near = camera->GetNearPlane();
Far = camera->GetFarPlane();
camera->GetMatrices(View, Projection, viewport ? *viewport : camera->GetViewport(), Origin);
diff --git a/Source/Engine/Graphics/RenderView.cs b/Source/Engine/Graphics/RenderView.cs
index 2cd27ad83..b71b2d19b 100644
--- a/Source/Engine/Graphics/RenderView.cs
+++ b/Source/Engine/Graphics/RenderView.cs
@@ -96,7 +96,7 @@ namespace FlaxEngine
Vector3 cameraPos = camera.Position;
LargeWorlds.UpdateOrigin(ref Origin, cameraPos);
Position = cameraPos - Origin;
- Direction = camera.Direction;
+ Direction = camera.Forward;
Near = camera.NearPlane;
Far = camera.FarPlane;
camera.GetMatrices(out View, out Projection, ref viewport, ref Origin);
diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp
index 29aaff502..8ce79fea4 100644
--- a/Source/Engine/Level/Actor.cpp
+++ b/Source/Engine/Level/Actor.cpp
@@ -1719,13 +1719,13 @@ Actor* Actor::Intersects(const Ray& ray, Real& distance, Vector3& normal)
void Actor::LookAt(const Vector3& worldPos)
{
- const Quaternion orientation = LookingAt(worldPos);
+ const Quaternion orientation = GetLookAtDirection(worldPos);
SetOrientation(orientation);
}
void Actor::LookAt(const Vector3& worldPos, const Vector3& worldUp)
{
- const Quaternion orientation = LookingAt(worldPos, worldUp);
+ const Quaternion orientation = GetLookAtDirection(worldPos, worldUp);
SetOrientation(orientation);
}
@@ -1771,12 +1771,11 @@ Quaternion Actor::GetLookAtDirection(const Vector3& worldPos, const Vector3& wor
const Vector3 direction = worldPos - _transform.Translation;
if (direction.LengthSquared() < ZeroTolerance)
return _parent ? _parent->GetOrientation() : Quaternion::Identity;
+
const Float3 forward = Vector3::Normalize(direction);
const Float3 up = Vector3::Normalize(worldUp);
if (Math::IsOne(Float3::Dot(forward, up)))
- {
- return LookingAt(worldPos);
- }
+ return GetLookAtDirection(worldPos);
Quaternion orientation;
Quaternion::LookRotation(direction, up, orientation);
diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h
index 16b0c8ce3..a1ca01cc6 100644
--- a/Source/Engine/Level/Actor.h
+++ b/Source/Engine/Level/Actor.h
@@ -551,14 +551,14 @@ 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
+ API_PROPERTY(Attributes="HideInEditor, NoSerialize") DEPRECATED("Use GetForward instead.")
+ FORCE_INLINE Float3 GetDirection() const
{
return GetForward();
}
///
- /// Gets the actor's forward vector.
+ /// Gets the actor's forward vector (direction).
///
API_PROPERTY(Attributes="HideInEditor, NoSerialize") FORCE_INLINE Float3 GetForward() const
{
@@ -570,11 +570,11 @@ public:
/// [Deprecated in v1.13]
///
/// The value to set.
- DEPRECATED("Use SetForward instead.")
- API_PROPERTY() void SetDirection(const Float3& value);
+ API_PROPERTY() DEPRECATED("Use SetForward instead.")
+ void SetDirection(const Float3& value);
///
- /// Rotates the actor to align its forward vector with the passed in value.
+ /// Rotates the actor to align its forward vector with the passed in value (direction).
///
/// The value to align to.
API_PROPERTY() void SetForward(const Float3& value);
@@ -918,8 +918,7 @@ public:
/// [Deprecated in v1.13]
///
/// The world position to orient towards.
- DEPRECATED("Use GetLookAtDirection instead.")
- API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos) const;
+ API_FUNCTION() DEPRECATED("Use GetLookAtDirection instead.") Quaternion LookingAt(const Vector3& worldPos) const;
///
/// Gets rotation of the actor oriented towards the specified world position.
@@ -933,8 +932,7 @@ public:
///
/// 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;
+ API_FUNCTION() DEPRECATED("Use GetLookAtDirection instead.") Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const;
///
/// Gets rotation of the actor oriented towards the specified world position with upwards direction.
diff --git a/Source/Engine/Level/Actors/Camera.cpp b/Source/Engine/Level/Actors/Camera.cpp
index b5b30e52d..fa4c2abfb 100644
--- a/Source/Engine/Level/Actors/Camera.cpp
+++ b/Source/Engine/Level/Actors/Camera.cpp
@@ -210,7 +210,7 @@ Ray Camera::ConvertMouseToRay(const Float2& mousePosition, const Viewport& viewp
{
Vector3 position = GetPosition();
if (viewport.Width < ZeroTolerance || viewport.Height < ZeroTolerance || mousePosition.IsNaN())
- return Ray(position, GetDirection());
+ return Ray(position, GetForward());
// Use different logic in orthographic projection
if (!_usePerspective)
diff --git a/Source/Engine/Level/Actors/DirectionalLight.cpp b/Source/Engine/Level/Actors/DirectionalLight.cpp
index e6644c1f7..f677d0828 100644
--- a/Source/Engine/Level/Actors/DirectionalLight.cpp
+++ b/Source/Engine/Level/Actors/DirectionalLight.cpp
@@ -30,7 +30,7 @@ void DirectionalLight::Draw(RenderContext& renderContext)
data.ShadowsDistance = ShadowsDistance;
data.Color = Color.ToFloat3() * (Color.A * brightness);
data.ShadowsStrength = ShadowsStrength;
- data.Direction = GetDirection();
+ data.Direction = GetForward();
data.ShadowsFadeDistance = ShadowsFadeDistance;
data.ShadowsNormalOffsetScale = ShadowsNormalOffsetScale;
data.ShadowsDepthBias = ShadowsDepthBias;
diff --git a/Source/Engine/Level/Actors/ExponentialHeightFog.cpp b/Source/Engine/Level/Actors/ExponentialHeightFog.cpp
index 2a89771c9..cfb5217a0 100644
--- a/Source/Engine/Level/Actors/ExponentialHeightFog.cpp
+++ b/Source/Engine/Level/Actors/ExponentialHeightFog.cpp
@@ -163,7 +163,7 @@ void ExponentialHeightFog::GetExponentialHeightFogData(const RenderView& view, S
result.FogCutoffDistance = FogCutoffDistance >= 0 ? FogCutoffDistance : view.Far + FogCutoffDistance;
if (useDirectionalLightInscattering)
{
- result.InscatteringLightDirection = -DirectionalInscatteringLight->GetDirection();
+ result.InscatteringLightDirection = -DirectionalInscatteringLight->GetForward();
result.DirectionalInscatteringColor = DirectionalInscatteringColor.ToFloat3();
result.DirectionalInscatteringExponent = Math::Clamp(DirectionalInscatteringExponent, 0.000001f, 1000.0f);
result.DirectionalInscatteringStartDistance = Math::Min(DirectionalInscatteringStartDistance, view.Far - 1.0f);
diff --git a/Source/Engine/Level/Actors/Sky.cpp b/Source/Engine/Level/Actors/Sky.cpp
index 7354f3bcf..daa024ab3 100644
--- a/Source/Engine/Level/Actors/Sky.cpp
+++ b/Source/Engine/Level/Actors/Sky.cpp
@@ -73,7 +73,7 @@ void Sky::InitConfig(ShaderAtmosphericFogData& config) const
if (SunLight)
{
- config.AtmosphericFogSunDirection = -SunLight->GetDirection();
+ config.AtmosphericFogSunDirection = -SunLight->GetForward();
config.AtmosphericFogSunColor = SunLight->Color.ToFloat3() * SunLight->Color.A;
}
else
diff --git a/Source/Engine/Level/Actors/SpotLight.cpp b/Source/Engine/Level/Actors/SpotLight.cpp
index 38502cf1b..b0888e46c 100644
--- a/Source/Engine/Level/Actors/SpotLight.cpp
+++ b/Source/Engine/Level/Actors/SpotLight.cpp
@@ -27,7 +27,7 @@ SpotLight::SpotLight(const SpawnParams& params)
_cosInnerCone = Math::Cos(_innerConeAngle * DegreesToRadians);
_invCosConeDifference = 1.0f / (_cosInnerCone - _cosOuterCone);
const float boundsRadius = Math::Sqrt(1.25f * _radius * _radius - _radius * _radius * _cosOuterCone);
- _sphere = BoundingSphere(GetPosition() + 0.5f * GetDirection() * _radius, boundsRadius);
+ _sphere = BoundingSphere(GetPosition() + 0.5f * GetForward() * _radius, boundsRadius);
BoundingBox::FromSphere(_sphere, _box);
}
@@ -113,7 +113,7 @@ void SpotLight::UpdateBounds()
// Note: we use the law of cosines to find the distance to the furthest edge of the spotlight cone from a position that is halfway down the spotlight direction
const float radius = GetScaledRadius();
const float boundsRadius = Math::Sqrt(1.25f * radius * radius - radius * radius * _cosOuterCone);
- _sphere = BoundingSphere(GetPosition() + 0.5f * GetDirection() * radius, boundsRadius);
+ _sphere = BoundingSphere(GetPosition() + 0.5f * GetForward() * radius, boundsRadius);
BoundingBox::FromSphere(_sphere, _box);
if (_sceneRenderingKey != -1)
@@ -199,7 +199,7 @@ void SpotLight::OnDebugDrawSelected()
const auto color = Color::Yellow;
Vector3 right = _transform.GetRight();
Vector3 up = _transform.GetUp();
- Vector3 forward = GetDirection();
+ Vector3 forward = GetForward();
float radius = GetScaledRadius();
float discRadius = radius * Math::Tan(_outerConeAngle * DegreesToRadians);
float falloffDiscRadius = radius * Math::Tan(_innerConeAngle * DegreesToRadians);
@@ -231,7 +231,7 @@ void SpotLight::DrawLightsDebug(RenderView& view)
const auto color = Color::Yellow;
Vector3 right = _transform.GetRight();
Vector3 up = _transform.GetUp();
- Vector3 forward = GetDirection();
+ Vector3 forward = GetForward();
float radius = GetScaledRadius();
float discRadius = radius * Math::Tan(_outerConeAngle * DegreesToRadians);
float falloffDiscRadius = radius * Math::Tan(_innerConeAngle * DegreesToRadians);
diff --git a/Source/Engine/UI/UICanvas.cs b/Source/Engine/UI/UICanvas.cs
index 4a6bb7ce1..225213dba 100644
--- a/Source/Engine/UI/UICanvas.cs
+++ b/Source/Engine/UI/UICanvas.cs
@@ -465,7 +465,7 @@ namespace FlaxEngine
Quaternion.Euler(180, 180, 0, out var quat);
Matrix.RotationQuaternion(ref quat, out m2);
Matrix.Multiply(ref m3, ref m2, out m1);
- m2 = Matrix.Transformation(Vector3.One, Quaternion.FromDirection(-camera.Direction), translation);
+ m2 = Matrix.Transformation(Vector3.One, Quaternion.FromDirection(-camera.Forward), translation);
Matrix.Multiply(ref m1, ref m2, out world);
}
else if (_renderMode == CanvasRenderMode.CameraSpace && camera)
diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs
index a2016c8cb..871530e30 100644
--- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs
+++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs
@@ -1052,7 +1052,8 @@ namespace Flax.Build.Bindings
propertyInfo.Getter = functionInfo;
else
propertyInfo.Setter = functionInfo;
- propertyInfo.DeprecatedMessage = functionInfo.DeprecatedMessage;
+ if (propertyInfo.DeprecatedMessage == null)
+ propertyInfo.DeprecatedMessage = functionInfo.DeprecatedMessage;
propertyInfo.IsHidden |= functionInfo.IsHidden;
if (propertyInfo.Getter != null && propertyInfo.Setter != null)