C# Класс FarseerPhysics.Common.TextureTools.TextureConverter

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Initialize() публичный Метод

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
Результат void

TextureConverter() публичный Метод

public TextureConverter ( ) : System
Результат System

TextureConverter() публичный Метод

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
Результат System

TextureConverter() публичный Метод

public TextureConverter ( uint data, int width ) : System
data uint
width int
Результат System

TextureConverter() публичный Метод

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
Результат System

applyTransform() публичный Метод

public applyTransform ( List &detectedPolygons ) : void
detectedPolygons List
Результат void

applyTriangulationCompatibleWinding() публичный Метод

public applyTriangulationCompatibleWinding ( List &detectedPolygons ) : void
detectedPolygons List
Результат void

detectVertices() публичный Метод

public detectVertices ( ) : List
Результат List

detectVertices() публичный статический Метод

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.
Результат List

detectVertices() публичный статический Метод

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.
Результат Vertices

detectVertices() публичный статический Метод

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.
Результат Vertices

inBounds() публичный Метод

public inBounds ( Vector2 &coord ) : bool
coord Vector2
Результат bool

isSolid() публичный Метод

public isSolid ( Vector2 &v ) : bool
v Vector2
Результат bool

isSolid() публичный Метод

public isSolid ( int &index ) : bool
index int
Результат bool

isSolid() публичный Метод

public isSolid ( int &x, int &y ) : bool
x int
y int
Результат bool

setTextureData() публичный Метод

public setTextureData ( uint data, int width ) : void
data uint
width int
Результат void