A specialized point data structure used to represent vertices in the context of the ClockwiseSweepPolygon. This class is not designed or intended for use outside of that context.

Alias

PolygonVertex

Properties

edges: EdgeSet = ...

The set of edges which connect to this vertex. This set is initially empty and populated later after vertices are de-duplicated.

cwEdges: EdgeSet = ...

The subset of edges which continue clockwise from this vertex.

ccwEdges: EdgeSet = ...

The subset of edges which continue counter-clockwise from this vertex.

collinearVertices: Set<PolygonVertex> = ...

The set of vertices collinear to this vertex

isEndpoint: boolean

Is this vertex an endpoint of one or more edges?

isLimitingCCW: boolean

Does this vertex have a single counterclockwise limiting edge?

isLimitingCW: boolean

Does this vertex have a single clockwise limiting edge?

isBlockingCCW: boolean

Does this vertex have non-limited edges or 2+ limited edges counterclockwise?

isBlockingCW: boolean

Does this vertex have non-limited edges or 2+ limited edges clockwise?

isInternal: boolean = false

Does this vertex result from an internal collision?

restriction: number = 0

The maximum restriction imposed by this vertex.

_visited: boolean = false

Record whether this PolygonVertex has been visited in the sweep

#MAX_TEXTURE_SIZE: number = ...

The effective maximum texture size that Foundry VTT "ever" has to worry about.

Accessors

  • get isLimited(): boolean
  • Is this vertex limited in type?

    Returns boolean

Methods

  • Associate an edge with this vertex.

    Parameters

    • edge: Edge

      The edge being attached

    • orientation: number

      The orientation of the edge with respect to the origin

    • type: string

      The restriction type of polygon being created

    Returns void

  • Is this vertex the same point as some other vertex?

    Parameters

    Returns boolean

    Are they the same point?

  • Update flags for whether this vertex is limiting or blocking in certain direction.

    Parameters

    • type: string

    Returns void

  • Determine the sort key to use for this vertex, arranging points from north-west to south-east.

    Parameters

    • x: number

      The x-coordinate

    • y: number

      The y-coordinate

    Returns number

    The key used to identify the vertex

  • Construct a PolygonVertex instance from some other Point structure.

    Parameters

    • point: Point

      The point

    • Optional options: object

      Additional options that apply to this vertex

    Returns PolygonVertex

    The constructed vertex