C# Класс FarseerPhysics.Common.TextureTools.Terrain

Simple class to maintain a terrain. It can keep track
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
cellSize int
center Microsoft.Xna.Framework.Vector2
decomposer TriangulationAlgorithm
height float
iterations int
pointsPerUnit int
subCellSize int
width float
world FarseerPhysics.Dynamics.World

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

Метод Описание
Terrain ( World world, AABB area ) : System.Collections.Generic

Creates a new terrain.

Terrain ( World world, Vector2 position, float width, float height ) : System.Collections.Generic

Creates a new terrain

applyData ( sbyte data, Vector2 offset = default(Vector2) ) : void

Apply the specified texture data to the terrain.

generateTerrain ( int gx, int gy ) : void
initialize ( ) : void

Initialize the terrain for use.

modifyTerrain ( Vector2 location, sbyte value ) : void

Modify a single point in the terrain.

regenerateTerrain ( ) : void

Regenerate the terrain.

removeOldData ( int xStart, int xEnd, int yStart, int yEnd ) : void

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

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

Creates a new terrain.
public Terrain ( World world, AABB area ) : System.Collections.Generic
world FarseerPhysics.Dynamics.World The World
area FarseerPhysics.Collision.AABB The area of the terrain.
Результат System.Collections.Generic

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

Creates a new terrain
public Terrain ( World world, Vector2 position, float width, float height ) : System.Collections.Generic
world FarseerPhysics.Dynamics.World The World
position Microsoft.Xna.Framework.Vector2 The position (center) of the terrain.
width float The width of the terrain.
height float The height of the terrain.
Результат System.Collections.Generic

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

Apply the specified texture data to the terrain.
public applyData ( sbyte data, Vector2 offset = default(Vector2) ) : void
data sbyte
offset Microsoft.Xna.Framework.Vector2
Результат void

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

public generateTerrain ( int gx, int gy ) : void
gx int
gy int
Результат void

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

Initialize the terrain for use.
public initialize ( ) : void
Результат void

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

Modify a single point in the terrain.
public modifyTerrain ( Vector2 location, sbyte value ) : void
location Microsoft.Xna.Framework.Vector2 World location to modify. Automatically clipped.
value sbyte -1 = inside terrain, 1 = outside terrain
Результат void

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

Regenerate the terrain.
public regenerateTerrain ( ) : void
Результат void

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

public removeOldData ( int xStart, int xEnd, int yStart, int yEnd ) : void
xStart int
xEnd int
yStart int
yEnd int
Результат void

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

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

Points per cell.
public int cellSize
Результат int

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

Center of terrain in world units.
public Vector2,Microsoft.Xna.Framework center
Результат Microsoft.Xna.Framework.Vector2

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

Decomposer to use when regenerating terrain. Can be changed on the fly without consequence. Note: Some decomposerers are unstable.
public TriangulationAlgorithm decomposer
Результат TriangulationAlgorithm

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

Height of terrain in world units.
public float height
Результат float

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

Number of iterations to perform in the Marching Squares algorithm. Note: More then 3 has almost no effect on quality.
public int iterations
Результат int

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

Points per each world unit used to define the terrain in the point cloud.
public int pointsPerUnit
Результат int

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

Points per sub cell.
public int subCellSize
Результат int

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

Width of terrain in world units.
public float width
Результат float

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

World to manage terrain in.
public World,FarseerPhysics.Dynamics world
Результат FarseerPhysics.Dynamics.World