Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClippingEdge

Abstract helper class used to implement the Sutherland-Hodgman clipping algorithm.

remarks

Concrete implementation of this class are used to clip a polygon against one edge of a bounding box.

internal

Hierarchy

  • ClippingEdge

Index

Methods

clipPolygon

  • clipPolygon(polygon: Vector2[], extent: number): Vector2[]
  • Clip the polygon against this clipping edge.

    Parameters

    • polygon: Vector2[]

      Clip the polygon against this edge.

    • extent: number

      The extent of the bounding box.

    Returns Vector2[]

    The clipped polygon.

Abstract computeIntersection

  • computeIntersection(a: Vector2, b: Vector2, extent: number): ClippedVertex

Abstract inside

  • inside(point: Vector2, extent: number): boolean
  • Tests if the given point is inside this clipping edge.

    Parameters

    • point: Vector2

      A point of the polygon.

    • extent: number

      The extent of the bounding box.

    Returns boolean

Generated using TypeDoc