Polygon |

Hierarchy (View Summary)

Index

Constructors

constructor

Properties

edges

indices

indices: number[]

points

pos

type

type: string = "Polygon"

Methods

clone

contains

  • contains(x: number, y?: number): boolean

    Parameters

    • x: number
    • Optionaly: number

    Returns boolean

    True if the polygon contain the point, otherwise false

  • Returns boolean

    True if the polygon contain the point, otherwise false

getBounds

  • Returns Bounds

    this shape bounding box Rectangle object

getIndices

  • Returns number[]

    an array of vertex indices for all triangles forming this polygon.

isConvex

  • isConvex(): boolean | null

    Returns boolean | null

    true if the vertices are convex, false if not, null if not computable

recalc

  • Returns Polygon

    Reference to this object for method chaining

rotate

  • Returns Polygon

    Reference to this object for method chaining

scale

  • scale(x: number, y?: number): Polygon

    Parameters

    • x: number
    • Optionaly: number = x

    Returns Polygon

    Reference to this object for method chaining

scaleV

  • Returns Polygon

    Reference to this object for method chaining

setShape

  • Returns Polygon

    this instance for objecf chaining

setVertices

  • Returns Polygon

    this instance for objecf chaining

shift

  • shift(x: number, y?: number): void

    Parameters

    • x: number
    • Optionaly: number

    Returns void

  • Returns void

to2d

  • Returns Polygon

    Reference to this object for method chaining

toIso

  • Returns Polygon

    Reference to this object for method chaining

transform

  • Returns Polygon

    Reference to this object for method chaining

translate

  • translate(x: number, y?: number): Polygon

    Parameters

    • x: number
    • Optionaly: number

    Returns Polygon

    Reference to this object for method chaining

  • Returns Polygon

    Reference to this object for method chaining

updateBounds

  • Returns Bounds

    this shape bounding box Rectangle object