C# Class MyGame.Terrain

This class represent the Terrain that draw the terrain and has utility methods to deal with the terrain
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent, IRenderable
Afficher le fichier Open project: mahmoudbahaa/XNA-Game-project Class Usage Examples

Méthodes publiques

Свойство Type Description
DetailDistance float
DetailTexture Microsoft.Xna.Framework.Graphics.Texture2D
DetailTextureTiling float
RTexture Microsoft.Xna.Framework.Graphics.Texture2D

Méthodes publiques

Méthode Description
Draw ( ) : void
Draw ( GameTime gameTime ) : void

This method renders the current state.

GetHeightAtPosition ( float X, float Z ) : float
GetHeightAtPosition ( float X, float Z, float &Steepness ) : float
SetClipPlane ( Vector4 Plane ) : void
Terrain ( Game game, Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D HeightMap, float CellSize, float Height, Microsoft.Xna.Framework.Graphics.Texture2D BaseTexture, float TextureTiling, Vector3 LightDirection ) : System
Update ( GameTime gameTime ) : void

Private Methods

Méthode Description
createIndices ( ) : void
createVertices ( ) : void
genNormals ( ) : void
getHeights ( ) : void

Method Details

Draw() public méthode

public Draw ( ) : void
Résultat void

Draw() public méthode

This method renders the current state.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The elapsed game time.
Résultat void

GetHeightAtPosition() public méthode

public GetHeightAtPosition ( float X, float Z ) : float
X float
Z float
Résultat float

GetHeightAtPosition() public méthode

public GetHeightAtPosition ( float X, float Z, float &Steepness ) : float
X float
Z float
Steepness float
Résultat float

SetClipPlane() public méthode

public SetClipPlane ( Vector4 Plane ) : void
Plane Vector4
Résultat void

Terrain() public méthode

public Terrain ( Game game, Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D HeightMap, float CellSize, float Height, Microsoft.Xna.Framework.Graphics.Texture2D BaseTexture, float TextureTiling, Vector3 LightDirection ) : System
game Game
camera Camera
HeightMap Microsoft.Xna.Framework.Graphics.Texture2D
CellSize float
Height float
BaseTexture Microsoft.Xna.Framework.Graphics.Texture2D
TextureTiling float
LightDirection Vector3
Résultat System

Update() public méthode

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

Property Details

DetailDistance public_oe property

public float DetailDistance
Résultat float

DetailTexture public_oe property

public Texture2D,Microsoft.Xna.Framework.Graphics DetailTexture
Résultat Microsoft.Xna.Framework.Graphics.Texture2D

DetailTextureTiling public_oe property

public float DetailTextureTiling
Résultat float

RTexture public_oe property

public Texture2D,Microsoft.Xna.Framework.Graphics RTexture
Résultat Microsoft.Xna.Framework.Graphics.Texture2D