Class PolygonTools
- Namespace
- Alis.Core.Physic.Common
- Assembly
- Alis.dll
The polygon tools class
public static class PolygonToolsInheritance
Inherited Members
Methods
CreateArc(float, int, float)
Creates the arc using the specified radians
public static Vertices CreateArc(float radians, int sides, float radius)Parameters
Returns
- Vertices
-
The vertices
CreateCapsule(float, float, int)
Creates an capsule with the specified height, radius and number of edges. A capsule has the same form as a pill capsule.
public static Vertices CreateCapsule(float height, float endRadius, int edges)Parameters
heightfloat-
Height (inner height + 2 * radius) of the capsule.
endRadiusfloat-
Radius of the capsule ends.
edgesint-
The number of edges of the capsule ends. The more edges, the more it resembles an capsule
Returns
CreateCapsule(float, float, int, float, int)
Creates an capsule with the specified height, radius and number of edges. A capsule has the same form as a pill capsule.
public static Vertices CreateCapsule(float height, float topRadius, int topEdges, float bottomRadius, int bottomEdges)Parameters
heightfloat-
Height (inner height + radii) of the capsule.
topRadiusfloat-
Radius of the top.
topEdgesint-
The number of edges of the top. The more edges, the more it resembles an capsule
bottomRadiusfloat-
Radius of bottom.
bottomEdgesint-
The number of edges of the bottom. The more edges, the more it resembles an capsule
Returns
CreateCircle(float, int)
Creates a circle with the specified radius and number of edges.
public static Vertices CreateCircle(float radius, int numberOfEdges)Parameters
radiusfloat-
The radius.
numberOfEdgesint-
The number of edges. The more edges, the more it resembles a circle
Returns
CreateEllipse(float, float, int)
Creates a ellipse with the specified width, height and number of edges.
public static Vertices CreateEllipse(float xRadius, float yRadius, int numberOfEdges)Parameters
xRadiusfloat-
Width of the ellipse.
yRadiusfloat-
Height of the ellipse.
numberOfEdgesint-
The number of edges. The more edges, the more it resembles an ellipse
Returns
CreateGear(float, int, float, float)
Creates a gear shape with the specified radius and number of teeth.
public static Vertices CreateGear(float radius, int numberOfTeeth, float tipPercentage, float toothHeight)Parameters
radiusfloat-
The radius.
numberOfTeethint-
The number of teeth.
tipPercentagefloat-
The tip percentage.
toothHeightfloat-
Height of the tooth.
Returns
CreateLine(Vector2, Vector2)
Set this as a single edge.
public static Vertices CreateLine(Vector2 start, Vector2 end)Parameters
Returns
CreateRectangle(float, float)
Build vertices to represent an axis-aligned box.
public static Vertices CreateRectangle(float hx, float hy)Parameters
Returns
CreateRectangle(float, float, Vector2, float)
Build vertices to represent an oriented box.
public static Vertices CreateRectangle(float hx, float hy, Vector2 center, float angle)Parameters
hxfloat-
the half-width.
hyfloat-
the half-height.
centerVector2-
the center of the box in local coordinates.
anglefloat-
the rotation of the box in local coordinates.
Returns
CreateRoundedRectangle(float, float, float, float, int)
Creates a rounded rectangle with the specified width and height.
public static Vertices CreateRoundedRectangle(float width, float height, float xRadius, float yRadius, int segments)Parameters
widthfloat-
The width.
heightfloat-
The height.
xRadiusfloat-
The rounding X radius.
yRadiusfloat-
The rounding Y radius.
segmentsint-
The number of segments to subdivide the edges.