The origin point of the Polygon
The radius of the emitted cone.
The angle of the Polygon in degrees.
The direction of rotation at the center of the emitted angle in degrees.
The density of rays which approximate the cone, defined as rays per PI.
An optional "external radius" which is included in the polygon for the supplementary area outside the cone.
The angle of the left (counter-clockwise) edge of the emitted cone in radians.
The angle of the right (clockwise) edge of the emitted cone in radians.
The bounding box of the circle defined by the externalRadius, if any
Restrict the edges which should be included in a PointSourcePolygon based on this specialized shape. We use two tests to jointly keep or reject edges.
The first edge vertex
The second edge vertex
Should the edge be included in the PointSourcePolygon computation?
Convert a PIXI.Polygon into an array of clipper points [{X,Y}, ...]. Note that clipper points must be rounded to integers. In order to preserve some amount of floating point precision, an optional scaling factor may be provided.
Options which affect how clipper points are generated
} An array of points to be used by clipper
Intersect this PIXI.Polygon with another PIXI.Polygon using the clipper library.
Another PIXI.Polygon
Options which configure how the intersection is computed
The intersected polygon or null if no solution was present
Intersect this PIXI.Polygon with a PIXI.Circle. For now, convert the circle to a Polygon approximation and use intersectPolygon. In the future we may replace this with more specialized logic which uses the line-circle intersection formula.
A PIXI.Circle
The intersected polygon
Intersect this PIXI.Polygon with a PIXI.Rectangle. For now, convert the rectangle to a Polygon and use intersectPolygon. In the future we may replace this with more specialized logic which uses the line-line intersection formula.
A PIXI.Rectangle
The intersected polygon
Generate the points of the LimitedAnglePolygon using the provided configuration parameters.
Test whether a vertex lies between two boundary rays. If the angle is greater than 180, test for points between rMax and rMin (inverse). Otherwise, keep vertices that are between the rays directly.
The candidate point
The counter-clockwise bounding ray
The clockwise bounding ray
The angle being tested, in degrees
Is the vertex between the two rays?
Construct a PIXI.Polygon instance from an array of clipper points [{X,Y}, ...].
Options which affect how canvas points are generated
The resulting PIXI.Polygon
A special class of Polygon which implements a limited angle of emission for a Point Source. The shape is defined by a point origin, radius, angle, and rotation. The shape is further customized by a configurable density which informs the approximation. An optional secondary externalRadius can be provided which adds supplementary visibility outside the primary angle.