Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pair

Models a potential collision between 2 bodies

Hierarchy

  • Pair

Index

Constructors

constructor

  • Parameters

    Returns Pair

Properties

bodyA

bodyA: Body

bodyB

bodyB: Body

collision

collision: CollisionContact = null

id

id: string = null

Methods

collide

  • collide(): void
  • Runs the collison intersection logic on the members of this pair

    Returns void

debugDraw

  • debugDraw(ctx: CanvasRenderingContext2D): void
  • Parameters

    • ctx: CanvasRenderingContext2D

    Returns void

resolve

  • Resovles the collision body position and velocity if a collision occured

    Parameters

    Returns void

Static calculatePairHash

  • calculatePairHash(bodyA: Body, bodyB: Body): string
  • Calculates the unique pair hash id for this collision pair

    Parameters

    Returns string