C# Class FarseerPhysics.Common.TextureTools.TextureConverter

Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

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

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

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

TextureConverter() public méthode

public TextureConverter ( ) : System
Résultat System

TextureConverter() public méthode

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

TextureConverter() public méthode

public TextureConverter ( uint data, int width ) : System
data uint
width int
Résultat System

TextureConverter() public méthode

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

applyTransform() public méthode

public applyTransform ( List &detectedPolygons ) : void
detectedPolygons List
Résultat void

applyTriangulationCompatibleWinding() public méthode

public applyTriangulationCompatibleWinding ( List &detectedPolygons ) : void
detectedPolygons List
Résultat void

detectVertices() public méthode

public detectVertices ( ) : List
Résultat List

detectVertices() public static méthode

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.
Résultat List

detectVertices() public static méthode

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.
Résultat Vertices

detectVertices() public static méthode

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.
Résultat Vertices

inBounds() public méthode

public inBounds ( Vector2 &coord ) : bool
coord Vector2
Résultat bool

isSolid() public méthode

public isSolid ( Vector2 &v ) : bool
v Vector2
Résultat bool

isSolid() public méthode

public isSolid ( int &index ) : bool
index int
Résultat bool

isSolid() public méthode

public isSolid ( int &x, int &y ) : bool
x int
y int
Résultat bool

setTextureData() public méthode

public setTextureData ( uint data, int width ) : void
data uint
width int
Résultat void