Class b2DynamicTreeBroadPhase

The broad-phase is used for computing pairs and performing volume queries and ray casts. This broad-phase does not persist pairs. Instead, this reports potentially new pairs. It is up to the client to consume the new pairs and to track subsequent overlap.

Index

Constructor methods

Methods

Constructor methods

constructor(): b2DynamicTreeBroadPhase

Creates the dynamic tree broad phase.

Returns

b2DynamicTreeBroadPhase

Methods

public CreateProxy(aabb: b2AABB, userData: any): b2DynamicTreeNode

see

IBroadPhase.CreateProxy

Parameters

Returns

b2DynamicTreeNode

public DestroyProxy(proxy: b2DynamicTreeNode)

see

IBroadPhase.DestroyProxy

Parameters

public GetFatAABB(proxy: b2DynamicTreeNode): b2AABB

see

IBroadPhase.GetFatAABB

Parameters

Returns

b2AABB

public GetProxyCount(): number

see

IBroadPhase.GetProxyCount

Returns

number

public GetUserData(proxy: b2DynamicTreeNode): any

see

IBroadPhase.GetUserData

Parameters

Returns

any

public MoveProxy(proxy: b2DynamicTreeNode, aabb: b2AABB, displacement: b2Vec2)

see

IBroadPhase.MoveProxy

Parameters

public Query(callback: (proxy: Box2D.Collision.b2DynamicTreeNode) => boolean, aabb: b2AABB)

see

IBroadPhase.Query

Parameters

  • callback: (proxy: Box2D.Collision.b2DynamicTreeNode) => boolean
  • aabb: b2AABB

public RayCast(callback: (input: Box2D.Collision.b2RayCastInput, proxy: Box2D.Collision.b2DynamicTreeNode) => number, input: b2RayCastInput)

see

IBroadPhase.RayCast

Parameters

  • callback: (input: Box2D.Collision.b2RayCastInput, proxy: Box2D.Collision.b2DynamicTreeNode) => number
  • input: b2RayCastInput

public Rebalance(iterations: number)

see

IBroadPhase.Rebalance

Parameters

  • iterations: number

public TestOverlap(proxyA: b2DynamicTreeNode, proxyB: b2DynamicTreeNode): boolean

Tests if two proxies overlap.

Parameters

Returns

boolean

True if the proxyA and proxyB overlap with Fat AABBs, otherwise false.

public UpdatePairs(callback: (userDataA: any, userDataB: any) => void)

Update the pairs. This results in pair callbacks. This can only add pairs.

Parameters

  • callback: (userDataA: any, userDataB: any) => void

    Called for all new proxy pairs. param userDataA Proxy A in the pair user data. param userDataB Proxy B in the pair user data.

public Validate()

Validates the dynamic tree. NOTE: this says "todo" in the current Box2DFlash code.