Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICollisionArea

A collision area is a region of space that can detect when other collision areas intersect for the purposes of colliding 2 objects in excalibur.

Hierarchy

  • ICollisionArea

Implemented by

Index

Properties

body

body: Body

Reference to the actor associated with this collision area

pos

pos: Vector

Position of the collision area relative to the actor if it exists

Methods

collide

contains

  • contains(point: Vector): boolean
  • Return wether the area contains a point inclusive to it's border

    Parameters

    Returns boolean

debugDraw

  • debugDraw(ctx: CanvasRenderingContext2D, color: Color): any
  • Parameters

    • ctx: CanvasRenderingContext2D
    • color: Color

    Returns any

getAxes

  • Return the axes of this particular shape

    Returns Vector[]

getBounds

  • Return the axis-aligned bounding box of the collision area

    Returns BoundingBox

getCenter

  • The center point of the collision area, for example if the area is a circle it would be the center.

    Returns Vector

getFurthestPoint

  • Find the furthest point on the convex hull of this particular area in a certain direction.

    Parameters

    Returns Vector

getMomentOfInertia

  • getMomentOfInertia(): number
  • Return the calculated moment of intertia for this area

    Returns number

project

  • Create a projection of this area along an axis. Think of this as casting a "shadow" along an axis

    Parameters

    Returns Projection

rayCast

  • Return the point on the border of the collision area that intersects with a ray (if any).

    Parameters

    • ray: Ray
    • Optional max: number

    Returns Vector

recalc

  • recalc(): void
  • Recalculates internal caches and values

    Returns void