Ctrl+K

PolygonTools

Declaration

public static class tainicom.Aether.Physics2D.Common.PolygonTools

Methods

CreateRectangle static

Build vertices to represent an axis-aligned box.

Vertices CreateRectangle(float hx, float hy)

Parameters:

Name Type Description
hx System.Single the half-width.
hy System.Single the half-height.

CreateRectangle static

Build vertices to represent an oriented box.

Vertices CreateRectangle(float hx, float hy, Vector2 center, float angle)

Parameters:

Name Type Description
hx System.Single the half-width.
hy System.Single the half-height.
center Strawberry.Math.Vector2 the center of the box in local coordinates.
angle System.Single the rotation of the box in local coordinates.

CreateRoundedRectangle static

Creates a rounded rectangle with the specified width and height.

Vertices CreateRoundedRectangle(float width, float height, float xRadius, float yRadius, int segments)

Parameters:

Name Type Description
width System.Single The width.
height System.Single The height.
xRadius System.Single The rounding X radius.
yRadius System.Single The rounding Y radius.
segments System.Int32 The number of segments to subdivide the edges.

CreateLine static

Set this as a single edge.

Vertices CreateLine(Vector2 start, Vector2 end)

Parameters:

Name Type Description
start Strawberry.Math.Vector2 The first point.
end Strawberry.Math.Vector2 The second point.

CreateCircle static

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

Vertices CreateCircle(float radius, int numberOfEdges)

Parameters:

Name Type Description
radius System.Single The radius.
numberOfEdges System.Int32 The number of edges. The more edges, the more it resembles a circle

CreateEllipse static

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

Vertices CreateEllipse(float xRadius, float yRadius, int numberOfEdges)

Parameters:

Name Type Description
xRadius System.Single Width of the ellipse.
yRadius System.Single Height of the ellipse.
numberOfEdges System.Int32 The number of edges. The more edges, the more it resembles an ellipse

CreateArc static

Vertices CreateArc(float radians, int sides, float radius)

Parameters:

Name Type Description
radians System.Single
sides System.Int32
radius System.Single

CreateCapsule static

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

Vertices CreateCapsule(float height, float endRadius, int edges)

Parameters:

Name Type Description
height System.Single Height (inner height + 2 * radius) of the capsule.
endRadius System.Single Radius of the capsule ends.
edges System.Int32 The number of edges of the capsule ends. The more edges, the more it resembles an capsule

CreateCapsule static

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

Vertices CreateCapsule(float height, float topRadius, int topEdges, float bottomRadius, int bottomEdges)

Parameters:

Name Type Description
height System.Single Height (inner height + radii) of the capsule.
topRadius System.Single Radius of the top.
topEdges System.Int32 The number of edges of the top. The more edges, the more it resembles an capsule
bottomRadius System.Single Radius of bottom.
bottomEdges System.Int32 The number of edges of the bottom. The more edges, the more it resembles an capsule

CreateGear static

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

Vertices CreateGear(float radius, int numberOfTeeth, float tipPercentage, float toothHeight)

Parameters:

Name Type Description
radius System.Single The radius.
numberOfTeeth System.Int32 The number of teeth.
tipPercentage System.Single The tip percentage.
toothHeight System.Single Height of the tooth.