Home Reference Source
public class | source

Circle

Extends:

Body → Circle

A circle used to detect collisions

Constructor Summary

Public Constructor
public

constructor(x: Number, y: Number, radius: Number, scale: Number, padding: Number)

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

draw(context: CanvasRenderingContext2D)

Draws the circle to a CanvasRenderingContext2D's current path

Inherited Summary

From class Body
public static

Creates a Result used to collect the detailed results of a collision test

public

The amount to pad the bounding volume when testing for potential collisions

public

The X coordinate of the body

public

The Y coordinate of the body

public

collides(target: Circle | Polygon | Point, result: Result, aabb: Boolean): Boolean

Determines if the body is colliding with another body

public

Creates a Result used to collect the detailed results of a collision test

public

Returns a list of potential collisions

public

remove()

Removes the body from its current collision system

Public Constructors

public constructor(x: Number, y: Number, radius: Number, scale: Number, padding: Number) source

Override:

Body#constructor

Params:

NameTypeAttributeDescription
x Number
  • optional
  • default: 0

The starting X coordinate

y Number
  • optional
  • default: 0

The starting Y coordinate

radius Number
  • optional
  • default: 0

The radius

scale Number
  • optional
  • default: 1

The scale

padding Number
  • optional
  • default: 0

The amount to pad the bounding volume when testing for potential collisions

Public Members

public radius: Number source

public scale: Number source

Public Methods

public draw(context: CanvasRenderingContext2D) source

Draws the circle to a CanvasRenderingContext2D's current path

Params:

NameTypeAttributeDescription
context CanvasRenderingContext2D

The context to add the arc to