@Override public final int createProxy(final AABB aabb, Object userData) { int proxyId = m_tree.createProxy(aabb, userData); ++m_proxyCount; bufferMove(proxyId); return proxyId; }
@Override public final void moveProxy(int proxyId, final AABB aabb, final Vec2 displacement) { boolean buffer = m_tree.moveProxy(proxyId, aabb, displacement); if (buffer) { bufferMove(proxyId); } }
@Override public final void destroyProxy(int proxyId) { unbufferMove(proxyId); --m_proxyCount; m_tree.destroyProxy(proxyId); }
@Override public final void destroyProxy(int proxyId) { assert (0 <= proxyId && proxyId < m_nodeCapacity); DynamicTreeNode node = m_nodes[proxyId]; assert (node.child1 == null); removeLeaf(node); freeNode(node); }
@Override public void drawTree(DebugDraw argDraw) { if (m_root == null) { return; } int height = computeHeight(); drawTree(argDraw, m_root, 0, height); }
@Override public final void destroyProxy(int proxyId) { assert (0 <= proxyId && proxyId < m_nodeCapacity); assert (m_child1[proxyId] == NULL_NODE); removeLeaf(proxyId); freeNode(proxyId); }
@Override public void drawTree(DebugDraw argDraw) { if (m_root == NULL_NODE) { return; } int height = computeHeight(); drawTree(argDraw, m_root, 0, height); }
/** * Construct a world object. * * @param gravity the world gravity vector. */ public World(Vec2 gravity, IWorldPool pool) { this(gravity, pool, new DynamicTree()); }
@Override public Object getUserData(int proxyId) { return m_tree.getUserData(proxyId); }
@Override public final void query(final TreeCallback callback, final AABB aabb) { m_tree.query(callback, aabb); }
@Override public void drawTree(DebugDraw argDraw) { m_tree.drawTree(argDraw); }
/** * Gets the height of the dynamic tree * * @return */ public int getTreeHeight() { return m_contactManager.m_broadPhase.getTreeHeight(); }
/** * Query the world for all fixtures that potentially overlap the provided AABB. * * @param callback a user implemented callback class. * @param aabb the query box. */ public void queryAABB(QueryCallback callback, AABB aabb) { wqwrapper.broadPhase = m_contactManager.m_broadPhase; wqwrapper.callback = callback; m_contactManager.m_broadPhase.query(wqwrapper, aabb); }
/** * Gets the balance of the dynamic tree * * @return */ public int getTreeBalance() { return m_contactManager.m_broadPhase.getTreeBalance(); }
/** * Gets the quality of the dynamic tree * * @return */ public float getTreeQuality() { return m_contactManager.m_broadPhase.getTreeQuality(); }
/** * Get the number of broad-phase proxies. * * @return */ public int getProxyCount() { return m_contactManager.m_broadPhase.getProxyCount(); }
@Override public final int computeHeight() { return computeHeight(m_root); }
@Override public AABB getFatAABB(int proxyId) { return m_tree.getFatAABB(proxyId); }
@Override public int getTreeBalance() { return m_tree.getMaxBalance(); }
@Override public float getTreeQuality() { return m_tree.getAreaRatio(); }