Moved if section to the top

Signed-off-by: Sergey Pereslavtsev <pereslav@amazon.com>
This commit is contained in:
Sergey Pereslavtsev
2022-01-31 11:04:13 +00:00
parent fc02783200
commit 8f48e4fcb6
+6 -6
View File
@@ -687,12 +687,6 @@ namespace PhysX
[[maybe_unused]] const AZ::Vector3& colliderScale,
[[maybe_unused]] const bool forceUniformScaling) const
{
const int numColumns = heightfieldShapeConfig.GetNumColumns();
const int numRows = heightfieldShapeConfig.GetNumRows();
const float minXBounds = -(numColumns * heightfieldShapeConfig.GetGridResolution().GetX()) / 2.0f;
const float minYBounds = -(numRows * heightfieldShapeConfig.GetGridResolution().GetY()) / 2.0f;
auto heights = heightfieldShapeConfig.GetSamples();
if (heights.empty())
@@ -700,6 +694,12 @@ namespace PhysX
return;
}
const int numColumns = heightfieldShapeConfig.GetNumColumns();
const int numRows = heightfieldShapeConfig.GetNumRows();
const float minXBounds = -(numColumns * heightfieldShapeConfig.GetGridResolution().GetX()) / 2.0f;
const float minYBounds = -(numRows * heightfieldShapeConfig.GetGridResolution().GetY()) / 2.0f;
for (int xIndex = 0; xIndex < numColumns - 1; xIndex++)
{
for (int yIndex = 0; yIndex < numRows - 1; yIndex++)