Fixed opengl terrain not rendering displaced vertices
This commit is contained in:
parent
3e73633c25
commit
d68eaab5df
1 changed files with 5 additions and 6 deletions
|
@ -10,7 +10,6 @@
|
||||||
#include "CameraDefinition.h"
|
#include "CameraDefinition.h"
|
||||||
#include "OpenGLRenderer.h"
|
#include "OpenGLRenderer.h"
|
||||||
#include "TerrainRenderer.h"
|
#include "TerrainRenderer.h"
|
||||||
#include "TexturesRenderer.h"
|
|
||||||
#include "Scenery.h"
|
#include "Scenery.h"
|
||||||
#include "TerrainDefinition.h"
|
#include "TerrainDefinition.h"
|
||||||
#include "Texture2D.h"
|
#include "Texture2D.h"
|
||||||
|
@ -81,7 +80,6 @@ bool OpenGLTerrainChunk::maintain() {
|
||||||
} else {
|
} else {
|
||||||
setFirstStepVertices();
|
setFirstStepVertices();
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else if (vertices_level < 64) {
|
} else if (vertices_level < 64) {
|
||||||
augmentVertices();
|
augmentVertices();
|
||||||
subchanged = true;
|
subchanged = true;
|
||||||
|
@ -241,10 +239,11 @@ void OpenGLTerrainChunk::updateVertices(const OpenGLVertexArray &source, int ver
|
||||||
|
|
||||||
void OpenGLTerrainChunk::fillVerticesFromSquare(OpenGLVertexArray *array, int index_offset, double x, double z,
|
void OpenGLTerrainChunk::fillVerticesFromSquare(OpenGLVertexArray *array, int index_offset, double x, double z,
|
||||||
double size) {
|
double size) {
|
||||||
Vector3 c1(x, _renderer->getTerrainRenderer()->getHeight(x, z, true, false), z);
|
Vector3 water_offset = Vector3(0.0, _renderer->getScenery()->getTerrain()->getWaterOffset(), 0.0);
|
||||||
Vector3 c2(x, _renderer->getTerrainRenderer()->getHeight(x, z + size, true, false), z + size);
|
Vector3 c1 = _renderer->getTerrainRenderer()->getDisplaced(x, z, true).sub(water_offset);
|
||||||
Vector3 c3(x + size, _renderer->getTerrainRenderer()->getHeight(x + size, z + size, true, false), z + size);
|
Vector3 c2 = _renderer->getTerrainRenderer()->getDisplaced(x, z + size, true).sub(water_offset);
|
||||||
Vector3 c4(x + size, _renderer->getTerrainRenderer()->getHeight(x + size, z, true, false), z);
|
Vector3 c3 = _renderer->getTerrainRenderer()->getDisplaced(x + size, z + size, true).sub(water_offset);
|
||||||
|
Vector3 c4 = _renderer->getTerrainRenderer()->getDisplaced(x + size, z, true).sub(water_offset);
|
||||||
|
|
||||||
double u = (x - _startx) / _size;
|
double u = (x - _startx) / _size;
|
||||||
double v = (z - _startz) / _size;
|
double v = (z - _startz) / _size;
|
||||||
|
|
Loading…
Reference in a new issue