These pages are auto-generated from self-documenting comments embedded in class files.
For more information on breve and steve, refer to the breve homepage.

## Real : Terrain

This class is included as part of the file Terrain.tz.
To use this class in a simulation, include the line "@use Terrain."

### Class description:

> Terrain is an experimental class to add terrains to simulations.

### Class methods:

> - draw-solid
> - draw-wireframe
> - generate-fractal-terrain
> - get-height
> - get-height-in-world
> - get-location
> - move
> - set-color
> - set-height
> - set-peak-color
> - set-scale
> - set-valley-color

`draw-solid`

> Draws the terrain as solid polygons. This is the default mode. Alternatively, the terrain can be drawn as wireframe only using the method draw-wireframe.

`draw-wireframe`

> Draws the terrain as a wireframe outline only. See also draw-solid.

`generate-fractal-terrain with-ruggedness ruggedness = 0.2 (float) with-height terrainHeight = 5.0 (float)`

> Generates a fractal landscape with a ruggedness (between 0.0 and 1.0), and maximum height terrainHeight.

`get-height at-x xCoordinate (int) at-y yCoordinate (int)`

> Returns the height of the terrain at (xCoordinate, yCoordinate). The coordinates refer to the polygons on the terrain, not to the real world location of points on the terrain.

`get-height-in-world at-x xCoordinate (double) at-z zCoordinate (double)`

> This method returns the height of the terrain at the real world (xCoordinate, zCoodinate) location. This is in contrast to the height in terrain grid coordinates given give with get-height

`get-location`

> Returns the location of this Terrain object.

`move to newLocation (vector)`

> Sets the location of the terrain to location. This method can be used to set the location of the terrain when setting up the world, but should not generally be used to dynamically over the course of the simulation.

`set-color to color (vector)`

> Sets the color of this terrain object. The peak and valley colors can also be set independently using set-peak-color and set-valley-color.

`set-height at-x xCoordinate (int) at-y yCoordinate (int) to height (double)`

> Sets the height of the terrain at (xCoordinate, yCoordinate) to height. The coordinates refer to the polygons on the terrain, not to the real world location of points on the terrain.

`set-peak-color to color (vector)`

> Sets the color of the highest regions of the terrain to color. As the height of the terrain decreases, There will be a gradient towards the color specified with set-valley-color.

`set-scale to value (double)`

> Changes the size of a single tile in the terrain. This does not change the number of elevation points in the terrain.

`set-valley-color to color (vector)`

> Sets the color of the lowest regions of the terrain to color. As the height of the terrain increases, There will be a gradient towards the color specified with set-peak-color.

Documentation created Thu Jul 3 18:18:12 2008