Interface BroadPhaseStrategy
- All Known Implementing Classes:
DynamicTree
public interface BroadPhaseStrategy
-
Method Summary
Modifier and TypeMethodDescriptionintCompute the height of the tree.intcreateProxy(AABB aabb, java.lang.Object userData) Create a proxy.voiddestroyProxy(int proxyId) Destroy a proxyvoidfloatGet the ratio of the sum of the node areas to the root area.getFatAABB(int proxyId) intCompute the height of the binary tree in O(N) time.intintGet the maximum balance of an node in the tree.java.lang.ObjectgetUserData(int proxyId) booleanMove a proxy with a swepted AABB.voidquery(TreeCallback callback, AABB aabb) Query an AABB for overlapping proxies.voidraycast(TreeRayCastCallback callback, RayCastInput input) Ray-cast against the proxies in the tree.
-
Method Details
-
createProxy
Create a proxy. Provide a tight fitting AABB and a userData pointer.- Parameters:
aabb-userData-- Returns:
-
destroyProxy
void destroyProxy(int proxyId) Destroy a proxy- Parameters:
proxyId-
-
moveProxy
-
getUserData
java.lang.Object getUserData(int proxyId) -
getFatAABB
-
query
Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB.- Parameters:
callback-araabbgAABB-
-
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:
callback- a callback class that is called for each proxy that is hit by the ray.input- the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).
-
computeHeight
int computeHeight()Compute the height of the tree. -
getHeight
int getHeight()Compute the height of the binary tree in O(N) time. Should not be called often.- Returns:
-
getMaxBalance
int getMaxBalance()Get the maximum balance of an node in the tree. The balance is the difference in height of the two children of a node.- Returns:
-
getAreaRatio
float getAreaRatio()Get the ratio of the sum of the node areas to the root area.- Returns:
-
getInsertionCount
int getInsertionCount() -
drawTree
-