Свойство | Type | Description | |
---|---|---|---|
TerrainData | ].float[ |
Méthode | Description | |
---|---|---|
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
|
Méthode | Description | |
---|---|---|
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
|
public static GenerateDiamondSquare ( int n, float amplitude ) : ].float[ | ||
n | int | |
amplitude | float | |
Résultat | ].float[ |
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 | |
Résultat | System |
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 |
Résultat | System |
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 | |
Résultat | System |