Skip to main content

abstractCollider

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

Hierarchy

Implements

Index

Constructors

constructor

Properties

publiccomposite

composite: CompositeCollider = null

Composite collider if any this collider is attached to

WARNING do not tamper with this property

publicevents

events: EventEmitter<any> = ...

publicreadonlyid

id: Id<collider> = ...

offset

offset: Vector = Vector.Zero

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

publicowner

owner: Entity<any>

Accessors

abstractaxes

  • Return the axes of this particular collider


    Returns Vector[]

abstractbounds

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


    Returns BoundingBox

abstractcenter

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


    Returns Vector

abstractlocalBounds

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


    Returns BoundingBox

abstractworldPos

  • Position of the collision collider in world coordinates


    Returns Vector

Methods

abstractclone

  • Returns Collider

abstractcollide

abstractcontains

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


    Parameters

    Returns boolean

abstractdebug

abstractgetClosestLineBetween

  • Returns the closest line between the surfaces this collider and another


    Parameters

    Returns LineSegment

abstractgetFurthestPoint

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


    Parameters

    Returns Vector

abstractgetInertia

  • getInertia(mass: number): number
  • Parameters

    • mass: number

    Returns number

abstractproject

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


    Parameters

    Returns Projection

abstractrayCast

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


    Parameters

    • ray: Ray
    • optionalmax: number

    Returns RayCastHit

publictouching

  • Returns a boolean indicating whether this body collided with or was in stationary contact with the body of the other Collider


    Parameters

    Returns boolean

abstractupdate

  • Updates collider world space geometry


    Parameters

    Returns void