Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for objects tracking overlap of many AABBs.

Hierarchy

  • IBroadPhase

Implemented by

Index

Methods

CreateProxy

  • Create a proxy with an initial AABB. Pairs are not reported until UpdatePairs is called.

    Parameters

    • aabb: b2AABB

      Proxy Fat AABB.

    • userData: any

      User defined data.

    Returns b2DynamicTreeNode

    Proxy created from aabb and userData.

DestroyProxy

  • Destroy a proxy. It is up to the client to remove any pairs.

    Parameters

    Returns void

GetFatAABB

  • Get the Fat AABB for a proxy.

    Parameters

    Returns b2AABB

GetProxyCount

  • GetProxyCount(): number
  • Get the number of proxies.

    Returns number

    Number of proxies.

GetUserData

  • Get user data from a proxy. Returns null if the proxy is invalid.

    Parameters

    Returns any

    Gets the user data from proxy, or null if the proxy is invalid.

MoveProxy

  • Call MoveProxy as many times as you like, then when you are done call UpdatePairs to finalized the proxy pairs (for your time step).

    Parameters

    Returns void

Query

  • Query an AABB for overlapping proxies. The callback is called for each proxy that overlaps the supplied AABB. The callback should match function signature fuction callback(proxy:b2DynamicTreeNode):Boolean and should return false to trigger premature termination.

    Parameters

    • callback: (proxy: b2DynamicTreeNode) => boolean

      Called for each proxy that overlaps the supplied AABB. param proxy Proxy overlapping the supplied AABB.

    • aabb: b2AABB

      Proxies are query for overlap on this AABB.

    Returns void

RayCast

  • Ray-cast against the proxies in the tree. This relies on the callback to perform a exact ray-cast in the case were the proxy contains a shape. The callback also performs the any collision filtering. This has performance roughly equal to k log(n), where k is the number of collisions and n is the number of proxies in the tree.

    Parameters

    Returns void

Rebalance

  • Rebalance(iterations: number): void
  • Perform some iterations to re-balance the tree.

    Parameters

    • iterations: number

      Number of rebalance iterations to perform.

    Returns void

Generated using TypeDoc