mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Fixed Name Scope Collision
This commit is contained in:
parent
234fcb09c2
commit
27238b077f
1 changed files with 4 additions and 4 deletions
|
|
@ -8,8 +8,8 @@
|
||||||
const cells = {v: [], c: [], b: []}; // voronoi cells: v = cell vertices, c = adjacent cells, b = near-border cell
|
const cells = {v: [], c: [], b: []}; // voronoi cells: v = cell vertices, c = adjacent cells, b = near-border cell
|
||||||
const vertices = {p: [], v: [], c: []}; // cells vertices: p = vertex coordinates, v = neighboring vertices, c = adjacent cells
|
const vertices = {p: [], v: [], c: []}; // cells vertices: p = vertex coordinates, v = neighboring vertices, c = adjacent cells
|
||||||
|
|
||||||
var triangles = delaunay.triangles.length;
|
var trianglesLength = delaunay.triangles.length;
|
||||||
for (let e=0; e < triangles; e++) {
|
for (let e=0; e < trianglesLength; e++) {
|
||||||
|
|
||||||
const p = delaunay.triangles[nextHalfedge(e)];
|
const p = delaunay.triangles[nextHalfedge(e)];
|
||||||
if (p < pointsN && !cells.c[p]) {
|
if (p < pointsN && !cells.c[p]) {
|
||||||
|
|
@ -51,8 +51,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function triangleCenter(t) {
|
function triangleCenter(t) {
|
||||||
let vertices = pointsOfTriangle(t).map(p => points[p]);
|
let vertexPoints = pointsOfTriangle(t).map(p => points[p]);
|
||||||
return circumcenter(vertices[0], vertices[1], vertices[2]);
|
return circumcenter(vertexPoints[0], vertexPoints[1], vertexPoints[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {cells, vertices}
|
return {cells, vertices}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue