C# Class Project2.GameObjects.DiamondSquareTerrain

Inheritance: Terrain
Show file Open project: nuclearpidgeon/graphicsproj2 Class Usage Examples

Public Properties

Property Type Description
Amplitude float

Public Methods

Method Description
DiamondSquareTerrain ( Project2Game game, System.Vector3 position, int density, float xScale, float zScale, float amplitude ) : System

Construct a static physics mesh terrain procedurally using diamond-square. Density is n, a square with width 2^n-1 will be generated.

Protected Methods

Method Description
GeneratePhysicsDescription ( ) : RigidBody
GenerateTerrainData ( ) : ].float[

Method Details

DiamondSquareTerrain() public method

Construct a static physics mesh terrain procedurally using diamond-square. Density is n, a square with width 2^n-1 will be generated.
public DiamondSquareTerrain ( Project2Game game, System.Vector3 position, int density, float xScale, float zScale, float amplitude ) : System
game Project2Game
position System.Vector3 Bottom left corner of heightfield
density int Controls number of points in height field as square of side length 2^n-1 (e.g. 6)
xScale float
zScale float
amplitude float Variance of height field
return System

GeneratePhysicsDescription() protected method

protected GeneratePhysicsDescription ( ) : RigidBody
return RigidBody

GenerateTerrainData() protected method

protected GenerateTerrainData ( ) : ].float[
return ].float[

Property Details

Amplitude public property

public float Amplitude
return float