public void createProxies(BroadPhase broadPhase, final Transform xf) { assert (m_proxyCount == 0); // Create proxies in the broad-phase. m_proxyCount = m_shape.getChildCount(); for (int i = 0; i < m_proxyCount; ++i) { FixtureProxy proxy = m_proxies[i]; m_shape.computeAABB(proxy.aabb, xf, i); proxy.proxyId = broadPhase.createProxy(proxy.aabb, proxy); proxy.fixture = this; proxy.childIndex = i; } }
/** * Internal method * * @param broadPhase */ public void destroyProxies(BroadPhase broadPhase) { // Destroy proxies in the broad-phase. for (int i = 0; i < m_proxyCount; ++i) { FixtureProxy proxy = m_proxies[i]; broadPhase.destroyProxy(proxy.proxyId); proxy.proxyId = BroadPhase.NULL_PROXY; } m_proxyCount = 0; }
/** * Get the number of broad-phase proxies. * * @return */ public int getProxyCount() { return m_contactManager.m_broadPhase.getProxyCount(); }
for (int i = 0; i < f.m_proxyCount; ++i) { FixtureProxy proxy = f.m_proxies[i]; AABB aabb = m_contactManager.m_broadPhase.getFatAABB(proxy.proxyId); if (aabb != null) { Vec2[] vs = avs.get(4); m_contactManager.m_broadPhase.drawTree(m_debugDraw);
public boolean treeCallback(int nodeId) { FixtureProxy proxy = (FixtureProxy) broadPhase.getUserData(nodeId); return callback.reportFixture(proxy.fixture); }
/** * Gets the height of the dynamic tree * * @return */ public int getTreeHeight() { return m_contactManager.m_broadPhase.getTreeHeight(); }
/** * 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(); }
displacement.y = transform2.p.y - transform1.p.y; broadPhase.moveProxy(proxy.proxyId, proxy.aabb, displacement);
for (int i = 0; i < f.m_proxyCount; ++i) { FixtureProxy proxy = f.m_proxies[i]; AABB aabb = m_contactManager.m_broadPhase.getFatAABB(proxy.proxyId); if (aabb != null) { Vec2[] vs = avs.get(4); m_contactManager.m_broadPhase.drawTree(m_debugDraw);
public float raycastCallback(RayCastInput input, int nodeId) { Object userData = broadPhase.getUserData(nodeId); FixtureProxy proxy = (FixtureProxy) userData; Fixture fixture = proxy.fixture; int index = proxy.childIndex; boolean hit = fixture.raycast(output, input, index); if (hit) { float fraction = output.fraction; // Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2; temp.set(input.p2).mulLocal(fraction); point.set(input.p1).mulLocal(1 - fraction).addLocal(temp); return callback.reportFixture(fixture, point, output.normal, fraction); } return input.maxFraction; }
/** * Gets the height of the dynamic tree * * @return */ public int getTreeHeight() { return m_contactManager.m_broadPhase.getTreeHeight(); }
/** * 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(); }
displacement.y = transform2.p.y - transform1.p.y; broadPhase.moveProxy(proxy.proxyId, proxy.aabb, displacement);
for (int i = 0; i < f.m_proxyCount; ++i) { FixtureProxy proxy = f.m_proxies[i]; AABB aabb = m_contactManager.m_broadPhase.getFatAABB(proxy.proxyId); Vec2[] vs = avs.get(4); vs[0].set(aabb.lowerBound.x, aabb.lowerBound.y); m_contactManager.m_broadPhase.drawTree(m_debugDraw);
public boolean treeCallback(int nodeId) { FixtureProxy proxy = (FixtureProxy) broadPhase.getUserData(nodeId); return callback.reportFixture(proxy.fixture); }
/** * Gets the height of the dynamic tree * * @return */ public int getTreeHeight() { return m_contactManager.m_broadPhase.getTreeHeight(); }
/** * Gets the balance of the dynamic tree * * @return */ public int getTreeBalance() { return m_contactManager.m_broadPhase.getTreeBalance(); }
public void createProxies(BroadPhase broadPhase, final Transform xf) { assert (m_proxyCount == 0); // Create proxies in the broad-phase. m_proxyCount = m_shape.getChildCount(); for (int i = 0; i < m_proxyCount; ++i) { FixtureProxy proxy = m_proxies[i]; m_shape.computeAABB(proxy.aabb, xf, i); proxy.proxyId = broadPhase.createProxy(proxy.aabb, proxy); proxy.fixture = this; proxy.childIndex = i; } }