From 4ae74c913f63e6c9e9868aed6b4483bfec1762a4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 17:59:49 -0700 Subject: [PATCH] Gems/PhysX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/PhysX/Code/Editor/ConfigStringLineEditCtrl.cpp | 8 ++++---- Gems/PhysX/Code/Editor/EditorClassConverters.cpp | 1 - .../PhysX/Code/Editor/EditorSubComponentModeAngleCone.cpp | 4 +--- Gems/PhysX/Code/Editor/EditorSubComponentModeSnap.cpp | 1 - Gems/PhysX/Code/Source/EditorBallJointComponent.cpp | 1 - Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp | 4 ++-- .../Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp | 3 +-- Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp | 1 - Gems/PhysX/Code/Tests/SystemComponentTest.cpp | 2 -- 9 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Gems/PhysX/Code/Editor/ConfigStringLineEditCtrl.cpp b/Gems/PhysX/Code/Editor/ConfigStringLineEditCtrl.cpp index 1e506263be..4cf5204917 100644 --- a/Gems/PhysX/Code/Editor/ConfigStringLineEditCtrl.cpp +++ b/Gems/PhysX/Code/Editor/ConfigStringLineEditCtrl.cpp @@ -257,16 +257,16 @@ namespace PhysX void ConfigStringLineEditHandler::WriteGUIValuesIntoProperty(size_t index, ConfigStringLineEditCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) { - (int)index; - (void)node; + AZ_UNUSED(index); + AZ_UNUSED(node); AZStd::string val = GUI->Value(); instance = static_cast(val); } bool ConfigStringLineEditHandler::ReadValuesIntoGUI(size_t index, ConfigStringLineEditCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) { - (int)index; - (void)node; + AZ_UNUSED(index); + AZ_UNUSED(node); AZStd::string val = instance; GUI->setValue(val); return false; diff --git a/Gems/PhysX/Code/Editor/EditorClassConverters.cpp b/Gems/PhysX/Code/Editor/EditorClassConverters.cpp index dfa30dc0b4..e55ac6bbda 100644 --- a/Gems/PhysX/Code/Editor/EditorClassConverters.cpp +++ b/Gems/PhysX/Code/Editor/EditorClassConverters.cpp @@ -65,7 +65,6 @@ namespace PhysX { // collision group id AzPhysics::CollisionGroups::Id collisionGroupId; - const int baseColliderComponentIndex = classElement.FindElement(AZ_CRC("BaseClass1", 0xd4925735)); FindElementRecursiveAndGetData(classElement, AZ_CRC("CollisionGroupId", 0x84fe4bbe), collisionGroupId); // collider config diff --git a/Gems/PhysX/Code/Editor/EditorSubComponentModeAngleCone.cpp b/Gems/PhysX/Code/Editor/EditorSubComponentModeAngleCone.cpp index 7e9a59093f..778fce1546 100644 --- a/Gems/PhysX/Code/Editor/EditorSubComponentModeAngleCone.cpp +++ b/Gems/PhysX/Code/Editor/EditorSubComponentModeAngleCone.cpp @@ -334,15 +334,13 @@ namespace PhysX } void EditorSubComponentModeAngleCone::ConfigureLinearView( - float axisLength, const AZ::Color& axis1Color, const AZ::Color& axis2Color, + float axisLength, [[maybe_unused]] const AZ::Color& axis1Color, const AZ::Color& axis2Color, const AZ::Color& axis3Color) { const float coneLength = 0.28f; const float coneRadius = 0.07f; const float lineWidth = 0.05f; - const AZ::Color axesColor[] = { axis1Color, axis2Color, axis3Color }; - const auto configureLinearView = [lineWidth, coneLength, axisLength, coneRadius]( AzToolsFramework::LinearManipulator* linearManipulator, const AZ::Color& color) { diff --git a/Gems/PhysX/Code/Editor/EditorSubComponentModeSnap.cpp b/Gems/PhysX/Code/Editor/EditorSubComponentModeSnap.cpp index cef48a7cf5..5220b2e274 100644 --- a/Gems/PhysX/Code/Editor/EditorSubComponentModeSnap.cpp +++ b/Gems/PhysX/Code/Editor/EditorSubComponentModeSnap.cpp @@ -99,7 +99,6 @@ namespace PhysX debugDisplay.PushMatrix(localTransform); const float xAxisLineLength = 15.0f; - const float yzAxisArrowLength = 1.0f; debugDisplay.SetColor(AZ::Color(1.0f, 0.0f, 0.0f, 1.0f)); debugDisplay.DrawLine(AZ::Vector3(0.0f, 0.0f, 0.0f), AZ::Vector3(xAxisLineLength, 0.0f, 0.0f)); diff --git a/Gems/PhysX/Code/Source/EditorBallJointComponent.cpp b/Gems/PhysX/Code/Source/EditorBallJointComponent.cpp index d196b4644d..da000baeed 100644 --- a/Gems/PhysX/Code/Source/EditorBallJointComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorBallJointComponent.cpp @@ -237,7 +237,6 @@ namespace PhysX debugDisplay.PushMatrix(localTransform); const float xAxisArrowLength = 2.0f; - const float yzAxisArrowLength = 1.0f; debugDisplay.SetColor(AZ::Color(1.0f, 0.0f, 0.0f, 1.0f)); debugDisplay.DrawArrow(AZ::Vector3(0.0f, 0.0f, 0.0f), AZ::Vector3(xAxisArrowLength, 0.0f, 0.0f)); diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index 7ff62e0fc6..57bfe17a30 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -58,10 +58,10 @@ namespace PhysX { if (m_shapeType == ShapeType::Cylinder) { - return AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::Show; + return AZ::Edit::PropertyVisibility::Show; } - return AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::Hide; + return AZ::Edit::PropertyVisibility::Hide; } void EditorShapeColliderComponent::Reflect(AZ::ReflectContext* context) diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp index b02a3962cc..0117e9737b 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp @@ -175,7 +175,6 @@ namespace PhysX::Benchmarks const int numRigidBodies = static_cast(state.range(0)); //common settings for each rigid body - const float boxSize = 5.0f; const float boxSizeWithSpacing = RigidBodyConstants::RigidBodys::BoxSize + 2.0f; const int boxesPerCol = static_cast(RigidBodyConstants::TerrainSize / boxSizeWithSpacing) - 1; int spawnColIdx = 0; @@ -399,7 +398,7 @@ namespace PhysX::Benchmarks return rand.GetRandomFloat() * 25.0f + 5.0f; }; - Utils::GenerateEntityIdFuncPtr entityIdGenerator = [&rand](int idx) -> AZ::EntityId { + Utils::GenerateEntityIdFuncPtr entityIdGenerator = [](int idx) -> AZ::EntityId { return AZ::EntityId(static_cast(idx) + RigidBodyConstants::RigidBodys::RigidBodyEntityIdStart); }; auto boxShapeConfiguration = AZStd::make_shared(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize)); diff --git a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp index e3c7d9acfb..cbaf4b4625 100644 --- a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp @@ -299,7 +299,6 @@ namespace PhysXEditorTests // the bounding box of the rigid body should reflect the dimensions of the cylinder set above AZ::Aabb aabb = staticBody->GetAabb(); - const float validDiameter = validRadius * 2.0f; // Check that the z positions of the bounding box match that of the cylinder EXPECT_NEAR(aabb.GetMin().GetZ(), -0.5f * validHeight, AZ::Constants::Tolerance); diff --git a/Gems/PhysX/Code/Tests/SystemComponentTest.cpp b/Gems/PhysX/Code/Tests/SystemComponentTest.cpp index cf9bbe3567..11c5e0a115 100644 --- a/Gems/PhysX/Code/Tests/SystemComponentTest.cpp +++ b/Gems/PhysX/Code/Tests/SystemComponentTest.cpp @@ -21,8 +21,6 @@ namespace PhysXEditorTests // Initialize new configs with some non-default values. const AZ::Vector3 newGravity(2.f, 5.f, 7.f); - const float newFixedTimeStep = 0.008f; - const float newMaxTimeStep = 0.034f; AzPhysics::SceneConfiguration newConfiguration;