|
|
@ -145,7 +145,7 @@ public class Terrain { |
|
|
|
Vector2f terrain_cell = getTerrainCell(terrainLoc); |
|
|
|
Vector2f terrain_cell = getTerrainCell(terrainLoc); |
|
|
|
|
|
|
|
|
|
|
|
int pixel_x = (int) Math.floor(terrain_cell.x); |
|
|
|
int pixel_x = (int) Math.floor(terrain_cell.x); |
|
|
|
int pixel_t = (int) Math.floor(terrain_cell.y); |
|
|
|
int pixel_y = (int) Math.floor(terrain_cell.y); |
|
|
|
|
|
|
|
|
|
|
|
Vector2f pixel_offset = new Vector2f(terrain_cell.x % 1, terrain_cell.y % 1); |
|
|
|
Vector2f pixel_offset = new Vector2f(terrain_cell.x % 1, terrain_cell.y % 1); |
|
|
|
|
|
|
|
|
|
|
@ -156,10 +156,10 @@ public class Terrain { |
|
|
|
float bottomLeftHeight; |
|
|
|
float bottomLeftHeight; |
|
|
|
float bottomRightHeight; |
|
|
|
float bottomRightHeight; |
|
|
|
|
|
|
|
|
|
|
|
topLeftHeight = terrain_pixel_data[pixel_x][pixel_t]; |
|
|
|
topLeftHeight = terrain_pixel_data[pixel_x][pixel_y]; |
|
|
|
topRightHeight = terrain_pixel_data[pixel_x + 1][pixel_t]; |
|
|
|
topRightHeight = terrain_pixel_data[pixel_x + 1][pixel_y]; |
|
|
|
bottomLeftHeight = terrain_pixel_data[pixel_x][pixel_t + 1]; |
|
|
|
bottomLeftHeight = terrain_pixel_data[pixel_x][pixel_y + 1]; |
|
|
|
bottomRightHeight = terrain_pixel_data[pixel_x + 1][pixel_t + 1]; |
|
|
|
bottomRightHeight = terrain_pixel_data[pixel_x + 1][pixel_y + 1]; |
|
|
|
|
|
|
|
|
|
|
|
// Interpolate between the 4 vertices
|
|
|
|
// Interpolate between the 4 vertices
|
|
|
|
|
|
|
|
|
|
|
|