geometry library

Classes

CircleCircleIntersections
CircleComponent
CirclePolygonIntersections
Intersections<T1 extends ShapeComponent, T2 extends ShapeComponent>
Line
An infinite line on the 2D Cartesian space, represented in the form of ax + by = c.
LineSegment
A LineSegment represent a segment of an infinitely long line, it is the segment between the from and to vectors (inclusive).
PolygonComponent
PolygonPolygonIntersections
Ray2
A ray in the 2d plane.
RectangleComponent
ShapeComponent
A shape can represent any geometrical shape with optionally a size, position and angle. It can also have an anchor if it shouldn't be rotated around its center. A point can be determined to be within of outside of a shape.

Mixins

PolygonRayIntersection<T extends ShapeHitbox>
Used to add the rayIntersection method to RectangleHitbox and PolygonHitbox, used by the raytracing and raycasting methods.

Constants

tau → const double
A simpler constant to use for angles than 2pi (well it is 2pi).

Functions

intersections(ShapeComponent shapeA, ShapeComponent shapeB) Set<Vector2>