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
Internal
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.
Optional
options: { Options which affect how clipper points are generated
A scaling factor used to preserve floating point precision
An array of points to be used by clipper
Intersect this PIXI.Polygon with another PIXI.Polygon using the clipper library.
Another PIXI.Polygon
Optional
options: { Options which configure how the intersection is computed
The clipper clip type
A scaling factor passed to Polygon#toClipperPoints to preserve precision
The intersected polygon
Intersect this PIXI.Polygon with an array of ClipperPoints.
Array of clipper points generated by PIXI.Polygon.toClipperPoints()
Optional
options: { Options which configure how the intersection is computed
The clipper clip type
A scaling factor passed to Polygon#toClipperPoints to preserve precision
The resulting ClipperPaths
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
Optional
options: { Options which configure how the intersection is computed
The number of points which defines the density of approximation
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
Optional
options: objectOptions which configure how the intersection is computed
The intersected polygon
Private
#generateStatic
pointTest 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.
Is the vertex between the two rays?
Static
fromConstruct a PIXI.Polygon instance from an array of clipper points [{X,Y}, ...].
An array of points returned by clipper
Optional
options: { Options which affect how canvas points are generated
A scaling factor used to preserve floating point precision
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.