mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Fix terrain water horizontal flip by correcting step vector axes
stepX/stepY were transposed: columns stepped south instead of east and rows stepped east instead of south, mirroring all overworld water. Also fix per-chunk origin to use layer.x for east offset and layer.y for south.
This commit is contained in:
parent
ad66ef9ca6
commit
e4d94e5d7c
1 changed files with 6 additions and 6 deletions
|
|
@ -684,12 +684,12 @@ void WaterRenderer::loadFromTerrain(const pipeline::ADTTerrain& terrain, bool ap
|
||||||
layer.minHeight
|
layer.minHeight
|
||||||
);
|
);
|
||||||
surface.origin = glm::vec3(
|
surface.origin = glm::vec3(
|
||||||
surface.position.x - (static_cast<float>(layer.y) * TILE_SIZE),
|
surface.position.x - (static_cast<float>(layer.x) * TILE_SIZE),
|
||||||
surface.position.y - (static_cast<float>(layer.x) * TILE_SIZE),
|
surface.position.y - (static_cast<float>(layer.y) * TILE_SIZE),
|
||||||
layer.minHeight
|
layer.minHeight
|
||||||
);
|
);
|
||||||
surface.stepX = glm::vec3(0.0f, -TILE_SIZE, 0.0f);
|
surface.stepX = glm::vec3(-TILE_SIZE, 0.0f, 0.0f);
|
||||||
surface.stepY = glm::vec3(-TILE_SIZE, 0.0f, 0.0f);
|
surface.stepY = glm::vec3(0.0f, -TILE_SIZE, 0.0f);
|
||||||
|
|
||||||
surface.minHeight = layer.minHeight;
|
surface.minHeight = layer.minHeight;
|
||||||
surface.maxHeight = layer.maxHeight;
|
surface.maxHeight = layer.maxHeight;
|
||||||
|
|
@ -750,8 +750,8 @@ void WaterRenderer::loadFromTerrain(const pipeline::ADTTerrain& terrain, bool ap
|
||||||
// Origin = chunk(0,0) position (NW corner of tile)
|
// Origin = chunk(0,0) position (NW corner of tile)
|
||||||
surface.origin = glm::vec3(chunk00.position[0], chunk00.position[1], groupHeight);
|
surface.origin = glm::vec3(chunk00.position[0], chunk00.position[1], groupHeight);
|
||||||
surface.position = surface.origin;
|
surface.position = surface.origin;
|
||||||
surface.stepX = glm::vec3(0.0f, -TILE_SIZE, 0.0f);
|
surface.stepX = glm::vec3(-TILE_SIZE, 0.0f, 0.0f);
|
||||||
surface.stepY = glm::vec3(-TILE_SIZE, 0.0f, 0.0f);
|
surface.stepY = glm::vec3(0.0f, -TILE_SIZE, 0.0f);
|
||||||
|
|
||||||
surface.minHeight = groupHeight;
|
surface.minHeight = groupHeight;
|
||||||
surface.maxHeight = groupHeight;
|
surface.maxHeight = groupHeight;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue