Skip to main content

CircleCollider

This is a circle collider for the excalibur rigid body physics simulation

Hierarchy

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> = ...

publicoffset

offset: Vector = Vector.Zero

Position of the circle relative to the collider, by default (0, 0).

publicowner

owner: Entity<any>

Accessors

publicaxes

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


    Returns Vector[]

publicbounds

  • Get the axis aligned bounding box for the circle collider in world coordinates


    Returns BoundingBox

publiccenter

  • Get the center of the collider in world coordinates


    Returns Vector

publiclocalBounds

  • Get the axis aligned bounding box for the circle collider in local coordinates


    Returns BoundingBox

publicradius

  • get radius(): number
  • set radius(val: number): void
  • Get the radius of the circle


    Returns number

  • Set the radius of the circle


    Parameters

    • val: number

    Returns void

publicworldPos

  • Position of the collision collider in world coordinates


    Returns Vector

Methods

publicclone

  • Returns a clone of this shape, not associated with any collider


    Returns CircleCollider

publiccollide

publiccontains

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


    Parameters

    Returns boolean

publicdebug

publicgetClosestLineBetween

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


    Parameters

    Returns LineSegment

publicgetFurthestLocalPoint

  • Find the local point on the shape in the direction specified


    Parameters

    Returns Vector

publicgetFurthestPoint

  • Find the point on the collider furthest in the direction specified


    Parameters

    Returns Vector

publicgetInertia

  • getInertia(mass: number): number

publicproject

  • Project the circle along a specified axis


    Parameters

    Returns Projection

publicrayCast

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


    Parameters

    • ray: Ray
    • max: number = Infinity

    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

publicupdate

  • Updates collider world space geometry


    Parameters

    Returns void