remove most vector scale functions from transform bus

main
greerdv 5 years ago
parent e1b9c4f22e
commit d73566565e

@ -219,18 +219,11 @@ namespace AZ
//! Scale modifiers
//! @{
//! Set local scale of the transform.
//! @param scale The new scale to set.
virtual void SetLocalScale([[maybe_unused]] const AZ::Vector3& scale) {}
//! Get the scale value in local space.
//! @deprecated GetLocalScale is deprecated, and is left only to allow migration of legacy vector scale.
//! Get the legacy vector scale value in local space.
//! @return The scale value in local space.
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.
virtual void SetLocalUniformScale([[maybe_unused]] float scale) {}

@ -406,23 +406,12 @@ namespace AzFramework
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_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead");
return m_localTM.GetScale();
}
AZ::Vector3 TransformComponent::GetWorldScale()
{
return m_worldTM.GetScale();
}
void TransformComponent::SetLocalUniformScale(float scale)
{
AZ::Transform newLocalTM = m_localTM;
@ -756,13 +745,11 @@ namespace AzFramework
->Event("GetLocalRotationQuaternion", &AZ::TransformBus::Events::GetLocalRotationQuaternion)
->Attribute("Rotation", AZ::Edit::Attributes::PropertyRotation)
->VirtualProperty("Rotation", "GetLocalRotationQuaternion", "SetLocalRotationQuaternion")
->Event("SetLocalScale", &AZ::TransformBus::Events::SetLocalScale)
->Event("GetLocalScale", &AZ::TransformBus::Events::GetLocalScale)
->Attribute("Scale", AZ::Edit::Attributes::PropertyScale)
->Event("SetLocalUniformScale", &AZ::TransformBus::Events::SetLocalUniformScale)
->Event("GetLocalUniformScale", &AZ::TransformBus::Events::GetLocalUniformScale)
->VirtualProperty("Uniform Scale", "GetLocalUniformScale", "SetLocalUniformScale")
->Event("GetWorldScale", &AZ::TransformBus::Events::GetWorldScale)
->Event("GetChildren", &AZ::TransformBus::Events::GetChildren)
->Event("GetAllDescendants", &AZ::TransformBus::Events::GetAllDescendants)
->Event("GetEntityAndAllDescendants", &AZ::TransformBus::Events::GetEntityAndAllDescendants)

@ -128,9 +128,7 @@ namespace AzFramework
AZ::Quaternion GetLocalRotationQuaternion() override;
// Scale Modifiers
void SetLocalScale(const AZ::Vector3& scale) override;
AZ::Vector3 GetLocalScale() override;
AZ::Vector3 GetWorldScale() override;
void SetLocalUniformScale(float scale) override;
float GetLocalUniformScale() override;

@ -599,22 +599,12 @@ namespace AzToolsFramework
return result;
}
void TransformComponent::SetLocalScale(const AZ::Vector3& scale)
{
m_editorTransform.m_scale = scale;
TransformChanged();
}
AZ::Vector3 TransformComponent::GetLocalScale()
{
AZ_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead");
return m_editorTransform.m_scale;
}
AZ::Vector3 TransformComponent::GetWorldScale()
{
return GetWorldTM().GetScale();
}
void TransformComponent::SetLocalUniformScale(float scale)
{
m_editorTransform.m_scale = AZ::Vector3(scale);

@ -115,9 +115,7 @@ namespace AzToolsFramework
AZ::Quaternion GetLocalRotationQuaternion() override;
// Scale Modifiers
void SetLocalScale(const AZ::Vector3& scale) override;
AZ::Vector3 GetLocalScale() override;
AZ::Vector3 GetWorldScale() override;
void SetLocalUniformScale(float scale) override;
float GetLocalUniformScale() override;

@ -141,7 +141,7 @@ namespace UnitTest
// 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
entityTransform->SetLocalScale(AZ::Vector3(5, 5, 5));
entityTransform->SetLocalUniformScale(5);
entityTransform->SetLocalRotation(AZ::Vector3RadToDeg(AZ::Vector3(90, 90, 90)));
entityTransform->SetLocalTranslation(AZ::Vector3(100, 100, 100));

@ -2012,9 +2012,9 @@ void CTrackViewAnimNode::SetPosRotScaleTracksDefaultValues(bool positionAllowed,
}
if (scaleAllowed)
{
AZ::Vector3 scale = AZ::Vector3::CreateOne();
AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldScale);
m_animNode->SetScale(time, AZVec3ToLYVec3(scale));
float scale = 1.0f;
AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale);
m_animNode->SetScale(time, Vec3(scale, scale, scale));
}
}
}

@ -209,8 +209,8 @@ namespace AZ
AZ::Vector3 position = AZ::Vector3::CreateZero();
AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation);
AZ::Vector3 scale = AZ::Vector3::CreateOne();
AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalScale);
float scale = 1.0f;
AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalUniformScale);
// draw AABB at probe position using the inner dimensions
Color color(0.0f, 0.0f, 1.0f, 1.0f);

@ -654,9 +654,7 @@ namespace Blast
MOCK_METHOD1(RotateAroundLocalZ, void(float));
MOCK_METHOD0(GetLocalRotation, AZ::Vector3());
MOCK_METHOD0(GetLocalRotationQuaternion, AZ::Quaternion());
MOCK_METHOD1(SetLocalScale, void(const AZ::Vector3&));
MOCK_METHOD0(GetLocalScale, AZ::Vector3());
MOCK_METHOD0(GetWorldScale, AZ::Vector3());
MOCK_METHOD1(SetLocalUniformScale, void(float));
MOCK_METHOD0(GetLocalUniformScale, float());
MOCK_METHOD0(GetWorldUniformScale, float());

@ -920,9 +920,9 @@ namespace PhysX
AZ::Vector3 GetTransformScale(AZ::EntityId entityId)
{
AZ::Vector3 worldScale = AZ::Vector3::CreateOne();
AZ::TransformBus::EventResult(worldScale, entityId, &AZ::TransformBus::Events::GetWorldScale);
return worldScale;
float worldUniformScale = 1.0f;
AZ::TransformBus::EventResult(worldUniformScale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale);
return AZ::Vector3(worldUniformScale);
}
AZ::Vector3 GetUniformScale(AZ::EntityId entityId)

Loading…
Cancel
Save