Class Ellipse

collider - ellipse




_radiusX: number

inner initial params save

_radiusY: number
_step: number
angle: number

body angle

bbox: BBox

bounding box cache, without padding

calcPoints: SATVector[]
convexPolygons: SATPolygon[]

optimization for convex polygons

edges: SATVector[]
isCentered: boolean = true

ellipses are centered

isConvex: boolean = true

ellipses are 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 = 0

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

reference to collision system

type: Ellipse = Types.Ellipse

ellipse type


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

    Returns number

  • set scale(scale: number): 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: number): void
  • updating this.pos.x by this.x = x updates AABB


    • x: number

    Returns void

  • get y(): number
  • Returns number

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


    • y: number

    Returns void


  • Draws collider on a CanvasRenderingContext2D's current path


    • context: CanvasRenderingContext2D

    Returns void

  • for setting angle


    • angle: number

    Returns SATPolygon

Generated using TypeDoc