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

    A data structure used to represent potential edges used by the ClockwiseSweepPolygon. Edges are not polygon-specific, meaning they can be reused across many polygon instances.

    Index

    Constructors

    Properties

    a: Point

    The first endpoint of the edge.

    b: Point

    The second endpoint of the edge.

    bounds: Rectangle

    The rectangular bounds of the edge. Used by the quadtree.

    darkness: EdgeSenseType

    How this edge restricts darkness.

    direction: EdgeDirection

    The direction of effect for the edge.

    id: string | undefined

    A string used to uniquely identify this edge, if any.

    intersections: {
        [level: string]: { edge: Edge; intersection: LineIntersection }[];
    } = {}

    Record other edges which this one intersects with by level.

    How this edge restricts light.

    How this edge restricts movement.

    nw: Point

    The endpoint of the edge which is oriented towards the top-left.

    object:
        | Document<object, DocumentConstructionContext>
        | PlaceableObject
        | undefined

    The Document/PlaceableObject the edge belongs to, if any.

    se: Point

    The endpoint of the edge which is oriented towards the bottom-right.

    How this edge restricts sight.

    How this edge restricts sound.

    threshold: EdgeThresholdData | null

    Specialized threshold data for this edge.

    vertexA: PolygonVertex | undefined

    A PolygonVertex instance. Used as part of ClockwiseSweepPolygon computation.

    vertexB: PolygonVertex | undefined

    A PolygonVertex instance. Used as part of ClockwiseSweepPolygon computation.

    Methods

    • Test whether to apply a proximity threshold to this edge. If the proximity threshold is met, this edge excluded from perception calculations.

      Parameters

      • sourceType: string

        Sense type for the source

      • sourceOrigin: Point

        The origin or position of the source on the canvas

      • OptionalexternalRadius: number = 0

        The external radius of the source

      Returns boolean

      True if the edge has a threshold greater than 0 for the source type, and the source type is within that distance.

    • Create a copy of the Edge which can be safely mutated.

      Returns Edge

    • Is this edge limited for a particular type?

      Parameters

      • type: "move" | "light" | "sight" | "darkness" | "sound"

      Returns boolean

    • Determine the orientation of this Edge with respect to a reference point.

      Parameters

      • point: Point

        Some reference point, relative to which orientation is determined

      Returns number

      An orientation in CONST.EDGE_DIRECTIONS which indicates whether the Point is left, right, or collinear (both) with the Edge

    • Record the intersections between two edges.

      Parameters

      • other: Edge

        Another edge to test and record

      • level: string

        The ID of the Level the edges are in

      Returns void

    • Remove intersections of this edge with all other edges.

      Parameters

      • level: string

        The ID of the Level the edges are in

      Returns void

    • Identify intersections between a provided iterable of edges.

      Parameters

      • edges: Iterable<Edge, any, any>

        An iterable of edges

      • level: string

        The ID of the Level the edges are in

      Returns void