C# Class FarseerPhysics.Common.PolygonTools

Afficher le fichier Open project: prime31/Nez

Méthodes publiques

Méthode Description
createArc ( float radians, int sides, float radius ) : Vertices
createCapsule ( float height, float endRadius, int edges ) : Vertices

Creates an capsule with the specified height, radius and number of edges. A capsule has the same form as a pill capsule.

createCapsule ( float height, float topRadius, int topEdges, float bottomRadius, int bottomEdges ) : Vertices

Creates an capsule with the specified height, radius and number of edges. A capsule has the same form as a pill capsule.

createCircle ( float radius, int numberOfEdges ) : Vertices

Creates a circle with the specified radius and number of edges.

createEllipse ( float xRadius, float yRadius, int numberOfEdges ) : Vertices

Creates a ellipse with the specified width, height and number of edges.

createGear ( float radius, int numberOfTeeth, float tipPercentage, float toothHeight ) : Vertices

Creates a gear shape with the specified radius and number of teeth.

createLine ( Vector2 start, Vector2 end ) : Vertices

Set this as a single edge.

createPolygonFromTextureData ( uint data, int width, float hullTolerance, byte alphaTolerance, bool multiPartDetection, bool holeDetection ) : List

Detects the vertices by analyzing the texture data.

createPolygonFromTextureData ( Nez subtexture ) : Vertices
createPolygonFromTextureData ( Texture2D texture ) : Vertices
createPolygonFromTextureData ( uint data, int width ) : Vertices

Detects the vertices by analyzing the texture data.

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

Detects the vertices by analyzing the texture data.

createRectangle ( float hx, float hy ) : Vertices

Build vertices to represent an axis-aligned box.

createRectangle ( float hx, float hy, Vector2 center, float angle ) : Vertices

Build vertices to represent an oriented box.

createRoundedRectangle ( float width, float height, float xRadius, float yRadius, int segments ) : Vertices

Creates a rounded rectangle with the specified width and height.

Method Details

createArc() public static méthode

public static createArc ( float radians, int sides, float radius ) : Vertices
radians float
sides int
radius float
Résultat Vertices

createCapsule() public static méthode

Creates an capsule with the specified height, radius and number of edges. A capsule has the same form as a pill capsule.
public static createCapsule ( float height, float endRadius, int edges ) : Vertices
height float Height (inner height + 2 * radius) of the capsule.
endRadius float Radius of the capsule ends.
edges int The number of edges of the capsule ends. The more edges, the more it resembles an capsule
Résultat Vertices

createCapsule() public static méthode

Creates an capsule with the specified height, radius and number of edges. A capsule has the same form as a pill capsule.
public static createCapsule ( float height, float topRadius, int topEdges, float bottomRadius, int bottomEdges ) : Vertices
height float Height (inner height + radii) of the capsule.
topRadius float Radius of the top.
topEdges int The number of edges of the top. The more edges, the more it resembles an capsule
bottomRadius float Radius of bottom.
bottomEdges int The number of edges of the bottom. The more edges, the more it resembles an capsule
Résultat Vertices

createCircle() public static méthode

Creates a circle with the specified radius and number of edges.
public static createCircle ( float radius, int numberOfEdges ) : Vertices
radius float The radius.
numberOfEdges int The number of edges. The more edges, the more it resembles a circle
Résultat Vertices

createEllipse() public static méthode

Creates a ellipse with the specified width, height and number of edges.
public static createEllipse ( float xRadius, float yRadius, int numberOfEdges ) : Vertices
xRadius float Width of the ellipse.
yRadius float Height of the ellipse.
numberOfEdges int The number of edges. The more edges, the more it resembles an ellipse
Résultat Vertices

createGear() public static méthode

Creates a gear shape with the specified radius and number of teeth.
public static createGear ( float radius, int numberOfTeeth, float tipPercentage, float toothHeight ) : Vertices
radius float The radius.
numberOfTeeth int The number of teeth.
tipPercentage float The tip percentage.
toothHeight float Height of the tooth.
Résultat Vertices

createLine() public static méthode

Set this as a single edge.
public static createLine ( Vector2 start, Vector2 end ) : Vertices
start Vector2 The first point.
end Vector2 The second point.
Résultat Vertices

createPolygonFromTextureData() public static méthode

Detects the vertices by analyzing the texture data.
public static createPolygonFromTextureData ( 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

createPolygonFromTextureData() public static méthode

public static createPolygonFromTextureData ( Nez subtexture ) : Vertices
subtexture Nez
Résultat Vertices

createPolygonFromTextureData() public static méthode

public static createPolygonFromTextureData ( Texture2D texture ) : Vertices
texture Texture2D
Résultat Vertices

createPolygonFromTextureData() public static méthode

Detects the vertices by analyzing the texture data.
public static createPolygonFromTextureData ( uint data, int width ) : Vertices
data uint The texture data.
width int The texture width.
Résultat Vertices

createPolygonFromTextureData() public static méthode

Detects the vertices by analyzing the texture data.
public static createPolygonFromTextureData ( 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

createRectangle() public static méthode

Build vertices to represent an axis-aligned box.
public static createRectangle ( float hx, float hy ) : Vertices
hx float the half-width.
hy float the half-height.
Résultat Vertices

createRectangle() public static méthode

Build vertices to represent an oriented box.
public static createRectangle ( float hx, float hy, Vector2 center, float angle ) : Vertices
hx float the half-width.
hy float the half-height.
center Vector2 the center of the box in local coordinates.
angle float the rotation of the box in local coordinates.
Résultat Vertices

createRoundedRectangle() public static méthode

Creates a rounded rectangle with the specified width and height.
public static createRoundedRectangle ( float width, float height, float xRadius, float yRadius, int segments ) : Vertices
width float The width.
height float The height.
xRadius float The rounding X radius.
yRadius float The rounding Y radius.
segments int The number of segments to subdivide the edges.
Résultat Vertices