Have player spawn at ground level

This commit is contained in:
satellite 2021-04-04 21:56:35 -04:00
parent 4bb3433fba
commit bfd7abfd68
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ public class TerrainManager {
float localX = x - chunkX * dynamicInterpolationRatio;
float localY = y - chunkY * dynamicInterpolationRatio;
//get chunk elevation map
float[][] chunkElevationMap = getTerrainAtChunk(chunkX,chunkY);
float[][] chunkElevationMap = getAugmentedTerrainAtChunk(chunkX,chunkY);
//floored variants of local values
int localXf = (int)Math.floor(localX);
int localYf = (int)Math.floor(localY);

View File

@ -364,7 +364,7 @@ public class Main {
static void initPlayer(){
Globals.player = new Entity();
Globals.player.putData("position", new Vector3f(playerStartRealX,2200f,playerStartRealY));
Globals.player.putData("position", new Vector3f(playerStartRealX,terrainManager.getHeightAtPosition(playerStartRealX, playerStartRealY),playerStartRealY));
Globals.cellManager.setCellX(GL_S);
}