Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    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.

    Index

    Constructors

    • Construct a PolygonVertex by providing {x, y} coordinates and vertex options.

      Parameters

      • x: number

        The x-coordinate of the vertex

      • y: number

        The y-coordinate of the vertex

      • Optionaloptions: PolygonVertexOptions = {}

        Options which modify vertex context or behavior

      Returns PolygonVertex

    Properties

    _angle: number | undefined

    The angle of the ray from the origin to this vertex.

    _d2: number | undefined

    The squared distance from a polygon origin to this vertex.

    _distance: number | undefined

    The distance from a polygon origin to this vertex.

    _index: number | undefined

    The integer index of this vertex in an ordered sweep.

    _intersectionCoordinates: LineIntersection | undefined

    The line intersection coordinates of the two edges that create this vertex.

    _visited: boolean = false

    Record whether this PolygonVertex has been visited in the sweep

    ccwEdges: EdgeSet = ...

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

    collinearVertices: Set<PolygonVertex> = ...

    The set of vertices collinear to this vertex

    cwEdges: EdgeSet = ...

    The subset of edges which continue clockwise from this vertex.

    edges: EdgeSet = ...

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

    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?

    isEndpoint: boolean

    Is this vertex an endpoint of one or more edges?

    isInternal: boolean = false

    Does this vertex result from an internal collision?

    isLimitingCCW: boolean

    Does this vertex have a single counterclockwise limiting edge?

    isLimitingCW: boolean

    Does this vertex have a single clockwise limiting edge?

    restriction: EdgeSenseType = CONST.EDGE_SENSE_TYPES.NONE

    The maximum restriction imposed by this vertex.

    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?

    • 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