C# Class FarseerPhysics.Common.TextureTools.Terrain

Simple class to maintain a terrain. It can keep track
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Свойство Type Description
cellSize int
center Microsoft.Xna.Framework.Vector2
decomposer TriangulationAlgorithm
height float
iterations int
pointsPerUnit int
subCellSize int
width float
world FarseerPhysics.Dynamics.World

Méthodes publiques

Méthode Description
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

Method Details

Terrain() public méthode

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.
Résultat System.Collections.Generic

Terrain() public méthode

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.
Résultat System.Collections.Generic

applyData() public méthode

Apply the specified texture data to the terrain.
public applyData ( sbyte data, Vector2 offset = default(Vector2) ) : void
data sbyte
offset Microsoft.Xna.Framework.Vector2
Résultat void

generateTerrain() public méthode

public generateTerrain ( int gx, int gy ) : void
gx int
gy int
Résultat void

initialize() public méthode

Initialize the terrain for use.
public initialize ( ) : void
Résultat void

modifyTerrain() public méthode

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
Résultat void

regenerateTerrain() public méthode

Regenerate the terrain.
public regenerateTerrain ( ) : void
Résultat void

removeOldData() public méthode

public removeOldData ( int xStart, int xEnd, int yStart, int yEnd ) : void
xStart int
xEnd int
yStart int
yEnd int
Résultat void

Property Details

cellSize public_oe property

Points per cell.
public int cellSize
Résultat int

center public_oe property

Center of terrain in world units.
public Vector2,Microsoft.Xna.Framework center
Résultat Microsoft.Xna.Framework.Vector2

decomposer public_oe property

Decomposer to use when regenerating terrain. Can be changed on the fly without consequence. Note: Some decomposerers are unstable.
public TriangulationAlgorithm decomposer
Résultat TriangulationAlgorithm

height public_oe property

Height of terrain in world units.
public float height
Résultat float

iterations public_oe property

Number of iterations to perform in the Marching Squares algorithm. Note: More then 3 has almost no effect on quality.
public int iterations
Résultat int

pointsPerUnit public_oe property

Points per each world unit used to define the terrain in the point cloud.
public int pointsPerUnit
Résultat int

subCellSize public_oe property

Points per sub cell.
public int subCellSize
Résultat int

width public_oe property

Width of terrain in world units.
public float width
Résultat float

world public_oe property

World to manage terrain in.
public World,FarseerPhysics.Dynamics world
Résultat FarseerPhysics.Dynamics.World