From bdf9ac31fb82f03cb8b6946ddb4f3a82f7482ffa Mon Sep 17 00:00:00 2001 From: greerdv Date: Tue, 25 May 2021 22:31:41 +0100 Subject: [PATCH] update to use uniform scale calls to Transform --- .../Serialization/Json/TransformSerializerTests.cpp | 4 ++-- .../AzToolsFramework/Maths/TransformUtils.h | 2 +- .../EditorTransformComponentSelection.cpp | 2 +- .../Source/RayTracing/RayTracingFeatureProcessor.cpp | 2 +- .../TransformServiceFeatureProcessor.cpp | 2 +- .../Code/Source/CoreLights/CapsuleLightDelegate.cpp | 8 ++++---- .../Code/Source/CoreLights/DiskLightDelegate.cpp | 2 +- .../CoreLights/EditorDirectionalLightComponent.cpp | 2 +- .../Code/Source/CoreLights/PolygonLightDelegate.cpp | 2 +- .../Code/Source/CoreLights/SphereLightDelegate.cpp | 2 +- .../Source/SkyBox/HDRiSkyboxComponentController.cpp | 2 +- .../Source/SkyBox/PhysicalSkyComponentController.cpp | 2 +- Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp | 2 +- Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp | 4 ++-- Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp | 2 +- Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp | 2 +- Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp | 2 +- .../Code/Source/Shape/EditorBoxShapeComponent.cpp | 2 +- .../Code/Source/Shape/EditorSplineComponent.cpp | 2 +- Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp | 2 +- Gems/PhysX/Code/Editor/DebugDraw.cpp | 2 +- .../Editor/EditorSubComponentModeSnapRotation.cpp | 2 +- Gems/PhysX/Code/Source/EditorColliderComponent.cpp | 2 +- Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp | 2 +- .../Code/Source/EditorShapeColliderComponent.cpp | 2 +- Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp | 2 +- Gems/PhysX/Code/Source/Utils.cpp | 12 ++++++------ .../Source/Components/WhiteBoxColliderComponent.cpp | 2 +- Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp | 2 +- 29 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp index e1e9bd237d..7eabd6e5e0 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp @@ -112,7 +112,7 @@ namespace JsonSerializationTests AZ::Transform testTransform = AZ::Transform::CreateIdentity(); AZ::Transform expectedTransform = AZ::Transform::CreateFromQuaternion(AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f)); - expectedTransform.SetScale(AZ::Vector3(5.5f)); + expectedTransform.SetUniformScale(5.5f); rapidjson::Document json; json.Parse(R"({ "Rotation": [ 0.25, 0.5, 0.75, 1.0 ], "Scale": 5.5 })"); @@ -128,7 +128,7 @@ namespace JsonSerializationTests { AZ::Transform testTransform = AZ::Transform::CreateIdentity(); AZ::Transform expectedTransform = AZ::Transform::CreateTranslation(AZ::Vector3(2.25f, 3.5f, 4.75f)); - expectedTransform.SetScale(AZ::Vector3(5.5f)); + expectedTransform.SetUniformScale(5.5f); rapidjson::Document json; json.Parse(R"({ "Translation": [ 2.25, 3.5, 4.75 ], "Scale": 5.5 })"); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h index 97add27604..a3cc12566f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h @@ -23,7 +23,7 @@ namespace AzToolsFramework inline AZ::Transform TransformNormalizedScale(const AZ::Transform& transform) { AZ::Transform transformNormalizedScale = transform; - transformNormalizedScale.SetScale(AZ::Vector3::CreateOne()); + transformNormalizedScale.SetUniformScale(1.0f); return transformNormalizedScale; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp index 86744ab16d..a1949dd44a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp @@ -2963,7 +2963,7 @@ namespace AzToolsFramework if (transformIt != transformsBefore.end()) { AZ::Transform transformBefore = transformIt->second; - transformBefore.ExtractScale(); + transformBefore.ExtractUniformScale(); AZ::Transform newWorldFromLocal = transformBefore * scaleTransform; SetEntityWorldTransform(entityId, newWorldFromLocal); diff --git a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp index c4e9306dc9..7c13daea3b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp @@ -318,7 +318,7 @@ namespace AZ { AZ::Transform meshTransform = transformFeatureProcessor->GetTransformForId(TransformServiceFeatureProcessorInterface::ObjectId(mesh.first)); AZ::Transform noScaleTransform = meshTransform; - noScaleTransform.ExtractScale(); + noScaleTransform.ExtractUniformScale(); AZ::Matrix3x3 rotationMatrix = Matrix3x3::CreateFromTransform(noScaleTransform); rotationMatrix = rotationMatrix.GetInverseFull().GetTranspose(); diff --git a/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp index acb6e4a287..fb73d0f416 100644 --- a/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp @@ -231,7 +231,7 @@ namespace AZ AZ_Error("TransformServiceFeatureProcessor", id.IsValid(), "Attempting to get the transform for an invalid handle."); AZ::Matrix3x4 matrix3x4 = AZ::Matrix3x4::CreateFromRowMajorFloat12(m_objectToWorldTransforms.at(id.GetIndex()).m_transform); AZ::Transform transform = AZ::Transform::CreateFromMatrix3x4(matrix3x4); - transform.ExtractScale(); + transform.ExtractUniformScale(); return transform; } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp index 4ffb917f65..4291ce4d97 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp @@ -35,7 +35,7 @@ namespace AZ // This equation is based off of the integration of a line segment against a perpendicular normal pointing at the center of the // line segment from some distance away. - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float h = GetInteriorHeight() * scale; float t2 = lightThreshold * lightThreshold; float h2 = h * h; @@ -54,7 +54,7 @@ namespace AZ const auto endpoints = m_shapeBus->GetCapsulePoints(); GetFeatureProcessor()->SetCapsuleLineSegment(GetLightHandle(), endpoints.m_begin, endpoints.m_end); - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float radius = m_shapeBus->GetRadius(); GetFeatureProcessor()->SetCapsuleRadius(GetLightHandle(), scale * radius); } @@ -62,7 +62,7 @@ namespace AZ float CapsuleLightDelegate::GetSurfaceArea() const { - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float radius = m_shapeBus->GetRadius(); float capsArea = 4.0f * Constants::Pi * radius * radius; // both caps make a sphere float sideArea = 2.0f * Constants::Pi * radius * GetInteriorHeight(); // cylindrical area of capsule @@ -77,7 +77,7 @@ namespace AZ float radius = CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity); // Add on the caps for the attenuation radius - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float height = m_shapeBus->GetHeight() * scale; debugDisplay.SetColor(color); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp index 7805a92cd1..8abc790ada 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp @@ -48,7 +48,7 @@ namespace AZ::Render float DiskLightDelegate::GetRadius() const { - return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement(); + return m_shapeBus->GetRadius() * GetTransform().GetUniformScale(); } void DiskLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& /*color*/, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index a40557f2f1..308a4ebd11 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -217,7 +217,7 @@ namespace AZ GetEntityId(), &TransformBus::Events::GetWorldTM); - transform.ExtractScale(); + transform.ExtractUniformScale(); const Vector3 origin = transform.GetTranslation(); const Vector3 originOffset = origin - (transform.TransformVector(forward) * arrowOffset); const Vector3 target = origin - (transform.TransformVector(forward) * (arrowLength + arrowOffset)); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp index e01559041c..0cc01f4066 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp @@ -73,7 +73,7 @@ namespace AZ twiceArea += vertices.at(i).GetX() * vertices.at(j).GetY(); twiceArea -= vertices.at(i).GetY() * vertices.at(j).GetX(); } - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); return GetAbs(twiceArea * 0.5f * scale * scale); } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp index e3cf1fac78..afb63dce9b 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp @@ -50,7 +50,7 @@ namespace AZ float SphereLightDelegate::GetRadius() const { - return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement(); + return m_shapeBus->GetRadius() * GetTransform().GetUniformScale(); } void SphereLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp index 2c44124564..72cc765238 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp @@ -228,7 +228,7 @@ namespace AZ // remove scale Transform worldNoScale = world; - worldNoScale.ExtractScale(); + worldNoScale.ExtractUniformScale(); AZ::Matrix3x4 transformMatrix = AZ::Matrix3x4::CreateFromTransform(worldNoScale); transformMatrix.StoreToRowMajorFloat12(matrix); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp index 4a6b1608a4..192c1ad509 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp @@ -218,7 +218,7 @@ namespace AZ SunPosition PhysicalSkyComponentController::GetSunTransform(const AZ::Transform& world) { Transform worldNoScale = world; - worldNoScale.ExtractScale(); + worldNoScale.ExtractUniformScale(); AZ::Vector3 sunPositionAtom = worldNoScale.TransformVector(AZ::Vector3(0, -1, 0)); // transform Sun from default position // Convert sun position to Y-up coordinate diff --git a/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp b/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp index 0336ae8c09..6c4c78c412 100644 --- a/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp +++ b/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp @@ -68,7 +68,7 @@ namespace Blast auto transform = AZ::Transform::CreateFromQuaternionAndTranslation( m_bodyConfiguration.m_orientation, m_bodyConfiguration.m_position); - transform.MultiplyByScale(AZ::Vector3(m_scale)); + transform.MultiplyByUniformScale(m_scale); AZ::TransformBus::Event(m_entity->GetId(), &AZ::TransformInterface::SetWorldTM, transform); diff --git a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp index 5fe1e0ab30..25c0f904e3 100644 --- a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp +++ b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp @@ -202,7 +202,7 @@ namespace Blast if (parentBody) { parentTransform = parentBody->GetTransform(); - parentTransform.MultiplyByScale(AZ::Vector3(m_initialTransform.GetScale().GetMaxElement())); + parentTransform.MultiplyByUniformScale(m_initialTransform.GetUniformScale()); } else { @@ -254,7 +254,7 @@ namespace Blast actorDesc.m_parentCenterOfMass = transform.GetTranslation(); actorDesc.m_parentLinearVelocity = AZ::Vector3::CreateZero(); actorDesc.m_bodyConfiguration = configuration; - actorDesc.m_scale = transform.GetScale().GetMaxElement(); + actorDesc.m_scale = transform.GetUniformScale(); return actorDesc; } diff --git a/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp index e935ed4009..1026c8addc 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp @@ -203,7 +203,7 @@ namespace LmbrCentral const AZ::Transform& currentTransform, const CapsuleShapeConfig& configuration, [[maybe_unused]] const AZ::Vector3& currentNonUniformScale) { - const float entityScale = currentTransform.GetScale().GetMaxElement(); + const float entityScale = currentTransform.GetUniformScale(); m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale; const float internalCylinderHeight = configuration.m_height - configuration.m_radius * 2.0f; diff --git a/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp index 047261862f..a0ba157fc1 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp @@ -273,7 +273,7 @@ namespace LmbrCentral const AZ::Transform& currentTransform, const CylinderShapeConfig& configuration, [[maybe_unused]] const AZ::Vector3& currentNonUniformScale) { - const float entityScale = currentTransform.GetScale().GetMaxElement(); + const float entityScale = currentTransform.GetUniformScale(); m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale; m_baseCenterPoint = currentTransform.GetTranslation() - m_axisVector * (configuration.m_height * 0.5f); m_axisVector = m_axisVector * configuration.m_height; diff --git a/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp index a302a83316..6aff6ed98c 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp @@ -167,7 +167,7 @@ namespace LmbrCentral { m_position = currentTransform.GetTranslation(); m_normal = currentTransform.GetBasisZ().GetNormalized(); - m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement(); + m_radius = configuration.m_radius * currentTransform.GetUniformScale(); } const DiskShapeConfig& DiskShape::GetDiskConfiguration() const diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp index c0b49b8e55..e323d58c2a 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp @@ -174,6 +174,6 @@ namespace LmbrCentral AZ::Vector3 EditorBoxShapeComponent::GetBoxScale() { - return AZ::Vector3(m_boxShape.GetCurrentTransform().GetScale().GetMaxElement() * m_boxShape.GetCurrentNonUniformScale()); + return AZ::Vector3(m_boxShape.GetCurrentTransform().GetUniformScale() * m_boxShape.GetCurrentNonUniformScale()); } } // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp index 212ec49c93..44ed73733c 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp @@ -349,7 +349,7 @@ namespace LmbrCentral const AZ::Vector3& src, const AZ::Vector3& dir, float& distance) { const auto rayIntersectData = IntersectSpline(m_cachedUniformScaleTransform, src, dir, *m_splineCommon.m_spline); - distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetScale().GetMaxElement(); + distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetUniformScale(); AzFramework::CameraState cameraState; AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::EventResult( diff --git a/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp index c06d38a612..05472df8be 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp @@ -136,7 +136,7 @@ namespace LmbrCentral [[maybe_unused]] const AZ::Vector3& currentNonUniformScale) { m_position = currentTransform.GetTranslation(); - m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement(); + m_radius = configuration.m_radius * currentTransform.GetUniformScale(); } void DrawSphereShape( diff --git a/Gems/PhysX/Code/Editor/DebugDraw.cpp b/Gems/PhysX/Code/Editor/DebugDraw.cpp index fffb1e1350..b73e3f22bd 100644 --- a/Gems/PhysX/Code/Editor/DebugDraw.cpp +++ b/Gems/PhysX/Code/Editor/DebugDraw.cpp @@ -685,7 +685,7 @@ namespace PhysX // Let each collider decide how to scale itself, so extract the scale here. AZ::Transform entityWorldTransformWithoutScale = AZ::Transform::CreateIdentity(); AZ::TransformBus::EventResult(entityWorldTransformWithoutScale, m_entityId, &AZ::TransformInterface::GetWorldTM); - entityWorldTransformWithoutScale.ExtractScale(); + entityWorldTransformWithoutScale.ExtractUniformScale(); auto* physXDebug = AZ::Interface::Get(); if (physXDebug == nullptr) diff --git a/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp b/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp index 502d60d8d9..e8e93e0d6e 100644 --- a/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp +++ b/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp @@ -89,7 +89,7 @@ namespace PhysX AZ::Transform worldTransform = AZ::Transform::CreateIdentity(); AZ::TransformBus::EventResult( worldTransform, m_entityComponentId.GetEntityId(), &AZ::TransformInterface::GetWorldTM); - worldTransform.ExtractScale(); + worldTransform.ExtractUniformScale(); AZ::Transform localTransform = AZ::Transform::CreateIdentity(); EditorJointRequestBus::EventResult( diff --git a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp index e9b9c41da3..26700a7103 100644 --- a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp @@ -603,7 +603,7 @@ namespace PhysX } AZ::Transform colliderTransform = GetWorldTM(); - colliderTransform.ExtractScale(); + colliderTransform.ExtractUniformScale(); AzPhysics::StaticRigidBodyConfiguration configuration; configuration.m_orientation = colliderTransform.GetRotation(); configuration.m_position = colliderTransform.GetTranslation(); diff --git a/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp b/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp index efd65181da..f68c4d17d8 100644 --- a/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp @@ -365,7 +365,7 @@ namespace PhysX } AZ::Transform colliderTransform = GetWorldTM(); - colliderTransform.ExtractScale(); + colliderTransform.ExtractUniformScale(); AzPhysics::RigidBodyConfiguration configuration = m_config; configuration.m_orientation = colliderTransform.GetRotation(); diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index 379afc3f2d..692fbf96f3 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -205,7 +205,7 @@ namespace PhysX } AZ::Transform transform = GetWorldTM(); - transform.ExtractScale(); + transform.ExtractUniformScale(); const size_t numPoints = m_geometryCache.m_cachedSamplePoints.size(); for (size_t pointIndex = 0; pointIndex < numPoints; ++pointIndex) { diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp b/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp index 3987936b8c..430ef7aef3 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp @@ -196,7 +196,7 @@ namespace PhysX AZ::Transform::CreateFromQuaternionAndTranslation(colliderConfiguration.m_rotation, colliderConfiguration.m_position); AZ::Transform shapeTransform = *m_transform; - shapeTransform.ExtractScale(); + shapeTransform.ExtractUniformScale(); shapeTransform = existingTransform * shapeTransform; diff --git a/Gems/PhysX/Code/Source/Utils.cpp b/Gems/PhysX/Code/Source/Utils.cpp index a85426d532..55be7c92f7 100644 --- a/Gems/PhysX/Code/Source/Utils.cpp +++ b/Gems/PhysX/Code/Source/Utils.cpp @@ -718,7 +718,7 @@ namespace PhysX const float boundsInflationFactor = 1.0f; AZ::Transform overallTransformNoScale = GetColliderWorldTransform(worldTransform, colliderConfiguration.m_position, colliderConfiguration.m_rotation); - overallTransformNoScale.ExtractScale(); + overallTransformNoScale.ExtractUniformScale(); const physx::PxBounds3 bounds = physx::PxGeometryQuery::getWorldBounds(geometryHolder.any(), PxMathConvert(overallTransformNoScale), boundsInflationFactor); @@ -1378,7 +1378,7 @@ namespace PhysX AZ::TransformBus::EventResult(worldTransformWithoutScale , entityId , &AZ::TransformInterface::GetWorldTM); - worldTransformWithoutScale.ExtractScale(); + worldTransformWithoutScale.ExtractUniformScale(); return worldTransformWithoutScale; } @@ -1386,10 +1386,10 @@ namespace PhysX const AZ::Transform& entityWorldTransform) { AZ::Transform jointWorldTransformWithoutScale = jointWorldTransform; - jointWorldTransformWithoutScale.ExtractScale(); + jointWorldTransformWithoutScale.ExtractUniformScale(); AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform; - entityWorldTransformWithoutScale.ExtractScale(); + entityWorldTransformWithoutScale.ExtractUniformScale(); AZ::Transform entityWorldTransformInverse = entityWorldTransformWithoutScale.GetInverse(); return entityWorldTransformInverse * jointWorldTransformWithoutScale; @@ -1399,10 +1399,10 @@ namespace PhysX const AZ::Transform& entityWorldTransform) { AZ::Transform jointLocalTransformWithoutScale = jointLocalTransform; - jointLocalTransformWithoutScale.ExtractScale(); + jointLocalTransformWithoutScale.ExtractUniformScale(); AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform; - entityWorldTransformWithoutScale.ExtractScale(); + entityWorldTransformWithoutScale.ExtractUniformScale(); return entityWorldTransformWithoutScale * jointLocalTransformWithoutScale; } diff --git a/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp b/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp index 41d0a4c5e3..cda82c82b0 100644 --- a/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp +++ b/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp @@ -139,7 +139,7 @@ namespace WhiteBox { const AZ::Transform worldTransformWithoutScale = [worldTransform = world]() mutable { - worldTransform.SetScale(AZ::Vector3::CreateOne()); + worldTransform.SetUniformScale(1.0f); return worldTransform; }(); diff --git a/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp b/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp index 9d423d5519..840d1f4590 100644 --- a/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp +++ b/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp @@ -73,7 +73,7 @@ namespace WhiteBox const AZ::Transform spaceFromLocal = localFromSpace.GetInverse(); const AZ::Vector3 spacePosition = spaceFromLocal.TransformPoint(localPosition); const AZ::Vector3 spaceScaledPosition = - AZ::Transform::CreateScale(AZ::Vector3(scale)).TransformPoint(spacePosition); + AZ::Transform::CreateUniformScale(scale).TransformPoint(spacePosition); return localFromSpace.TransformPoint(spaceScaledPosition); }