collider - line




angle: number

body angle in radians use deg2rad to convert

bbox: BBox

bounding box cache, without padding

calcPoints: SATVector[]
centered: boolean = false

is body centered

convexPolygons: SATPolygon[]

optimization for convex polygons

dirty: boolean = false

was the polygon modified and needs update in the next checkCollision

edges: SATVector[]
isConvex: true = true

line is convex

isStatic: boolean

static bodies don't move but they collide

isTrigger: boolean

trigger bodies move but are like ghosts

maxX: number

maximum x bound of body

maxY: number

maximum y bound of body

minX: number

minimum x bound of body

minY: number

minimum y bound of body

normals: SATVector[]
offset: SATVector

each body may have offset from center

padding: number

bodies are not reinserted during update if their bbox didnt move outside bbox + padding

points: SATVector[]
pointsBackup: Vector[]

backup of points used for scaling

scaleVector: Vector = ...

scale Vector of body

system?: System<Body>

reference to collision system

type: Line = BodyType.Line

line type


  • get isCentered(): boolean
  • is polygon centered?

    Returns boolean

  • set isCentered(isCentered): void
  • flag to set is polygon centered


    • isCentered: boolean

    Returns void

  • get scale(): number
  • allow approx getting of scale

    Returns number

  • set scale(scale): void
  • allow easier setting of scale


    • scale: number

    Returns void

  • get scaleX(): number
  • allow exact getting of scale x - use setScale(x, y) to set

    Returns number

  • get scaleY(): number
  • allow exact getting of scale y - use setScale(x, y) to set

    Returns number

  • get x(): number
  • Returns number

  • set x(x): void
  • updating this.pos.x by this.x = x updates AABB


    • x: number

    Returns void

  • get y(): number
  • Returns number

  • set y(y): void
  • updating this.pos.y by this.y = y updates AABB


    • y: number

    Returns void


  • Draws exact collider on canvas context


    • context: CanvasRenderingContext2D

    Returns void

  • inner function for after position change update aabb in system and convex inner polygons


    • update: boolean = ...

    Returns void

Generated using TypeDoc