C# Class FarseerPhysics.Common.TextureTools.TextureConverter

Exibir arquivo Open project: prime31/Nez Class Usage Examples

Public Methods

Method Description
Initialize ( uint data, int width, byte alphaTolerance, float hullTolerance, bool holeDetection, bool multipartDetection, bool pixelOffsetOptimization, Matrix transform ) : void
TextureConverter ( ) : System
TextureConverter ( byte alphaTolerance, float hullTolerance, bool holeDetection, bool multipartDetection, bool pixelOffsetOptimization, Matrix transform ) : System
TextureConverter ( uint data, int width ) : System
TextureConverter ( uint data, int width, byte alphaTolerance, float hullTolerance, bool holeDetection, bool multipartDetection, bool pixelOffsetOptimization, Matrix transform ) : System
applyTransform ( List &detectedPolygons ) : void
applyTriangulationCompatibleWinding ( List &detectedPolygons ) : void
detectVertices ( ) : List
detectVertices ( uint data, int width, float hullTolerance, byte alphaTolerance, bool multiPartDetection, bool holeDetection ) : List

Detects the vertices of the supplied texture data.

detectVertices ( uint data, int width ) : Vertices

Detects the vertices of the supplied texture data. (PolygonDetectionType.Integrated)

detectVertices ( uint data, int width, bool holeDetection ) : Vertices

Detects the vertices of the supplied texture data.

inBounds ( Vector2 &coord ) : bool
isSolid ( Vector2 &v ) : bool
isSolid ( int &index ) : bool
isSolid ( int &x, int &y ) : bool
setTextureData ( uint data, int width ) : void

Private Methods

Method Description
createSimplePolygon ( Vector2 entrance, Vector2 last ) : Vertices
distanceToHullAcceptable ( Vertices polygon, Vector2 point, bool higherDetail ) : bool
distanceToHullAcceptableHoles ( Vertices polygon, Vector2 point, bool higherDetail ) : bool
getBottomMostCoord ( Vertices vertices ) : float
getIndexOfFirstPixelToCheck ( Vector2 &last, Vector2 &current ) : int
getNextHullPoint ( Vector2 &last, Vector2 &current, Vector2 &next ) : bool
getTopMostCoord ( Vertices vertices ) : float
getTopMostVertex ( Vertices vertices ) : Vector2?
inPolygon ( Vertices polygon, Vector2 point ) : bool
isNearPixel ( Vector2 &current, Vector2 &near ) : bool
searchCrossingEdges ( Vertices polygon, int y ) : List

Searches the polygon for the x coordinates of the edges that cross the specified y coordinate.

searchCrossingEdgesHoles ( Vertices polygon, int y ) : List
searchForOutstandingVertex ( Vertices hullArea, Vector2 &outstanding ) : bool
searchHoleEntrance ( Vertices polygon, Vector2 lastHoleEntrance ) : Vector2?

Function to search for an entrance point of a hole in a polygon. It searches the polygon from top to bottom between the polygon edges.

searchHullEntrance ( Vector2 &entrance ) : bool
searchNearPixels ( bool searchingForSolidPixel, Vector2 &current, Vector2 &foundPixel ) : bool
searchNextHullEntrance ( List detectedPolygons, Vector2 start, Vector2 &entrance ) : bool

Searches for the next shape.

splitPolygonEdge ( Vertices polygon, Vector2 coordInsideThePolygon, int &vertex1Index, int &vertex2Index ) : bool

Method Details

Initialize() public method

public Initialize ( uint data, int width, byte alphaTolerance, float hullTolerance, bool holeDetection, bool multipartDetection, bool pixelOffsetOptimization, Matrix transform ) : void
data uint
width int
alphaTolerance byte
hullTolerance float
holeDetection bool
multipartDetection bool
pixelOffsetOptimization bool
transform Matrix
return void

TextureConverter() public method

public TextureConverter ( ) : System
return System

TextureConverter() public method

public TextureConverter ( byte alphaTolerance, float hullTolerance, bool holeDetection, bool multipartDetection, bool pixelOffsetOptimization, Matrix transform ) : System
alphaTolerance byte
hullTolerance float
holeDetection bool
multipartDetection bool
pixelOffsetOptimization bool
transform Matrix
return System

TextureConverter() public method

public TextureConverter ( uint data, int width ) : System
data uint
width int
return System

TextureConverter() public method

public TextureConverter ( uint data, int width, byte alphaTolerance, float hullTolerance, bool holeDetection, bool multipartDetection, bool pixelOffsetOptimization, Matrix transform ) : System
data uint
width int
alphaTolerance byte
hullTolerance float
holeDetection bool
multipartDetection bool
pixelOffsetOptimization bool
transform Matrix
return System

applyTransform() public method

public applyTransform ( List &detectedPolygons ) : void
detectedPolygons List
return void

applyTriangulationCompatibleWinding() public method

public applyTriangulationCompatibleWinding ( List &detectedPolygons ) : void
detectedPolygons List
return void

detectVertices() public method

public detectVertices ( ) : List
return List

detectVertices() public static method

Detects the vertices of the supplied texture data.
public static detectVertices ( uint data, int width, float hullTolerance, byte alphaTolerance, bool multiPartDetection, bool holeDetection ) : List
data uint The texture data.
width int The texture width.
hullTolerance float The hull tolerance.
alphaTolerance byte The alpha tolerance.
multiPartDetection bool if set to true it will perform multi part detection.
holeDetection bool if set to true it will perform hole detection.
return List

detectVertices() public static method

Detects the vertices of the supplied texture data. (PolygonDetectionType.Integrated)
public static detectVertices ( uint data, int width ) : Vertices
data uint The texture data.
width int The texture width.
return Vertices

detectVertices() public static method

Detects the vertices of the supplied texture data.
public static detectVertices ( uint data, int width, bool holeDetection ) : Vertices
data uint The texture data.
width int The texture width.
holeDetection bool if set to true it will perform hole detection.
return Vertices

inBounds() public method

public inBounds ( Vector2 &coord ) : bool
coord Vector2
return bool

isSolid() public method

public isSolid ( Vector2 &v ) : bool
v Vector2
return bool

isSolid() public method

public isSolid ( int &index ) : bool
index int
return bool

isSolid() public method

public isSolid ( int &x, int &y ) : bool
x int
y int
return bool

setTextureData() public method

public setTextureData ( uint data, int width ) : void
data uint
width int
return void