remove most vector scale functions from transform bus
This commit is contained in:
@@ -219,18 +219,11 @@ namespace AZ
|
|||||||
|
|
||||||
//! Scale modifiers
|
//! Scale modifiers
|
||||||
//! @{
|
//! @{
|
||||||
//! Set local scale of the transform.
|
//! @deprecated GetLocalScale is deprecated, and is left only to allow migration of legacy vector scale.
|
||||||
//! @param scale The new scale to set.
|
//! Get the legacy vector scale value in local space.
|
||||||
virtual void SetLocalScale([[maybe_unused]] const AZ::Vector3& scale) {}
|
|
||||||
|
|
||||||
//! Get the scale value in local space.
|
|
||||||
//! @return The scale value in local space.
|
//! @return The scale value in local space.
|
||||||
virtual AZ::Vector3 GetLocalScale() { return AZ::Vector3(FLT_MAX); }
|
virtual AZ::Vector3 GetLocalScale() { return AZ::Vector3(FLT_MAX); }
|
||||||
|
|
||||||
//! Get the scale value in world space.
|
|
||||||
//! @return The scale value in world space.
|
|
||||||
virtual AZ::Vector3 GetWorldScale() { return AZ::Vector3(FLT_MAX); }
|
|
||||||
|
|
||||||
//! Set the uniform scale value in local space.
|
//! Set the uniform scale value in local space.
|
||||||
virtual void SetLocalUniformScale([[maybe_unused]] float scale) {}
|
virtual void SetLocalUniformScale([[maybe_unused]] float scale) {}
|
||||||
|
|
||||||
|
|||||||
@@ -406,23 +406,12 @@ namespace AzFramework
|
|||||||
return m_localTM.GetRotation();
|
return m_localTM.GetRotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransformComponent::SetLocalScale(const AZ::Vector3& scale)
|
|
||||||
{
|
|
||||||
AZ::Transform newLocalTM = m_localTM;
|
|
||||||
newLocalTM.SetScale(scale);
|
|
||||||
SetLocalTM(newLocalTM);
|
|
||||||
}
|
|
||||||
|
|
||||||
AZ::Vector3 TransformComponent::GetLocalScale()
|
AZ::Vector3 TransformComponent::GetLocalScale()
|
||||||
{
|
{
|
||||||
|
AZ_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead");
|
||||||
return m_localTM.GetScale();
|
return m_localTM.GetScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
AZ::Vector3 TransformComponent::GetWorldScale()
|
|
||||||
{
|
|
||||||
return m_worldTM.GetScale();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformComponent::SetLocalUniformScale(float scale)
|
void TransformComponent::SetLocalUniformScale(float scale)
|
||||||
{
|
{
|
||||||
AZ::Transform newLocalTM = m_localTM;
|
AZ::Transform newLocalTM = m_localTM;
|
||||||
@@ -756,13 +745,11 @@ namespace AzFramework
|
|||||||
->Event("GetLocalRotationQuaternion", &AZ::TransformBus::Events::GetLocalRotationQuaternion)
|
->Event("GetLocalRotationQuaternion", &AZ::TransformBus::Events::GetLocalRotationQuaternion)
|
||||||
->Attribute("Rotation", AZ::Edit::Attributes::PropertyRotation)
|
->Attribute("Rotation", AZ::Edit::Attributes::PropertyRotation)
|
||||||
->VirtualProperty("Rotation", "GetLocalRotationQuaternion", "SetLocalRotationQuaternion")
|
->VirtualProperty("Rotation", "GetLocalRotationQuaternion", "SetLocalRotationQuaternion")
|
||||||
->Event("SetLocalScale", &AZ::TransformBus::Events::SetLocalScale)
|
|
||||||
->Event("GetLocalScale", &AZ::TransformBus::Events::GetLocalScale)
|
->Event("GetLocalScale", &AZ::TransformBus::Events::GetLocalScale)
|
||||||
->Attribute("Scale", AZ::Edit::Attributes::PropertyScale)
|
->Attribute("Scale", AZ::Edit::Attributes::PropertyScale)
|
||||||
->Event("SetLocalUniformScale", &AZ::TransformBus::Events::SetLocalUniformScale)
|
->Event("SetLocalUniformScale", &AZ::TransformBus::Events::SetLocalUniformScale)
|
||||||
->Event("GetLocalUniformScale", &AZ::TransformBus::Events::GetLocalUniformScale)
|
->Event("GetLocalUniformScale", &AZ::TransformBus::Events::GetLocalUniformScale)
|
||||||
->VirtualProperty("Uniform Scale", "GetLocalUniformScale", "SetLocalUniformScale")
|
->VirtualProperty("Uniform Scale", "GetLocalUniformScale", "SetLocalUniformScale")
|
||||||
->Event("GetWorldScale", &AZ::TransformBus::Events::GetWorldScale)
|
|
||||||
->Event("GetChildren", &AZ::TransformBus::Events::GetChildren)
|
->Event("GetChildren", &AZ::TransformBus::Events::GetChildren)
|
||||||
->Event("GetAllDescendants", &AZ::TransformBus::Events::GetAllDescendants)
|
->Event("GetAllDescendants", &AZ::TransformBus::Events::GetAllDescendants)
|
||||||
->Event("GetEntityAndAllDescendants", &AZ::TransformBus::Events::GetEntityAndAllDescendants)
|
->Event("GetEntityAndAllDescendants", &AZ::TransformBus::Events::GetEntityAndAllDescendants)
|
||||||
|
|||||||
@@ -128,9 +128,7 @@ namespace AzFramework
|
|||||||
AZ::Quaternion GetLocalRotationQuaternion() override;
|
AZ::Quaternion GetLocalRotationQuaternion() override;
|
||||||
|
|
||||||
// Scale Modifiers
|
// Scale Modifiers
|
||||||
void SetLocalScale(const AZ::Vector3& scale) override;
|
|
||||||
AZ::Vector3 GetLocalScale() override;
|
AZ::Vector3 GetLocalScale() override;
|
||||||
AZ::Vector3 GetWorldScale() override;
|
|
||||||
|
|
||||||
void SetLocalUniformScale(float scale) override;
|
void SetLocalUniformScale(float scale) override;
|
||||||
float GetLocalUniformScale() override;
|
float GetLocalUniformScale() override;
|
||||||
|
|||||||
+1
-11
@@ -599,22 +599,12 @@ namespace AzToolsFramework
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransformComponent::SetLocalScale(const AZ::Vector3& scale)
|
|
||||||
{
|
|
||||||
m_editorTransform.m_scale = scale;
|
|
||||||
TransformChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
AZ::Vector3 TransformComponent::GetLocalScale()
|
AZ::Vector3 TransformComponent::GetLocalScale()
|
||||||
{
|
{
|
||||||
|
AZ_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead");
|
||||||
return m_editorTransform.m_scale;
|
return m_editorTransform.m_scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
AZ::Vector3 TransformComponent::GetWorldScale()
|
|
||||||
{
|
|
||||||
return GetWorldTM().GetScale();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformComponent::SetLocalUniformScale(float scale)
|
void TransformComponent::SetLocalUniformScale(float scale)
|
||||||
{
|
{
|
||||||
m_editorTransform.m_scale = AZ::Vector3(scale);
|
m_editorTransform.m_scale = AZ::Vector3(scale);
|
||||||
|
|||||||
@@ -115,9 +115,7 @@ namespace AzToolsFramework
|
|||||||
AZ::Quaternion GetLocalRotationQuaternion() override;
|
AZ::Quaternion GetLocalRotationQuaternion() override;
|
||||||
|
|
||||||
// Scale Modifiers
|
// Scale Modifiers
|
||||||
void SetLocalScale(const AZ::Vector3& scale) override;
|
|
||||||
AZ::Vector3 GetLocalScale() override;
|
AZ::Vector3 GetLocalScale() override;
|
||||||
AZ::Vector3 GetWorldScale() override;
|
|
||||||
|
|
||||||
void SetLocalUniformScale(float scale) override;
|
void SetLocalUniformScale(float scale) override;
|
||||||
float GetLocalUniformScale() override;
|
float GetLocalUniformScale() override;
|
||||||
|
|||||||
+1
-1
@@ -141,7 +141,7 @@ namespace UnitTest
|
|||||||
|
|
||||||
// Set the new entity's transform to non zero values
|
// Set the new entity's transform to non zero values
|
||||||
// This helps validate in comparison tests that the transform values of created entities persist during slice operations
|
// This helps validate in comparison tests that the transform values of created entities persist during slice operations
|
||||||
entityTransform->SetLocalScale(AZ::Vector3(5, 5, 5));
|
entityTransform->SetLocalUniformScale(5);
|
||||||
entityTransform->SetLocalRotation(AZ::Vector3RadToDeg(AZ::Vector3(90, 90, 90)));
|
entityTransform->SetLocalRotation(AZ::Vector3RadToDeg(AZ::Vector3(90, 90, 90)));
|
||||||
entityTransform->SetLocalTranslation(AZ::Vector3(100, 100, 100));
|
entityTransform->SetLocalTranslation(AZ::Vector3(100, 100, 100));
|
||||||
|
|
||||||
|
|||||||
@@ -2012,9 +2012,9 @@ void CTrackViewAnimNode::SetPosRotScaleTracksDefaultValues(bool positionAllowed,
|
|||||||
}
|
}
|
||||||
if (scaleAllowed)
|
if (scaleAllowed)
|
||||||
{
|
{
|
||||||
AZ::Vector3 scale = AZ::Vector3::CreateOne();
|
float scale = 1.0f;
|
||||||
AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldScale);
|
AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale);
|
||||||
m_animNode->SetScale(time, AZVec3ToLYVec3(scale));
|
m_animNode->SetScale(time, Vec3(scale, scale, scale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -209,8 +209,8 @@ namespace AZ
|
|||||||
AZ::Vector3 position = AZ::Vector3::CreateZero();
|
AZ::Vector3 position = AZ::Vector3::CreateZero();
|
||||||
AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation);
|
AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation);
|
||||||
|
|
||||||
AZ::Vector3 scale = AZ::Vector3::CreateOne();
|
float scale = 1.0f;
|
||||||
AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalScale);
|
AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalUniformScale);
|
||||||
|
|
||||||
// draw AABB at probe position using the inner dimensions
|
// draw AABB at probe position using the inner dimensions
|
||||||
Color color(0.0f, 0.0f, 1.0f, 1.0f);
|
Color color(0.0f, 0.0f, 1.0f, 1.0f);
|
||||||
|
|||||||
@@ -654,9 +654,7 @@ namespace Blast
|
|||||||
MOCK_METHOD1(RotateAroundLocalZ, void(float));
|
MOCK_METHOD1(RotateAroundLocalZ, void(float));
|
||||||
MOCK_METHOD0(GetLocalRotation, AZ::Vector3());
|
MOCK_METHOD0(GetLocalRotation, AZ::Vector3());
|
||||||
MOCK_METHOD0(GetLocalRotationQuaternion, AZ::Quaternion());
|
MOCK_METHOD0(GetLocalRotationQuaternion, AZ::Quaternion());
|
||||||
MOCK_METHOD1(SetLocalScale, void(const AZ::Vector3&));
|
|
||||||
MOCK_METHOD0(GetLocalScale, AZ::Vector3());
|
MOCK_METHOD0(GetLocalScale, AZ::Vector3());
|
||||||
MOCK_METHOD0(GetWorldScale, AZ::Vector3());
|
|
||||||
MOCK_METHOD1(SetLocalUniformScale, void(float));
|
MOCK_METHOD1(SetLocalUniformScale, void(float));
|
||||||
MOCK_METHOD0(GetLocalUniformScale, float());
|
MOCK_METHOD0(GetLocalUniformScale, float());
|
||||||
MOCK_METHOD0(GetWorldUniformScale, float());
|
MOCK_METHOD0(GetWorldUniformScale, float());
|
||||||
|
|||||||
@@ -920,9 +920,9 @@ namespace PhysX
|
|||||||
|
|
||||||
AZ::Vector3 GetTransformScale(AZ::EntityId entityId)
|
AZ::Vector3 GetTransformScale(AZ::EntityId entityId)
|
||||||
{
|
{
|
||||||
AZ::Vector3 worldScale = AZ::Vector3::CreateOne();
|
float worldUniformScale = 1.0f;
|
||||||
AZ::TransformBus::EventResult(worldScale, entityId, &AZ::TransformBus::Events::GetWorldScale);
|
AZ::TransformBus::EventResult(worldUniformScale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale);
|
||||||
return worldScale;
|
return AZ::Vector3(worldUniformScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
AZ::Vector3 GetUniformScale(AZ::EntityId entityId)
|
AZ::Vector3 GetUniformScale(AZ::EntityId entityId)
|
||||||
|
|||||||
Reference in New Issue
Block a user