Options
All
  • Public
  • Public/Protected
  • All
Menu

Collider describes material properties like shape, bounds, friction of the physics object. Only one collider can be associated with a body at a time

Hierarchy

  • Collider

Implements

Index

Constructors

constructor

  • new Collider(__namedParameters: object): Collider

Properties

body

body: Body

Return a reference to the body associated with this collider

bounciness

bounciness: number = 0.2

The also known as coefficient of restitution of this actor, represents the amount of energy preserved after collision or the bounciness. If 1, it is 100% bouncy, 0 it completely absorbs.

friction

friction: number = 0.99

The coefficient of friction on this actor

group

group: CollisionGroup = CollisionGroup.All

Gets or sets the current collision group for the collider, colliders with like collision groups do not collide. By default, the collider will collide with all groups.

inertia

inertia: number = 1000

The current moment of inertia, moment of inertia can be thought of as the resistance to rotation.

mass

mass: number = 1

The current mass of the actor, mass can be thought of as the resistance to acceleration.

type

type: CollisionType = CollisionType.PreventCollision

Gets or sets the current collision type of this collider. By default it is (CollisionType.PreventCollision).

useShapeInertia

useShapeInertia: boolean

Accessors

active

  • get active(): boolean

bounds

center

id

  • get id(): number

localBounds

offset

shape

Methods

clear

  • clear(): void

clone

collide

debugDraw

  • debugDraw(ctx: CanvasRenderingContext2D): void

emit

getClosestLineBetween

off

  • off(eventName: string, handler?: function): void

on

  • on(eventName: string, handler: function): void

once

  • once(eventName: string, handler: function): void

touching

update

  • update(): void