C# Class Project2.GameObjects.Abstract.Terrain

Inheritance: GameObject, IPhysicsObject
Mostra 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_oe property

protected Buffer IndexBuffer
return Buffer

Indices protected_oe property

protected int[] Indices
return int[]

VertexBuffer protected_oe property

protected Buffer,System VertexBuffer
return System.Buffer

Vertices protected_oe property

protected VertexPositionNormalColor[] Vertices
return VertexPositionNormalColor[]

maxHeight protected_oe property

protected float maxHeight
return float

minHeight protected_oe property

protected float minHeight
return float

terrainHeight public_oe property

public int terrainHeight
return int

terrainWidth public_oe property

public int terrainWidth
return int

xScale public_oe property

public float xScale
return float

zScale public_oe property

public float zScale
return float