From 6d3e9af2f81c5b2f10bf920a97278e46566f5342 Mon Sep 17 00:00:00 2001 From: Vanic Date: Fri, 16 Jan 2026 17:50:09 +0300 Subject: [PATCH] Bump changes --- mods/CORE/MapGen/src/MapGen/Triangle.lua | 13 +++++++++++-- mods/CORE/MapGen/src/MapGen/Triangulation.lua | 2 +- .../mapGenerator/src/mapGenerator.lua | 12 ++++-------- .../mapGenerator/textures/maps/map.ff | Bin 2064 -> 2064 bytes 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/mods/CORE/MapGen/src/MapGen/Triangle.lua b/mods/CORE/MapGen/src/MapGen/Triangle.lua index 42ac035..02ceda8 100644 --- a/mods/CORE/MapGen/src/MapGen/Triangle.lua +++ b/mods/CORE/MapGen/src/MapGen/Triangle.lua @@ -280,12 +280,14 @@ function Triangle:getCircumCircle2D() return c, r end +---@alias MapGen.Triangle.CircumCircleEnum 'IN'|'BEHIND'|'ON' + ---Checks if a given point lies into the triangle circumcircle. --- ---Note: This function does not take into account the Y-coordinate, ---that is, the calculation is performed on the projection of the triangle XZ. ---@param p MapGen.Peak ----@return boolean +---@return MapGen.Triangle.CircumCircleEnum function Triangle:inCircumCircle2D(p) local pos = p:getPeakPos() @@ -293,7 +295,14 @@ function Triangle:inCircumCircle2D(p) local distance = (c - pos):length() - return distance <= r + + if distance - r < 1e-10 then + return 'ON' + elseif distance < r then + return 'IN' + else + return 'BEHIND' + end end return Triangle diff --git a/mods/CORE/MapGen/src/MapGen/Triangulation.lua b/mods/CORE/MapGen/src/MapGen/Triangulation.lua index 1ea6f8f..7c05483 100644 --- a/mods/CORE/MapGen/src/MapGen/Triangulation.lua +++ b/mods/CORE/MapGen/src/MapGen/Triangulation.lua @@ -119,7 +119,7 @@ function Triangulation.triangulate( vertices ) for j = #triangles, 1, -1 do local curTriangle = triangles[j] - if curTriangle:inCircumCircle2D(vertices[i]) then + if curTriangle:inCircumCircle2D(vertices[i]) == 'IN' then edges[#edges + 1] = curTriangle.e1 edges[#edges + 1] = curTriangle.e2 edges[#edges + 1] = curTriangle.e3 diff --git a/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua b/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua index cb93de2..62859e4 100644 --- a/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua +++ b/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua @@ -137,32 +137,28 @@ mapGenerator:register2DPeaks('midgard', for _, c in ipairs({'landscape', 'temp', 'humidity'}) do mapGenerator:registerLayerNoiseColor('midgard', c, '#4978c6', land1) mapGenerator:registerLayerNoiseColor('midgard', c, '#77ea72', land2) ---[[ + --[[ mapGenerator:register2DPeaks('midgard', c, { { color = '#77ea72', pos = vector.new(512, 0, 512) }, { - color = '#77ea72', + color = '#4978c6', pos = vector.new(512, 0, -512) }, { color = '#77ea72', pos = vector.new(-512, 0, -512) }, - { - color = '#77ea72', - pos = vector.new(-512, 0, 512) - }, { color = '#4978c6', - pos = vector.new(0, 0, 0) + pos = vector.new(-512, 0, 512) }, })--]] end -mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 100,{x=0, y=0}, 'landscape') +mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 50,{x=0, y=0}, 'landscape') mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 150,{x=0, y=0}, 'temp') mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 200,{x=0, y=0}, 'humidity') diff --git a/mods/ENVIRONMENT/mapGenerator/textures/maps/map.ff b/mods/ENVIRONMENT/mapGenerator/textures/maps/map.ff index dcbda9dae30f132153abf8ae7dbe4f9561c4ece6..87cd0452280528dc197c04c344d134b1bcb1005e 100644 GIT binary patch literal 2064 zcmc(au@S%^48#~AYcWQ02~{dLFd@URgt-)2Au4=2S9-NGuJ*ilDdqUC)-mSH?0v0> v%)fujODD8;SYEoJwZrn#4XquPmu_h7u)K6bYlr2f8(KRoFWu1EVR`A^KE+$2 literal 2064 zcmdUqu?>Sj5Cp#jw?!GY43VQxphAkFiAN45S!s3m7%UN>(cbRuJ=3$krt$MGr98gh zJa1dAt=)yguq^A^n&a93;qEYZ_wb?1xjB2#<)V4-K6#k!&*rmz*&KJ3ZlByyU-#&9 z)cjGc{o12GT64Xc9;NHa=G?xUYcHBST8R(w(U3W0uEdWR?e+SaN9#M7E6M2`jjzQ2 X7xg~6_da{@*L`|m)R)agJy-iX=d66<