C# Class Ballz.GameSession.World.Terrain

Represents the Terrain.
显示文件 Open project: SpagAachen/Ballz Class Usage Examples

Public Properties

Property Type Description
PublicShape TerrainShape
Scale float
WaterSpawnBitmap ].bool[
decimateOutlines bool
gravityPoint Vector2

Public Methods

Method Description
AddCircle ( float x, float y, float radius ) : void
ApplyModification ( TerrainModification mod ) : void
BuildTerrainTypeTexture ( ) : void
GetOutline ( bool enforceUpdate = false ) : List>
GetTerrainTypeTexture ( ) : Microsoft.Xna.Framework.Graphics.Texture2D
GetTriangles ( bool enforceUpdate = false ) : List
IsWaterSpawn ( float x, float y ) : bool
Mix ( Vector2 a, Vector2 b, float wa, float wb ) : Vector2
SubtractCircle ( float x, float y, float radius ) : void
Terrain ( Microsoft.Xna.Framework.Graphics.Texture2D terrainTexture ) : Microsoft.Xna.Framework
Update ( ) : void

Private Methods

Method Description
DecimateOutline ( List outline ) : void
Distance ( float x1, float y1, float x2, float y2 ) : float
ExtractOutline ( System.Edge edge ) : void
ExtractOutlineFromEdges ( ) : void
ExtractOutlineInternal ( System.Edge edge ) : List
ExtractTrianglesAndOutline ( ) : void
ExtractTrianglesFromCells ( ) : void
PerformMarchingSquares ( ) : void
SmoothTerrain ( float gauss ) : void
UpdateTerrain ( int minY, int minX, int maxX ) : void
area ( Vector2 a, Vector2 b, Vector2 c ) : float

Method Details

AddCircle() public method

public AddCircle ( float x, float y, float radius ) : void
x float
y float
radius float
return void

ApplyModification() public method

public ApplyModification ( TerrainModification mod ) : void
mod TerrainModification
return void

BuildTerrainTypeTexture() public method

public BuildTerrainTypeTexture ( ) : void
return void

GetOutline() public method

public GetOutline ( bool enforceUpdate = false ) : List>
enforceUpdate bool
return List>

GetTerrainTypeTexture() public method

public GetTerrainTypeTexture ( ) : Microsoft.Xna.Framework.Graphics.Texture2D
return Microsoft.Xna.Framework.Graphics.Texture2D

GetTriangles() public method

public GetTriangles ( bool enforceUpdate = false ) : List
enforceUpdate bool
return List

IsWaterSpawn() public method

public IsWaterSpawn ( float x, float y ) : bool
x float
y float
return bool

Mix() public method

public Mix ( Vector2 a, Vector2 b, float wa, float wb ) : Vector2
a Vector2
b Vector2
wa float
wb float
return Vector2

SubtractCircle() public method

public SubtractCircle ( float x, float y, float radius ) : void
x float
y float
radius float
return void

Terrain() public method

public Terrain ( Microsoft.Xna.Framework.Graphics.Texture2D terrainTexture ) : Microsoft.Xna.Framework
terrainTexture Microsoft.Xna.Framework.Graphics.Texture2D
return Microsoft.Xna.Framework

Update() public method

public Update ( ) : void
return void

Property Details

PublicShape public_oe property

The most recent terrain shape. Will be updated by the background worker once WorkingShape is finished.
Changes can be made to the terrainBitmap of this shape. They will be pulled by the background worker, which will process the changes and write the resulting triangles and outline back to this shape when finished. Use a lock on the publicShape object when accessing it.
public TerrainShape PublicShape
return TerrainShape

Scale public_oe property

The world scale of the terrain, in meters per pixel.
public float Scale
return float

WaterSpawnBitmap public_oe property

public bool[,] WaterSpawnBitmap
return ].bool[

decimateOutlines public_oe static_oe property

public static bool decimateOutlines
return bool

gravityPoint public_oe property

public Vector2 gravityPoint
return Vector2