Tried out this fractal terrain stuff but it just looks the same i guess?

This commit is contained in:
iDunnoDev
2022-05-30 12:32:44 +01:00
committed by iDunnoDev
parent 51afdeecbd
commit fa57ec29aa
9 changed files with 134 additions and 6 deletions

View File

@ -672,7 +672,7 @@ float TerrainNode::GetHeightAtPoint(float x, float z, bool waterCollide)
int cellX = (int)((x - _terrainStartX) / _cellSizeX);
int cellZ = (int)((_terrainStartZ - z) / _cellSizeZ);
int currentIndex = (cellZ * _gridCols * 4) + (cellX * 4);
int currentIndex = ((cellZ * _gridCols) + cellX) * 4;
float dx = x - _terrainVerts[currentIndex].Position.x;
float dz = z - _terrainVerts[currentIndex].Position.z;