C# 클래스 Project2.GameObjects.Terrain

상속: Project2.GameObjects.Abstract.ModelPhysicsObject
파일 보기 프로젝트 열기: nuclearpidgeon/graphicsproj2

공개 프로퍼티들

프로퍼티 타입 설명
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[