diff --git a/Gems/PhysX/Code/Editor/MaterialIdWidget.cpp b/Gems/PhysX/Code/Editor/MaterialIdWidget.cpp index 7bbdf91c20..4fba93da39 100644 --- a/Gems/PhysX/Code/Editor/MaterialIdWidget.cpp +++ b/Gems/PhysX/Code/Editor/MaterialIdWidget.cpp @@ -69,7 +69,7 @@ namespace PhysX auto lockToDefault = [gui]() { - gui->addItem(QLatin1String(Physics::DefaultPhysicsMaterialLabel.data(), Physics::DefaultPhysicsMaterialLabel.size())); + gui->addItem(QLatin1String(Physics::DefaultPhysicsMaterialLabel.data(), static_cast(Physics::DefaultPhysicsMaterialLabel.size()))); gui->setCurrentIndex(0); return false; }; @@ -98,7 +98,7 @@ namespace PhysX // Add default physics material first m_libraryIds.push_back(Physics::MaterialId()); - gui->addItem(QLatin1String(Physics::DefaultPhysicsMaterialLabel.data(), Physics::DefaultPhysicsMaterialLabel.size())); + gui->addItem(QLatin1String(Physics::DefaultPhysicsMaterialLabel.data(), static_cast(Physics::DefaultPhysicsMaterialLabel.size()))); for (const auto& material : materials) { diff --git a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp index 1409760742..c1056bdd73 100644 --- a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp @@ -780,7 +780,7 @@ namespace PhysX entityRigidbody->GetRigidBody()->IsKinematic() == false) { AZStd::string assetPath = m_shapeConfiguration.m_physicsAsset.m_configuration.m_asset.GetHint().c_str(); - const uint lastSlash = assetPath.rfind('/'); + const uint lastSlash = static_cast(assetPath.rfind('/')); if (lastSlash != AZStd::string::npos) { assetPath = assetPath.substr(lastSlash + 1); @@ -831,7 +831,7 @@ namespace PhysX if (shapeConfiguration) { - m_colliderDebugDraw.BuildMeshes(*shapeConfiguration, shapeIndex); + m_colliderDebugDraw.BuildMeshes(*shapeConfiguration, static_cast(shapeIndex)); } } } @@ -917,7 +917,7 @@ namespace PhysX const AZ::Vector3 overallScale = Utils::GetTransformScale(GetEntityId()) * m_cachedNonUniformScale * assetScale; m_colliderDebugDraw.DrawMesh(debugDisplay, *colliderConfiguration, *cookedMeshShapeConfiguration, - overallScale, shapeIndex); + overallScale, static_cast(shapeIndex)); break; } case Physics::ShapeType::Sphere: diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp index 068e0f68df..c882252d50 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp @@ -155,7 +155,7 @@ namespace PhysX if (materialIndexIter != materialIndexByName.end()) { - return materialIndexIter->second; + return static_cast(materialIndexIter->second); } // Add it to the list otherwise @@ -417,7 +417,7 @@ namespace PhysX AZ_Assert(pxCooking, "Failed to create PxCooking"); physx::PxBoundedData strideData; - strideData.count = vertices.size(); + strideData.count = static_cast(vertices.size()); strideData.stride = sizeof(Vec3); strideData.data = vertices.data(); @@ -453,7 +453,7 @@ namespace PhysX physx::PxTriangleMeshDesc meshDesc; meshDesc.points = strideData; - meshDesc.triangles.count = indices.size() / 3; + meshDesc.triangles.count = static_cast(indices.size() / 3); meshDesc.triangles.stride = sizeof(AZ::u32) * 3; meshDesc.triangles.data = indices.data(); @@ -638,9 +638,9 @@ namespace PhysX { decomposer->Compute( vhacdVertices.data(), - vhacdVertices.size() / 3, + static_cast(vhacdVertices.size() / 3), nodeExportData.m_indices.data(), - nodeExportData.m_indices.size() / 3, + static_cast(nodeExportData.m_indices.size() / 3), vhacdParams ); } @@ -656,9 +656,9 @@ namespace PhysX decomposer->Compute( vhacdVertices.data(), - vhacdVertices.size() / 3, + static_cast(vhacdVertices.size() / 3), vhacdIndices.data(), - vhacdIndices.size() / 3, + static_cast(vhacdIndices.size() / 3), vhacdParams ); } @@ -841,7 +841,7 @@ namespace PhysX // by the amount of vertices already added in the last iteration for (const NodeCollisionGeomExportData& exportData : totalExportData) { - vtx_idx startingIndex = mergedVertices.size(); + vtx_idx startingIndex = static_cast(mergedVertices.size()); mergedVertices.insert(mergedVertices.end(), exportData.m_vertices.begin(), exportData.m_vertices.end()); diff --git a/Gems/PhysX/Code/Source/Pipeline/PrimitiveShapeFitter/PrimitiveShapeFitter.cpp b/Gems/PhysX/Code/Source/Pipeline/PrimitiveShapeFitter/PrimitiveShapeFitter.cpp index 1c73a48a09..1482e9438a 100644 --- a/Gems/PhysX/Code/Source/Pipeline/PrimitiveShapeFitter/PrimitiveShapeFitter.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/PrimitiveShapeFitter/PrimitiveShapeFitter.cpp @@ -279,7 +279,7 @@ namespace PhysX::Pipeline { if (volumeTermWeight >= 0.0 && volumeTermWeight < 1.0) { - const AZ::u32 numberOfVertices = vertices.size(); + const AZ::u32 numberOfVertices = static_cast(vertices.size()); // Convert vertices and compute the mean of the vertex cloud. AZStd::vector verticesConverted(numberOfVertices, Vector{{ 0.0, 0.0, 0.0 }}); diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index b6486995c0..a47f0ba16f 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -867,7 +867,7 @@ namespace PhysX if (newJoint != nullptr) { - AzPhysics::JointIndex index = index = m_joints.size(); + AzPhysics::JointIndex index = static_cast(m_joints.size()); m_joints.emplace_back(newJointCrc, newJoint); const AzPhysics::JointHandle newJointHandle(newJointCrc, index); diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index 353085d1c1..cc55255e24 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -219,7 +219,7 @@ namespace PhysX if (m_sceneList.size() < std::numeric_limits::max()) //add a new scene if it is under the limit { - const AzPhysics::SceneHandle sceneHandle(AZ::Crc32(config.m_sceneName), (m_sceneList.size())); + const AzPhysics::SceneHandle sceneHandle(AZ::Crc32(config.m_sceneName), static_cast(m_sceneList.size())); m_sceneList.emplace_back(AZStd::make_unique(config, sceneHandle)); m_sceneAddedEvent.Signal(sceneHandle); return sceneHandle;