C# Class Project2.GameObjects.Abstract.Terrain

Inheritance: GameObject, IPhysicsObject
Show file Open project: nuclearpidgeon/graphicsproj2

Public Properties

Property Type Description
terrainHeight int
terrainWidth int
xScale float
zScale float

Protected Properties

Property Type Description
IndexBuffer Buffer
Indices int[]
VertexBuffer System.Buffer
Vertices VertexPositionNormalColor[]
maxHeight float
minHeight float

Public Methods

Method Description
Destroy ( ) : void
Destroy ( bool Async = false ) : void
Draw ( SharpDX gametime ) : void

Protected Methods

Method Description
CreateBuffers ( ) : void
GenerateGeometry ( ) : void
GeneratePhysicsDescription ( ) : RigidBody
GenerateTerrainData ( ) : ].float[
Terrain ( Project2Game game, System.Vector3 position, float xScale, float zScale ) : System
colorFromHeight ( float heightval ) : Color

Converts a height value between 0 and 1 into a color, based on a terrain height color scheme

Private Methods

Method Description
interpolateColors ( System.Vector3 colorA, System.Vector3 colorB, float distance ) : Color

Returns a color at a certain amount between two given colors in the RGB space

Method Details

CreateBuffers() protected method

protected CreateBuffers ( ) : void
return void

Destroy() public method

public Destroy ( ) : void
return void

Destroy() public method

public Destroy ( bool Async = false ) : void
Async bool
return void

Draw() public method

public Draw ( SharpDX gametime ) : void
gametime SharpDX
return void

GenerateGeometry() protected method

protected GenerateGeometry ( ) : void
return void

GeneratePhysicsDescription() protected abstract method

protected abstract GeneratePhysicsDescription ( ) : RigidBody
return RigidBody

GenerateTerrainData() protected abstract method

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

Terrain() protected method

protected Terrain ( Project2Game game, System.Vector3 position, float xScale, float zScale ) : System
game Project2Game
position System.Vector3
xScale float
zScale float
return System

colorFromHeight() protected method

Converts a height value between 0 and 1 into a color, based on a terrain height color scheme
protected colorFromHeight ( float heightval ) : Color
heightval float The height value between 0.0f and 1.0f to convert into a color
return Color

Property Details

IndexBuffer protected property

protected Buffer IndexBuffer
return Buffer

Indices protected property

protected int[] Indices
return int[]

VertexBuffer protected property

protected Buffer,System VertexBuffer
return System.Buffer

Vertices protected property

protected VertexPositionNormalColor[] Vertices
return VertexPositionNormalColor[]

maxHeight protected property

protected float maxHeight
return float

minHeight protected property

protected float minHeight
return float

terrainHeight public property

public int terrainHeight
return int

terrainWidth public property

public int terrainWidth
return int

xScale public property

public float xScale
return float

zScale public property

public float zScale
return float