Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DynamicTreeCollisionBroadphase

Hierarchy

  • DynamicTreeCollisionBroadphase

Implements

Index

Properties

Private _collisionHash

_collisionHash: object

Type declaration

  • [key: string]: boolean

Private _collisionPairCache

_collisionPairCache: Pair[] = []

Private _dynamicCollisionTree

_dynamicCollisionTree: DynamicTree = new DynamicTree()

Methods

Private _canCollide

  • _canCollide(actorA: Actor, actorB: Actor): boolean
  • Parameters

    Returns boolean

broadphase

  • Detects potential collision pairs in a broadphase approach with the dynamic aabb tree strategy

    Parameters

    Returns Pair[]

debugDraw

  • debugDraw(ctx: CanvasRenderingContext2D, delta: number): void
  • Parameters

    • ctx: CanvasRenderingContext2D
    • delta: number

    Returns void

narrowphase

  • Applies narrow phase on collision pairs to find actual area intersections

    Parameters

    Returns void

resolve

  • Perform collision resolution given a strategy (rigid body or box) and move objects out of intersect.

    Parameters

    Returns void

track

  • track(target: Body): void
  • Tracks a physics body for collisions

    Parameters

    Returns void

untrack

  • untrack(target: Body): void
  • Untracks a physics body

    Parameters

    Returns void

update

  • update(targets: Actor[], delta: number): number
  • Update the dynamic tree positions

    Parameters

    • targets: Actor[]
    • delta: number

    Returns number