1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

FACTO-236: Missed distortPositionConcentricCircles function

This commit is contained in:
Aaron Veden 2023-03-22 17:59:28 -07:00
parent 14b450d54e
commit 3725669857
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84

View File

@ -155,5 +155,26 @@ function MathUtils.distortPosition(rg, position, size)
return position
end
function MathUtils.distortPositionConcentricCircles(rg, position, size, min)
local xDistort = MathUtils.gaussianRandomRangeRG(1, 0.5, 0, 2, rg) - 1
local yDistort = MathUtils.gaussianRandomRangeRG(1, 0.5, 0, 2, rg) - 1
local xModifier = (xDistort * size)
if xModifier < 0 then
xModifier = xModifier + -min
else
xModifier = xModifier + min
end
local yModifier = (yDistort * size)
if yModifier < 0 then
yModifier = yModifier + -min
else
yModifier = yModifier + min
end
position.x = position.x + xModifier
position.y = position.y + yModifier
return position
end
MathUtilsG = MathUtils
return MathUtils