TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ SetElevation()

void Mesh::SetElevation ( float  elevation,
int  x,
int  y 
)

Definition at line 339 of file Mesh.cpp.

340{
341 if(!vert)
342 {
343 return;
344 }
345
346 int i = x + y * res;
347
348 if (i > vertexCount)
349 {
350 return;
351 }
352
353 if (elevation > maxHeight)
354 {
355 maxHeight = elevation;
356 }
357
358 if (elevation < minHeight)
359 {
360 minHeight = elevation;
361 }
362
363 vert[i].position.y = elevation;
364 vert[i].extras1.x = elevation;
365}