@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 destroyProxy(int proxyId) { unbufferMove(proxyId); --m_proxyCount; m_tree.destroyProxy(proxyId); }
@Override public void drawTree(DebugDraw argDraw) { m_tree.drawTree(argDraw); }
final AABB fatAABB = m_tree.getFatAABB(m_queryProxyId); m_tree.query(this, fatAABB); while (i < m_pairCount) { Pair primaryPair = m_pairBuffer[i]; Object userDataA = m_tree.getUserData(primaryPair.proxyIdA); Object userDataB = m_tree.getUserData(primaryPair.proxyIdB);
@Override public Object getUserData(int proxyId) { return m_tree.getUserData(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 raycast(final TreeRayCastCallback callback, final RayCastInput input) { m_tree.raycast(callback, input); }
@Override public final void query(final TreeCallback callback, final AABB aabb) { m_tree.query(callback, aabb); }
@Override public AABB getFatAABB(int proxyId) { return m_tree.getFatAABB(proxyId); }
@Override public float getTreeQuality() { return m_tree.getAreaRatio(); }
@Override public final int getTreeHeight() { return m_tree.getHeight(); }
final AABB fatAABB = m_tree.getFatAABB(m_queryProxyId); m_tree.query(this, fatAABB); while (i < m_pairCount) { Pair primaryPair = m_pairBuffer[i]; Object userDataA = m_tree.getUserData(primaryPair.proxyIdA); Object userDataB = m_tree.getUserData(primaryPair.proxyIdB);
@Override public Object getUserData(int proxyId) { return m_tree.getUserData(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 raycast(final TreeRayCastCallback callback, final RayCastInput input) { m_tree.raycast(callback, input); }
@Override public final void query(final TreeCallback callback, final AABB aabb) { m_tree.query(callback, aabb); }
@Override public boolean testOverlap(int proxyIdA, int proxyIdB) { // return AABB.testOverlap(proxyA.aabb, proxyB.aabb); // return m_tree.overlap(proxyIdA, proxyIdB); final AABB a = m_tree.getFatAABB(proxyIdA); final AABB b = m_tree.getFatAABB(proxyIdB); if (b.lowerBound.x - a.upperBound.x > 0.0f || b.lowerBound.y - a.upperBound.y > 0.0f) { return false; } if (a.lowerBound.x - b.upperBound.x > 0.0f || a.lowerBound.y - b.upperBound.y > 0.0f) { return false; } return true; }
@Override public float getTreeQuality() { return m_tree.getAreaRatio(); }
@Override public final int getTreeHeight() { return m_tree.getHeight(); }
final AABB fatAABB = m_tree.getFatAABB(m_queryProxyId); m_tree.query(this, fatAABB); while (i < m_pairCount) { Pair primaryPair = m_pairBuffer[i]; Object userDataA = m_tree.getUserData(primaryPair.proxyIdA); Object userDataB = m_tree.getUserData(primaryPair.proxyIdB);