C# Класс Project2.GameObjects.Terrain

Наследование: Project2.GameObjects.Abstract.ModelPhysicsObject
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
TerrainData ].float[

Открытые методы

Метод Описание
GenerateDiamondSquare ( int n, float amplitude ) : ].float[
Terrain ( Project2Game game, System.Vector3 position, SharpDX.Toolkit.Graphics.Texture2D heightMap, double scale ) : System

Creates a static terrain mesh based on a heightmap texture.

Terrain ( Project2Game game, System.Vector3 position, int density, double scale, double 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.

Terrain ( Project2Game game, System.Vector3 position, int xScale, int yScale, float frontHeight = 0.0f, float backHeight = 0.0f ) : System

Constructs a flat terrain

Приватные методы

Метод Описание
GeneratePhyicsDescription ( System.Vector3 position, int xScale, int yScale, float frontHeight, float backHeight, bool isStatic ) : PhysicsDescription
GeneratePhysicsDescription ( System.Vector3 position, SharpDX.Toolkit.Graphics.Texture2D heightMapTexture, double scale, System.Boolean isStatic ) : PhysicsDescription

Static method to construct physics description

GeneratePhysicsDescription ( System.Vector3 position, int density, double scale, double amplitude, System.Boolean isStatic ) : PhysicsDescription
ProcessHeightMap ( SharpDX.Toolkit.Graphics.Texture2D heightMap ) : ].float[

Process a heightmap into a 2D array of integers representing the terrain data. Set the terrain object's height and width parameters.

Terrain ( Project2Game game, PhysicsDescription physicsDescription ) : System
getTerrainColour ( float height, float minHeight, float maxHeight ) : Color

Decides on a colour for terrain based on height and some noise

Описание методов

GenerateDiamondSquare() публичный статический Метод

public static GenerateDiamondSquare ( int n, float amplitude ) : ].float[
n int
amplitude float
Результат ].float[

Terrain() публичный Метод

Creates a static terrain mesh based on a heightmap texture.
public Terrain ( Project2Game game, System.Vector3 position, SharpDX.Toolkit.Graphics.Texture2D heightMap, double scale ) : System
game Project2Game
position System.Vector3
heightMap SharpDX.Toolkit.Graphics.Texture2D
scale double
Результат System

Terrain() публичный Метод

Construct a static physics mesh terrain procedurally using diamond-square. Density is n, a square with width 2^n-1 will be generated.
public Terrain ( Project2Game game, System.Vector3 position, int density, double scale, double 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)
scale double Distance between height field points
amplitude double Variance of height field
Результат System

Terrain() публичный Метод

Constructs a flat terrain
public Terrain ( Project2Game game, System.Vector3 position, int xScale, int yScale, float frontHeight = 0.0f, float backHeight = 0.0f ) : System
game Project2Game
position System.Vector3
xScale int
yScale int
frontHeight float
backHeight float
Результат System

Описание свойств

TerrainData публичное свойство

public float[,] TerrainData
Результат ].float[