Constructor
new MyTerrain(scene, divs, size, maxHeight)
Instantiates a new terrain instance.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
scene |
number
|
the scene | |
divs |
integer
|
100 | the number of division of the terrain |
size |
number
|
50 | the size of the terrain |
maxHeight |
number
|
8 | the max height of the terrain |
Methods
displayWithShaders(terrainTex, terrainMap)
Displays the terrain.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
terrainTex |
CGFtexture
|
the texture of the terrain |
terrainMap |
CGFtexture
|
the texture of the height map |
getHeight(positionX, positionZ)
Gets the height for a specific position.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
positionX |
number
|
the X position |
positionZ |
number
|
the Y position |