Ver Fonte

MousePicker mutable state removal and move water setup to constructor

Tankernn há 8 anos atrás
pai
commit
177a21ff03
1 ficheiros alterados com 3 adições e 7 exclusões
  1. 3 7
      src/main/java/eu/tankernn/game/Game.java

+ 3 - 7
src/main/java/eu/tankernn/game/Game.java

@@ -63,7 +63,8 @@ public class Game extends TankernnGame3D {
 		renderer = new MasterRenderer(loader, camera, sky);
 		try {
 			waterMaster = new WaterMaster(loader, loader.loadTexture(DUDV_MAP), loader.loadTexture(NORMAL_MAP), camera);
-			setupWater();
+			WaterTile water = new WaterTile(50, 50, 0, 50);
+			waterMaster.addWaterTile(water);
 		} catch (FileNotFoundException e) {
 			e.printStackTrace();
 		}
@@ -79,7 +80,7 @@ public class Game extends TankernnGame3D {
 			entities.add(new NPC(loader.getModel(1), new Vector3f(0, 0, 0), 1, loader.getBoundingBox(loader.getModel(1).getModel().id), terrainPack, new RoamingBehavior(roam, 10)));
 		
 		postProcessor = new PostProcessor(loader);
-		picker = new MousePicker(camera, camera.getProjectionMatrix(), entities, guiMaster.getGuis());
+		picker = new MousePicker(camera);
 		
 		FontType font;
 		try {
@@ -106,11 +107,6 @@ public class Game extends TankernnGame3D {
 		terrainPack = new TerrainPack(loader, texturePack, blendMap, 1235);
 	}
 	
-	private void setupWater() {
-		WaterTile water = new WaterTile(50, 50, 0, 50);
-		waterMaster.addWaterTile(water);
-	}
-	
 	public void update() {
 		super.update();
 		if (waterMaster.isPointUnderWater(camera.getPosition()) && postProcessor.blurFactor < 2)