Automap (client) [VS plugin mod]
Révision | b12ce327c9ba97d184bfe079f86b847bf2ef9a17 (tree) |
---|---|
l'heure | 2021-05-19 05:53:47 |
Auteur | melchior <melchior@user...> |
Commiter | melchior |
W.I.P. changed slope variables
@@ -153,27 +153,22 @@ namespace Automap | ||
153 | 153 | continue; |
154 | 154 | } |
155 | 155 | |
156 | - //if (mapCornerChunks.Any(chks => chks == null)) { | |
157 | - //Logger.Warning("mapCornerChunks A.W.O.L. near : X{0} Y{1} Z{2} - ", localX, localY, localZ); | |
158 | - //continue; | |
159 | - //} | |
160 | - | |
161 | 156 | float slopeBoost = 1f; |
162 | - int leftTop, rightTop, leftBot; | |
163 | - | |
164 | - int up_X = localX; | |
165 | - int low_X = localX + 1; | |
166 | - int left_Z = localZ; | |
167 | - int right_Z = localZ + 1; | |
157 | + int northH, northWestH, westH; | |
168 | 158 | |
169 | - //topX = GameMath.Mod(topX, chunkSize + 1); | |
170 | - //leftZ = GameMath.Mod(leftZ, chunkSize + 1); | |
159 | + int north_X = localX + 1; | |
160 | + int north_Z = localZ; | |
161 | + int west_X = localX; | |
162 | + int west_Z = localZ + 1; | |
163 | + int northWest_X = localX; | |
164 | + int northWest_Z = localZ; | |
171 | 165 | |
172 | - leftTop = Math.Sign(localY - (overlapHeightmap[up_X, left_Z] == 0 ? avgOverlap_Y : overlapHeightmap[up_X, left_Z])); | |
173 | - rightTop = Math.Sign(localY - (overlapHeightmap[up_X, right_Z]== 0 ? avgOverlap_Y : overlapHeightmap[up_X, right_Z])); | |
174 | - leftBot = Math.Sign(localY - (overlapHeightmap[low_X, left_Z]== 0 ? avgOverlap_Y : overlapHeightmap[low_X, left_Z])); | |
166 | + | |
167 | + northH = Math.Sign(localY - (overlapHeightmap[north_X, north_Z] == 0 ? avgOverlap_Y : overlapHeightmap[north_X, north_Z])); | |
168 | + northWestH = Math.Sign(localY - (overlapHeightmap[northWest_X, northWest_Z] == 0 ? avgOverlap_Y : overlapHeightmap[northWest_X, northWest_Z])); | |
169 | + westH = Math.Sign(localY - (overlapHeightmap[west_X, west_Z] == 0 ? avgOverlap_Y : overlapHeightmap[west_X, west_Z])); | |
175 | 170 | |
176 | - float slopeness = (leftTop + rightTop + leftBot); | |
171 | + float slopeness = (northH + northWestH + westH); | |
177 | 172 | |
178 | 173 | if (slopeness > 0) slopeBoost = 1.2f; |
179 | 174 | if (slopeness < 0) slopeBoost = 0.8f; |