Fix: add init() method to Landscape class

This commit is contained in:
Richard Zink committed 2026-10-06 15:13:22 +02:00
1 parent bc27629903
commit a3fae177fa
1 file changed
+10
+10
View File
@@ -70,6 +70,16 @@
this.init(); this.init();
} }
init() {
const spacing = 40;
for (let x = -200; x <= 200; x += spacing) {
for (let z = -200; z <= 200; z += spacing) {
const y = Math.sin(x / 30) * 20 + Math.cos(z / 30) * 20 + Math.random() * 10;
this.points.set(`${x},${z}`, new Point3D(x, y, z));
}
}
}
getKey(x, z) { getKey(x, z) {
return `${Math.round(x / this.gridSize)},${Math.round(z / this.gridSize)}`; return `${Math.round(x / this.gridSize)},${Math.round(z / this.gridSize)}`;
} }