Browse Source

Combine inputBoundsStart and scaledTexelOffset into single position offset

Signed-off-by: Chris Galvan <[email protected]>
Chris Galvan 3 years ago
parent
commit
3d15e67c48

+ 3 - 1
Gems/GradientSignal/Code/Source/Editor/EditorGradientBakerComponent.cpp

@@ -117,6 +117,8 @@ namespace GradientSignal
         const AZ::Vector3 pixelToBoundsScale(
         const AZ::Vector3 pixelToBoundsScale(
             inputBoundsExtentsX / static_cast<float>(imageResolutionX), inputBoundsExtentsY / static_cast<float>(imageResolutionY), 0.0f);
             inputBoundsExtentsX / static_cast<float>(imageResolutionX), inputBoundsExtentsY / static_cast<float>(imageResolutionY), 0.0f);
 
 
+        const AZ::Vector3 positionOffset = inputBoundsStart + scaledTexelOffset;
+
         // Generate a set of input positions that are inside the bounds along with
         // Generate a set of input positions that are inside the bounds along with
         // their corresponding x,y indices
         // their corresponding x,y indices
         AZStd::vector<AZ::Vector3> inputPositions;
         AZStd::vector<AZ::Vector3> inputPositions;
@@ -129,7 +131,7 @@ namespace GradientSignal
                 // imageBoundsY)
                 // imageBoundsY)
                 AZ::Vector3 uvw(static_cast<float>(x), static_cast<float>((imageResolutionY - 1) - y), 0.0f);
                 AZ::Vector3 uvw(static_cast<float>(x), static_cast<float>((imageResolutionY - 1) - y), 0.0f);
 
 
-                AZ::Vector3 position = inputBoundsStart + (uvw * pixelToBoundsScale) + scaledTexelOffset;
+                AZ::Vector3 position = positionOffset + (uvw * pixelToBoundsScale);
 
 
                 bool inBounds = true;
                 bool inBounds = true;
                 LmbrCentral::ShapeComponentRequestsBus::EventResult(
                 LmbrCentral::ShapeComponentRequestsBus::EventResult(