Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CircleArea

This is a circle collision area for the excalibur rigid body physics simulation

Hierarchy

  • CircleArea

Implements

Index

Constructors

constructor

Properties

body

body: Body

The actor associated with this collision area

pos

pos: Vector = ex.Vector.Zero.clone()

This is the center position of the circle, relative to the body position

radius

radius: number

This is the radius of the circle

Methods

collide

contains

  • contains(point: Vector): boolean
  • Tests if a point is contained in this collision area

    Parameters

    Returns boolean

debugDraw

  • debugDraw(ctx: CanvasRenderingContext2D, color?: Color): void
  • Parameters

    • ctx: CanvasRenderingContext2D
    • Default value color: Color = ex.Color.Green.clone()

    Returns void

getAxes

  • Get axis not implemented on circles, since there are infinite axis in a circle

    Returns Vector[]

getBounds

getCenter

  • Get the center of the collision area in world coordinates

    Returns Vector

getFurthestPoint

getMomentOfInertia

  • getMomentOfInertia(): number

project

rayCast

  • Casts a ray at the CircleArea and returns the nearest point of collision

    Parameters

    • ray: Ray
    • Default value max: number = Infinity

    Returns Vector

recalc

  • recalc(): void

testSeparatingAxisTheorem

  • Tests the separating axis theorem for circles against polygons

    Parameters

    Returns Vector