Moved if section to the top

Signed-off-by: Sergey Pereslavtsev <pereslav@amazon.com>
monroegm-disable-blank-issue-2
Sergey Pereslavtsev 4 years ago
parent fc02783200
commit 8f48e4fcb6

@ -687,12 +687,6 @@ namespace PhysX
[[maybe_unused]] const AZ::Vector3& colliderScale, [[maybe_unused]] const AZ::Vector3& colliderScale,
[[maybe_unused]] const bool forceUniformScaling) const [[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(); auto heights = heightfieldShapeConfig.GetSamples();
if (heights.empty()) if (heights.empty())
@ -700,6 +694,12 @@ namespace PhysX
return; 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 xIndex = 0; xIndex < numColumns - 1; xIndex++)
{ {
for (int yIndex = 0; yIndex < numRows - 1; yIndex++) for (int yIndex = 0; yIndex < numRows - 1; yIndex++)

Loading…
Cancel
Save