remove most vector scale functions from transform bus
This commit is contained in:
@@ -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;
|
||||
|
||||
+1
-11
@@ -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;
|
||||
|
||||
+1
-1
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user