Options
All
  • Public
  • Public/Protected
  • All
Menu

A collision shape specifies the geometry that can detect when other collision shapes intersect for the purposes of colliding 2 objects in excalibur.

Hierarchy

Implemented by

Index

Properties

axes

axes: Vector[]

Return the axes of this particular shape

bounds

bounds: BoundingBox

Return the axis-aligned bounding box of the collision shape in world coordinates

center

center: Vector

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

Optional collider

collider: Collider

Reference to the collider associated with this collision shape geometry

inertia

inertia: number

Return the calculated moment of inertia for this shape

localBounds

localBounds: BoundingBox

Return the axis-aligned bounding box of the collision shape in local coordinates

offset

offset: Vector

Pixel offset of the collision shape relative to the collider, by default (0, 0) meaning the shape is positioned on top of the collider.

worldPos

worldPos: Vector

Position of the collision shape in world coordinates

Methods

clone

collide

contains

  • contains(point: Vector): boolean

debugDraw

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

draw

  • draw(ctx: CanvasRenderingContext2D, color?: Color, pos?: Vector): void

getClosestLineBetween

getFurthestPoint

project

rayCast

recalc

  • recalc(): void