diff --git a/src/roadtrip/view/model/ProceduralMapBlock.java b/src/roadtrip/model/ProceduralMapBlock.java similarity index 89% rename from src/roadtrip/view/model/ProceduralMapBlock.java rename to src/roadtrip/model/ProceduralMapBlock.java index 112c640..aaeafb3 100644 --- a/src/roadtrip/view/model/ProceduralMapBlock.java +++ b/src/roadtrip/model/ProceduralMapBlock.java @@ -1,4 +1,4 @@ -package roadtrip.view.model; +package roadtrip.model; import roadtrip.model.AbstractProceduralBlock; import roadtrip.model.ProceduralMapQuadBlock; diff --git a/src/roadtrip/view/GameWorldView.java b/src/roadtrip/view/GameWorldView.java index eb429fc..2389cc4 100644 --- a/src/roadtrip/view/GameWorldView.java +++ b/src/roadtrip/view/GameWorldView.java @@ -179,9 +179,16 @@ public class GameWorldView { //System.out.println("Grid @ " + terrainGrid.getLocalTranslation() + " s " + terrainGrid.getLocalScale()); //System.out.println("Quad " + quad.getName() + " @ " + quad.getLocalTranslation()); float cellSize = terrainGrid.getPatchSize() * terrainGrid.getLocalScale().x * 2f; - for (int i = 0; i < quadRand.nextInt(1000); i++) { - Vector2f pos = new Vector2f((quadRand.nextFloat() - 0.5f) * cellSize, (quadRand.nextFloat() - 0.5f) * cellSize) - .addLocal(quad.getWorldTranslation().x, quad.getWorldTranslation().z); + Vector2f prevPos = null; + for (int i = 0; i < quadRand.nextInt(10000); i++) { + Vector2f pos; + if (prevPos == null || quadRand.nextFloat() < 0.2f) { + pos = new Vector2f((quadRand.nextFloat() - 0.5f) * cellSize, (quadRand.nextFloat() - 0.5f) * cellSize) + .addLocal(quad.getWorldTranslation().x, quad.getWorldTranslation().z); + } else { + pos = new Vector2f((quadRand.nextFloat() - 0.5f) * 20f, (quadRand.nextFloat() - 0.5f) * 20f).addLocal(prevPos); + } + prevPos = pos; float height = quad.getHeight(pos); Vector3f location = new Vector3f(pos.x, height, pos.y) .addLocal(terrainGrid.getWorldTranslation()); diff --git a/src/roadtrip/view/model/GameWorldState.java b/src/roadtrip/view/model/GameWorldState.java index c50c30d..8c09baf 100644 --- a/src/roadtrip/view/model/GameWorldState.java +++ b/src/roadtrip/view/model/GameWorldState.java @@ -1,5 +1,6 @@ package roadtrip.view.model; +import roadtrip.model.ProceduralMapBlock; import roadtrip.view.VehicleNode; import java.util.LinkedList;