Have player spawn at ground level
This commit is contained in:
parent
4bb3433fba
commit
bfd7abfd68
@ -100,7 +100,7 @@ public class TerrainManager {
|
|||||||
float localX = x - chunkX * dynamicInterpolationRatio;
|
float localX = x - chunkX * dynamicInterpolationRatio;
|
||||||
float localY = y - chunkY * dynamicInterpolationRatio;
|
float localY = y - chunkY * dynamicInterpolationRatio;
|
||||||
//get chunk elevation map
|
//get chunk elevation map
|
||||||
float[][] chunkElevationMap = getTerrainAtChunk(chunkX,chunkY);
|
float[][] chunkElevationMap = getAugmentedTerrainAtChunk(chunkX,chunkY);
|
||||||
//floored variants of local values
|
//floored variants of local values
|
||||||
int localXf = (int)Math.floor(localX);
|
int localXf = (int)Math.floor(localX);
|
||||||
int localYf = (int)Math.floor(localY);
|
int localYf = (int)Math.floor(localY);
|
||||||
|
|||||||
@ -364,7 +364,7 @@ public class Main {
|
|||||||
|
|
||||||
static void initPlayer(){
|
static void initPlayer(){
|
||||||
Globals.player = new Entity();
|
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);
|
Globals.cellManager.setCellX(GL_S);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user