C# Class Ballz.GameSession.World.Terrain

Represents the Terrain.
Afficher le fichier Open project: SpagAachen/Ballz Class Usage Examples

Méthodes publiques

Свойство Type Description
PublicShape TerrainShape
Scale float
WaterSpawnBitmap ].bool[
decimateOutlines bool
gravityPoint Vector2

Méthodes publiques

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

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

public AddCircle ( float x, float y, float radius ) : void
x float
y float
radius float
Résultat void

ApplyModification() public méthode

public ApplyModification ( TerrainModification mod ) : void
mod TerrainModification
Résultat void

BuildTerrainTypeTexture() public méthode

public BuildTerrainTypeTexture ( ) : void
Résultat void

GetOutline() public méthode

public GetOutline ( bool enforceUpdate = false ) : List>
enforceUpdate bool
Résultat List>

GetTerrainTypeTexture() public méthode

public GetTerrainTypeTexture ( ) : Microsoft.Xna.Framework.Graphics.Texture2D
Résultat Microsoft.Xna.Framework.Graphics.Texture2D

GetTriangles() public méthode

public GetTriangles ( bool enforceUpdate = false ) : List
enforceUpdate bool
Résultat List

IsWaterSpawn() public méthode

public IsWaterSpawn ( float x, float y ) : bool
x float
y float
Résultat bool

Mix() public méthode

public Mix ( Vector2 a, Vector2 b, float wa, float wb ) : Vector2
a Vector2
b Vector2
wa float
wb float
Résultat Vector2

SubtractCircle() public méthode

public SubtractCircle ( float x, float y, float radius ) : void
x float
y float
radius float
Résultat void

Terrain() public méthode

public Terrain ( Microsoft.Xna.Framework.Graphics.Texture2D terrainTexture ) : Microsoft.Xna.Framework
terrainTexture Microsoft.Xna.Framework.Graphics.Texture2D
Résultat Microsoft.Xna.Framework

Update() public méthode

public Update ( ) : void
Résultat 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
Résultat TerrainShape

Scale public_oe property

The world scale of the terrain, in meters per pixel.
public float Scale
Résultat float

WaterSpawnBitmap public_oe property

public bool[,] WaterSpawnBitmap
Résultat ].bool[

decimateOutlines public_oe static_oe property

public static bool decimateOutlines
Résultat bool

gravityPoint public_oe property

public Vector2 gravityPoint
Résultat Vector2